Quick update

We've been busy working on the labeling system that will power the website and hopefully make the search better and will allow to open for tagging contributions.
Please bare with us, I think it will worth the wait :)

Alpha Status Report #5 (Feb 7 to Feb 19 of 2010)

Here are the progress we made over the past 2 weeks:

  • More clips! The repository now has 2700 totally free clips!
  • Work to offer Dirac versions for all new clips finished. 450 clips already have their Dirac versions.
  • Transcoding jobs and contributors UI updated to accept and work for both 29.97fps and 23.976fps footage
  • Improved the quality of the generated thumbnails for new added clips, we might convert the old ones during next week too.
  • Other weblogs and people have posted about the project, special thanks to the folks at Open Video Alliance, that made a nice blog post about the free videos repository.
  • And of course bug fixes.
  • []s
    Fabricio

    How to convert AVCHD MTS files to Dirac/Ogg, Theora/Ogg, H.264/MP4 and JPEGs using free tools

    Currently on Public Videos alpha, the videos are shot with 2 different consumer camcorders which uses the AVCHD format: a Panasonic HDC SD-5 and a Canon Vixia HF11. All clips are captured in 1080p full HD and from the original files the system generates the different versions (at the moment they are 12 for each clip, including different sizes, formats thumbnails and poster images).

    All this transcoding work is made using free tools, the two main open source transcoding tools we use are mencoder and ffmpeg.

    It is a great thing that we are able to do everything using only free tools, and it is impressive to see how fast those two projects in particular evolve, the codebase is huge and very active, the pool of features they offer is mind-boggling and the maintainers and contributors are my heroes. But each of them has it's share of bugs too, so at the moment it is not possible to use only one of them for everything, you have to combine them and do the proccess in multiple steps, using the best tool for a particular part of the proccess in each step.

    In addition to mencoder and ffmpeg we also use ffmpeg2theora and ffmpeg2dirac to generate the final Ogg Video versions and MPlayer for the JPEGs.

    So, after consulting several forums, tutorials, manuals and other documentation online here is what we settled as workflow to convert our .MTS files, basically a conversion made in two parts for each version:

    1. Convert the camera file to an intermediate AVI file in a lossless manner or the closest we can get from lossless, to the correct framerate, deinterlacing and resizing it to the final dimensions
    2. Transcode the intermediate AVI to the final format, with the desired audio and video encoders, bitrates and presets

    Keep in mind that we are constantly changing the transcoding commands(public videos is alpha!) and the recipies described below might be already outdated, consult the database fixtures in our source control for the latest version of this command lines.

    Those two cameras stores whatever was shot in a 60 fps file regardless if you have used the 30P or 24P framerate setting, so the first part is to transcode from 60000/1001 fps to 30000/1001 or 24000/1001 fps deinterlacing (and de-telecining too in the 24fps case), we use mencoder because ffmpeg (at least until the moment of this post) can't do this framerate conversion for mts files correctly, resulting in files that has video and audio out of sync. The same problem is true for ffmpeg2theora and ffmpeg2dirac as well.

    So, for a clip shot in 30fps the command line for this first part of a convertion to a 480x270 ogv or mp4 would look like this:

    mencoder "$SOURCE" -o "$TARGET" -fps 60000/1001  -ofps 30000/1001 -noskip -mc 0 -demuxer mpegts -oac copy -ovc raw -vf scale=480:272,pullup,softskip,pp=lb

    However, if you try the same thing for a clip from the canon hf11 changing the -ofps to 24000/1001 you will end up with an intermediate file with artifacts due to a decoding issue that mencoder has. The solution then was to change this first step to the one found on this forum thread that uses a different demuxer and a different output format:

    mencoder "$SOURCE" -fps 60000/1001 -oac pcm -demuxer lavf -vf pp=ci,scale=480:272,detc,softskip -ofps 24000/1001 -ovc lavc -lavcopts vcodec=ffvhuff:format=YV12:vstrict=-1:aspect=16/9 -o "$TARGET"

    Once done this first step, you have a file that can be used as the source for all the versions, bellow are the command lines used for converting this intermediate file into 5 different formats:

    Convert a given video to theora ogv 1200k bitrate, two pass.

    ffmpeg2theora --videobitrate 1200 --keyint 30 --audiobitrate 128 --samplerate 44100 --optimize --two-pass -o "$TARGET" "$SOURCE"

    Converts a given video to dirac ogv 1000k bitrate.

    ffmpeg2dirac --videobitrate 1000 --keyint 30 --audiobitrate 128 --samplerate 44100 -o "$TARGET" "$SOURCE"

    Converts a given video to h2.64 baseline mp4 1000k bitrate, two pass.

    ffmpeg -i "$SOURCE"  -b 1000k -an -pass 1 -vcodec libx264 -vpre hq -vpre libx264-baseline -f ipod -threads 0 -benchmark -y /dev/null&&ffmpeg -i "$SOURCE" -b 1000k -pass 2 -vcodec libx264 -vpre hq -vpre libx264-baseline -acodec libfaac -ab 128k -ar 44100 -threads 0 -benchmark -y "$TARGET"

    Generate a JPG from the second #2 of a video

    mplayer "$SOURCE" -ss 2 -nosound -frames 1 -vo jpeg:outdir=$TARGET:smooth=0:quality=60:progressive

    Generate black and white low contrast JPG from the second #2 of a video

    mplayer "$SOURCE" -ss 2 -nosound -frames 1 -vo jpeg:outdir=$TARGET:smooth=0:quality=60:progressive -saturation -100 -brightness -0 -contrast -10

     

    The examples above are for our smaller size (480x272) we encode the larger sizes using higher bitrates.

    First batch with Dirac encoded clips

    I have just finished committing some changes in the code and uploaded new clips with 3 different video formats for each size: Dirac/Ogg, Theora/Ogg and H.264/MP4

    Dirac encoded clips are experimental, so please let me know if there is something wrong with the downloads or the playback (does any browser even support Dirac on a HTML5 video tag yet?).

    The bitrate I've used for the smaller sizes(480x272) was 1000k, and 1700k for the medium sizes(640x360), I've used ffmpeg2dirac and the dirac-research library, I did not used the Schröedinger implementation because even though it was faster, lots of the converted clips were presenting nasty artifacts in comparison with the other, so I assumed that Schrödinger was not quite ready for production (if you think you can help me configuring schro better please let me know).

    Here are the new clips to test:

    In the process I've also found a bug on Chromium and Google Chrome that forced me to use the dirac version <source> tag as the second option. More details in this ticket I have filled.

    ffmpeg2dirac on Mac OS X 10.6.2 (Snow Leopard)

    After a quick chat with Simon Phipps last week in São Paulo, I decided to check it out the current state of the Dirac codec as well as to see how the scripts and workflows for converting videos in other formats to it are. Mainly to study the possibility of providing Ogg/Dirac as another option for the videos on Public Videos in the future.

    So, the first step for me was to try and compile the necessary libraries and tools on my personal laptop, that happens to be a Mac running Snow Leopard, since the experience was not smooth here are some notes that might be helpful to others:

    My main goal was to try the ffmpeg2dirac convertion tool first, since I already use ffmpeg2theora and it is quite simple.

    I already have Ogg, Vorbis and Theora installed on my machine, so I won't cover the installation of those libraries here, but it should be trivial.

    I have opted to install only the dirac-research for now since installing schroedinger would give me more headaches, maybe I'll come back to it in the future.

    Installing dirac-research:
    curl -O http://diracvideo.org/download/dirac-research/dirac-1.0.2.tar.gz 
    tar -vxzf dirac-1.0.2.tar.gz 
    cd dirac-1.0.2 
    ./configure 
    make 
    sudo make install 

    Installing ffmpeg2dirac (that's the tricky part):

    You have to install scons first, here is my advice: DO NOT INSTALL SCONS USING MACPORTS!! Macports is bloated and will try to install a bunch of useless xorg dependencies if you go that path.

    I also havent got any lucky installing scons using easy_install, so the way I recommend it is to download the tar from http://www.scons.org/download.php , and follow the instructions here: http://www.scons.org/doc/1.2.0/HTML/scons-user/x166.html which is basically:

    cd scons-1.2.0
    python setup.py install

    Now download the source from the git repository:
    git clone git://diracvideo.org/git/ffmpeg2dirac.git ffmpeg2dirac 
    cd ffmpeg2dirac
     
    Edit the get_ffmpeg_svn.sh file to include the following line:

    extra="--arch=x86_64"

    Also, edit the ffmpegrev file so that:

    #FFMPEG_CO_DIR=$HOME"/tmp/ffmpeg_"$FFMPEG_REVISION
    FFMPEG_CO_DIR=ffmpeg

    Then:

    ./get_ffmpeg_svn.sh

    The scons script checks for an environment variable PKG_CONFIG_PATH that is supose to contain the directory where your ogg and vorbis pkgconfig .cp files are, which in my case was /usr/local/lib/pkgconfig/
    1. problem is: setting this with export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig/ will work for when you do scons, but not for sudo scons install
    2. so I found it easier to just edit the SConstruct file to replace the action = something lines on that script to my new hardcoded versions that looks like:
        # action = 'pkg-config --exists "%s"' % name
        action = 'PKG_CONFIG_PATH=%s /opt/local/bin/pkg-config --exists "%s"' % ('/usr/local/lib/pkgconfig/', name)
        # action = 'PKG_CONFIG_PATH=%s pkg-config %s "%s"' % (os.environ['PKG_CONFIG_PATH'], pkg_flags, name)
        action = 'PKG_CONFIG_PATH=%s /opt/local/bin/pkg-config %s "%s"' % (os.environ['PKG_CONFIG_PATH'], pkg_flags, name)

    Finally:

    scons
    sudo scons install

    I am pretty sure that it must have a better/easier way to install ffmpeg2dirac on mac, but I couldn't find out, this was what worked for me and my machine/setup, I am also not sure if this instructions can work on other macs, try them at your own risk :)

    Alpha Status Report #3 (week Jan 23 to Jan 30 2010)

    Not much development was made this week since I've spent most part of the week in a LAN party in Sao Paulo, presenting the project to other open source/free culture enthusiasts and meeting other folks.

    Here is the small summary:
    Starting tomorrow regular development goes back to normal, so expect the next status update to have more new stuff. :P
    []s
    Fabricio

    Alpha Status Report #2 (week Jan 16 to Jan 22 2010)

    Here is what happened this week in Public Videos Alpha:

    • We continued to increase the free clips pool, this week alone it has been added 669 new clips, currently there are  2062 clips in total!!
    • As for the code development, I've reviewed and improved the website markup to make it more friendly to users of text-based web browsers with no javascript support, and web crawlers.
    • Speaking of webcrawlers, the website now has a robots.txt allowing all search bots and a sitemap index (with basic video metadata too)
    • thanks to the changes above, Public Videos Alpha is now indexed by Google Video search, check it out!
    • Other than that, I've been pretty busy preparing some stuff to present the website on a  huge brazilian Lan Party next week in São Paulo. Mauricio made some awesome stickers designs and I had to hurry to find a place to print the stickers and test different options.

    As a result we now have our first Public Videos schwags :)

    Next week I will try to keep committing updates to the website from São Paulo, and some good surprises are expected from this gig. I'll try to keep everyone updated.

    []s
    Fabricio

    Stickers studies 3

       
    Click here to download:
    Stickers_studies_3.zip (340 KB)