FlashComGuru Home Imediasee Influxis Uvault Akamai
                                                                                       Forum Index | Active Topics | Register
                                                                                                          List Overview | List Archives
                                                                                                                           About this site | Advertise
 

home

Adobe AIR (8)
Applications (32)
Books & Training (9)
Collaboration (9)
Components (6)
Events (52)
Flash Player (11)
Flex (30)
FMS (73)
General (110)
Hosting (5)
Jobs (13)
Off topic (32)
Press Releases (11)
Site Check (8)
Tools (42)
Videos & Players (56)

Alltop, all the cool kids (and me)

 
Two words: jaw dropping. Check out this demo (double click to go full screen!) by Fabio 'I eat codecs for breakfast' Sonnati. Encoded at a mere 500bkit/sec this demonstrates just how well the H.264 codec can perform at low bitrates. Check Fabio's blog for more details and watch out for more upcoming demos.
I wonder if he will share his encoding settings with us. One thing I can guarantee already is that he set smoothing to true ;-)

Related Articles

Comments
[Add Comment]
i know it's a bit long, but here is my .sh script which can do this amazing quality encoding - it took 1 day to learn and optimize all that options

# inputfile bitrate framerate resolution audiofreq audiobitrate ptop pbottom pleft pright tmpfile logfile ffmpegpath

# SUBQ - time vs. quality
# 7=highest quality, 35% slower
# 6=high quality
# 5=normal quality - don't use in 2 pass
# ME - motion estimation
# hex=normal quality - don't use in 2 pass
# umh=high quality, 40% slower
# QCOMP
# 0=stills good, motion bad (constant bitrate)
# 1=motion good, stills ok (constant quality)
# 0.6=default
# 0.7-0.8=most people's taste
# KEYINT - keyframes interval (frames, 250 for 25 fps = 10 sec)
# REFS - reference frames
# TRELLIS - Trellis RD Quantization
# 0=disabled
# 1=a bit higher quality, slower
# 2=max quality, very slow

inputfile=$1
bitrate=$2
framerate=$3
resolution=$4
audiohz=$5
audiobitrate=$6
padtop=$7
padbottom=$8
padleft=$9
shift
padright=$9
shift
tmpfile=$9
shift
logfile=$9
shift
fpath=$9

threads=2
subq=6
keyint=$(bc -l <<< $framerate' * 10')
keyint=`echo "tmp=$keyint; tmp /= 1; tmp" | bc`
keyintmin=`echo "tmp=$framerate; tmp /= 1; tmp" | bc`

alloptions="-vcodec libx264 -b "$bitrate"000 -r "$framerate" -s "$resolution" -bf 3 -qcomp 0.7 -g "$keyint" -keyint_min "$keyintmin" -refs 5 -loop 1 -flags +4mv -cmp 256 -coder 0 -me_range 16 -sc_threshold 40 -i_qfactor 0.71 -level 30 -qmin 10 -qmax 51 -qdiff 4 -padcolor 000000 -padtop "$padtop" -padbottom "$padbottom" -padleft "$padleft" -padright "$padright

firstoptions="-subq 1 -me hex -partitions 0 -trellis 0 -flags2 +mixed_refs"

secondoptions="-subq "$subq" -me umh -partitions parti4x4+parti8x8+partp4x4+partp8x8+partb8x8 -flags2 +wpred+mixed_refs+brdo+8x8dct -trellis 1"

thecommand=$fpath"ffmpeg -y -i "$inputfile" -threads "$threads" -pass 1 -an $alloptions $firstoptions -passlogfile "$logfile" "$tmpfile

echo $thecommand
echo
$thecommand
echo

thecommand="rm "$tmpfile

echo $thecommand
echo
$thecommand
echo

thecommand=$fpath"ffmpeg -y -i "$inputfile" -threads "$threads" -pass 2 -acodec libfaac -ar "$audiohz" -ab "$audiobitrate"000 -ac 2 $alloptions $secondoptions -passlogfile "$logfile" "$tmpfile

echo $thecommand
echo
$thecommand
echo
# Posted By G | 2/2/08 3:32 PM
Damn, cool! :)
# Posted By injun #576871 | 2/2/08 6:12 PM
This is insanely good quality.....and 500k?? Holy *bleeping* shit!!

Would love to be able to stream live with these results! Wonder what kind of hardware it would take!!
# Posted By Andy | 2/3/08 3:59 AM
Beautiful video. I tried to show some others but they said they had problems with buffering. Is there any way you could but the same video up in VP6-S so we could compare them? Thank you.
# Posted By Bob_ahblah | 2/3/08 5:57 AM
converting to this high quality on a new iMac 20" takes 400-600% of the original time, which is 5fps if the source is 25fps for example

currently i don't see any possibility reach this quality for a live stream (with 2-pass encoding), but maybe in 2-3 years we'll have the right consumer CPUs to do that
# Posted By G | 2/3/08 1:06 PM
I also tried to show some friends but they all had problems with buffering.

Would love to see a comparison of the same video in VP6-S.

Thanks !
# Posted By Bart Kennes | 2/4/08 8:27 AM
La cagaste chuchetumare
# Posted By Jose prieto | 2/4/08 6:37 PM
Man, Fabio really upset some On2 investors with that video.
# Posted By Bob | 2/4/08 8:19 PM
So, lets say i shoot a video with my camera, and then want to display it on my website like fabios'. What are the steps? How do I encode it?
# Posted By Alexander | 2/7/08 11:26 PM
Hmmm. I'm not too impressed - the framerate is 2-4 fps - not exactly acceptable for video playback. My PC is pretty outdated, but I have a normal framerate when playing HD video in H.264 in Quicktime, so I don't know whether to blame the Flash Player or something in Fabios encoding.

Anyway, the stills look pretty good :O)
# Posted By Martin Pagh Ludvigsen | 2/11/08 12:01 PM
hey can someone explain to me how to use that .sh script?
# Posted By tasovi | 2/11/08 1:52 PM
I am also curious how to implament the script
# Posted By chad | 2/12/08 12:03 AM
Me too wondering how to use the .sh script. Any idea?
# Posted By Alexander | 2/12/08 2:07 AM
This is a Bash script, so it runs under various Unix, Linux and OSX systems. You can do the same in a .bat with a slightly different syntax for Windows.

It's calling FFMPEG with _very_ fine tuned parameters. The input parameters are in the first line (inputfile, etc.).
# Posted By G | 2/13/08 7:23 AM
can you give us a more detailed description on how to run that script with osx?
# Posted By tasovi | 2/13/08 8:03 AM
Save the script into a .sh file. Run Terminal, cd into the folder where the script is. Type ./scriptname.sh parameter1 parameter2 ... and hit enter.
Of course you need to install FFMPEG first, which is not easy. You need to install XCODE first from the OS X DVD, and then Google for some how to. Not easy (quite hard imho).
# Posted By G | 2/14/08 4:49 PM
Hello,

Amazing video in fullscreen.
I tried myself at home but doesn t work.
Using Mac Osx, Flash CS3, ffmpegx, i created a "hd.sh" file with the script of this article but I have a problem in the Terminal.

I type

/hd.sh parameter1 parameter2


the answer is :
-bash: /hd.sh: Permission denied

Can some body please help me?
thx
B
# Posted By Ben | 2/15/08 2:59 AM
chmod +x yourscript.sh

the parameter list is in the first line of the file, please fill in each (13 in sum)

ffmpegx is not ffmpeg, you need to compile ffmpeg yourself
# Posted By G | 2/15/08 11:22 AM
In your blog you say that you use 3 pass encoding but in this script you only use two pass encoding. Can you say the parameters passed to the script to take this video?
# Posted By skubix | 2/15/08 5:30 PM
DailyMotion just went HD yesterday with On2 "VP6F". Anybody familiar with this? I knew of VP6E and VP6S but the "F" version is new to me. http://www.dailymotion.com/hd
# Posted By JT | 2/19/08 1:54 PM
Hmm I've not heard of it. Their HD content may be HD resolution but not HD bitrates, the quality looks average.
# Posted By Stefan | 2/19/08 4:33 PM
the "F" it appears may stand for FFMPEG a illegal free use of the On2 codec possibly?
http://readlist.com/lists/mplayerhq.hu/ffmpeg-user...
flv vcodec parameters that stands for vp6f - ReadList.com
# Posted By JT | 2/20/08 4:42 AM
I'm trying to replicate these settings using MediaCoder x64 -- has anyone tried it with this? I can't quite figure out how to get it working as a batch file. Am trying to use MediaCoder to help with batch conversion of a bunch of files (WMV and AVI input files with good res/quality) to H264-encoded MP4.
# Posted By Rob Cole | 2/25/08 8:10 PM
Thanks for sharing this! But can someone please explain (or re-write to C code):
keyint=$(bc -l <<< $framerate' * 10')
keyint=`echo "tmp=$keyint; tmp /= 1; tmp" | bc`
keyintmin=`echo "tmp=$framerate; tmp /= 1; tmp" | bc`
# Posted By AXi | 3/3/08 6:54 PM
Figured it out already... (should have payed more attention during linux lessons)

keyint = $framerate * 10 (<- float)
keyint = 1/$keyint (<- int)
keyintmin = 1/$framerate (<- int)

Correct me if i'm wrong...
# Posted By AXi | 3/3/08 7:41 PM
Does your ffmpeg keep crashing when trying to encode? Refer to shis forum: http://arrozcru.no-ip.org/ffmpeg_forum/viewtopic.p...
# Posted By AXi | 3/4/08 12:56 PM
Hi, I'm using this ffmpeg params to encode my clips (low bitrate). What do you think about?

#Coding filmato (passo 1)
ffmpeg -y -i clip.mov -an -pass 1 -vcodec libx264 -b 120k -maxrate 120k -s 320x208 -aspect 4:3 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -subq 6 -trellis 0 -refs 5 -bf 5 -b_strategy 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.71 -qmin 10 -qmax 51 -qdiff 4 -deinterlace output.mp4

#Coding filmato (passo 2)
ffmpeg -y -i clip.mov -an -pass 2 -vcodec libx264 -b 120k -maxrate 120k -s 320x208 -aspect 4:3 -flags +loop -cmp +chroma -partitions +parti4x4+partp8x8+partb8x8 -flags2 +mixed_refs -me umh -subq 7 -trellis 2 -refs 5 -bf 5 -b_strategy 1 -coder 1 -me_range 16 -g 250 -keyint_min 25 -sc_threshold 40 -i_qfactor 0.71 -rc_eq 'blurCplx^(1-qComp)' -qcomp 0.71 -qmin 10 -qmax 51 -qdiff 4 -deinterlace output.mp4

More on my blog:http://www.alessandroscoscia.it/it/2008/03/04/vide... (in italian)
# Posted By Alessandro Scoscia | 3/7/08 2:39 PM
How come i send this video to other people and 3 our of 4 cannot view it? What are the minimum requirements for this video to show ? Thanks.
# Posted By Alexander | 3/11/08 5:53 PM
they need the very latest Flash Player
# Posted By Stefan Richter | 3/11/08 7:21 PM
pleze send me teh codez!
# Posted By kidE | 3/13/08 4:31 AM
anyone know what -bt is ?
# Posted By Jerome | 4/4/08 6:17 PM
Very nice settings. Never saw a video with that really good quality at such low bitrates.

To the one who asked about how to replica this into MediaCoder, look here:

http://forum.mediacoderhq.com/viewtopic.php?t=3669...
# Posted By SirAuron | 4/11/08 2:15 PM
I use the following parameters, but I get no video, only audio. No error messages during encoding.

Any suggestions?

ffmpeg -y -i input.flv -pass 1 -an
-vcodec libx264 -b 500000 -r 29.97 -s 1280x720 -bf 3 -qcomp 0.7 -g 299.7 -refs 5 -loop 1 -flags +4mv -cmp 256 -coder 0 -me_range 16 -sc_threshold 40 -i_qfactor 0.71 -level 30 -qmin 10 -qmax 51 -qdiff 4 -padcolor 000000 -padtop 0 -padbottom 0 -padleft 0 -padright 0 -subq 1 -me hex -partitions 0 -trellis 0 -flags2 +mixed_refs -passlogfile logfile.log temp_flash_file.flv

ffmpeg -y -i input.flv -pass 2 -acodec libfaac -ar 44100 -ab 96000 -ac 2 -vcodec libx264 -b 500000 -r 29.97 -s 1280x720 -bf 3 -qcomp 0.7 -g 299.7 -refs 5 -loop 1 -flags +4mv -cmp 256 -coder 0 -me_range 16 -sc_threshold 40 -i_qfactor 0.71 -level 30 -qmin 10 -qmax 51 -qdiff 4 -padcolor 000000 -padtop 0 -padbottom 0 -padleft 0 -padright 0 -subq 6 -me umh -partitions parti4x4+parti8x8+partp4x4partp8x8+partb8x8 -flags2 +wpred+mixed_refs+brdo+8x8dct -trellis 1 -passlogfile logfile.log theoutputfinale.flv
# Posted By antilope | 7/23/08 2:12 PM
i'm downloaded this "jpg" file ;) and analysed. this comression is very dependent on film dynamic. where the scenes is still, bitrate slow down to 100-200 kb/s ...in more dynamic scene it's jump even to 2000 kb/s.

PS. sorry for my bad english :P i'm usually use polish language ;)
# Posted By WiruSSS | 8/22/08 10:35 PM
I've asked this in other forums - but just remembered the flv experts here:)

Can you embed an flv file into a swf or swc without importing to stage in Flash? ie using a nice h264 encoded file as an asset inside a swf or swc.
# Posted By unhitched | 8/26/08 9:47 AM
First, thanks for the script... got it work without a hitch, even wrote a .php script to process "x" number of mpg files at a time. I have a couple questions though...

1) I have 500 movies to convert mpg to flv, I split the 500 into 5 batches of 100 and tried running the script in 5 instances. The problem I'm having is the resulting flv doesn't play video. Is there a switch being used here that prohibits the script from being ran "x" number of times simultaneously (separate .mpg files of course)?

2) When running a single instance to convert mpg to flv most flv's play just fine but there are some that do not - no video. I know all movies work fine, they were converted previously with more simpler settings. Any ideas?

3) Is there any sites that anyone can suggest/recommend to fully explain each setting? My overall goal is convert these mpg files to flv with the best possible quality while achieving the smallest file size.

Thanks
# Posted By Anthony | 9/12/08 3:59 AM
Hi,
the problem should be a ffmpeg bug in two pass encoding log files. The log file generated from ffmpeg have always the same name (it appears -passlogfile is ignored). You should call ffmpeg changing directory before the call (one temporary directory for each movies)
# Posted By Alessandro Scoscia | 9/12/08 7:26 AM
Thanks Alessandro, I caught on to this so I had created separate folders to run each instance (ie set1, set2, etc..) This still didn't help...
# Posted By Anthony | 9/12/08 7:29 AM
Thanks for putting this lovely script together. It certainly has saved me a lot of headache trying to sift through all the ffmpeg documentation.

Great job, and keep up the good work.
# Posted By eldowan | 9/16/08 10:24 PM