[FFmpeg-user] Setting up a watch folder to encode adaptive bit rate videos

Henk D. Schoneveld belcampo at zonnet.nl
Sat Oct 31 20:36:54 CET 2015


On 30 Oct 2015, at 03:40, Joel Lopez <badassmexican at gmail.com> wrote:

> Hi,
> 
> I've been reading as much stuff as I can find what the best way to
> encode key frame aligned videos.  Hopefully you can help me fill in
> the blanks.
> 
> 1.  Single or 2-pass encoding?  I'm reading quality isn't affected
> much and that it may be possible to have aligned key frames with
> either one.  What do you guys do?
2-pass in my opinion only makes sense when the resulting file has to be stored max-quality to finite storage medium. CD/DVD etc.
Do some testing and look what % is saved and relate to the extra time/energy invested in that 2nd pass. 
> 
> A blog I found says I can just use this:
> http://blog.streamroot.io/encode-multi-bitrate-videos-mpeg-dash-mse-based-media-players/
> 
> -x264opts 'keyint=24:min-keyint=24:no-scenecut’
FWIW 
how many times does one have changing bitrates as a result of differing line speeds
and
how many scene changes are there watching the same content.

AFAIK 
blocking key frames on scene cuts/changes will result in more or less visible degraded quality.
where differing in line speed quality and changing the used stream possibly results in ‘a few’ more or less frames.
I don’t know which of the 2 is worse, haven’t tested. The scene change ‘problem’ will always be there while line speed quality differences occur probably only when ‘on the move’.

My gut-feeling tells me the trade-offs of avoiding key frames on scene-cuts are greater. But as said haven’t tested this.
> 
> Wowza says to do 2-passes like this:
> http://www.wowza.com/forums/content.php?213-How-to-use-FFmpeg-with-Wowza-Media-Server-(MPEG-TS)
> 
> ffmpeg -y -i bigbuckbunny_1500.mp4 -c:a libfaac -ac 2 -ab 64k -c:v
> libx264 -preset:v veryfast -threads 0 -r 24 -g 48 -keyint_min 48
> -sc_threshold 0 -x264opts no-mbtree:bframes=1 -pass 1 -b:v 286k -s
> 384x216 bigbuck-350k.mp4
> ffmpeg -y -i bigbuckbunny_1500.mp4 -c:a libfaac -ac 2 -ab 64k -c:v
> libx264 -preset:v fast -threads 0 -r 24 -g 48 -keyint_min 48
> -sc_threshold 0 -x264opts no-mbtree:bframes=1 -pass 2 -b:v 286k -s
> 384x216 bigbuck-350k.mp4
> ffmpeg -y -i bigbuckbunny_1500.mp4 -c:a libfaac -ac 2 -ab 64k -c:v
> libx264 -preset:v fast -threads 0 -r 24 -g 48 -keyint_min 48
> -sc_threshold 0 -x264opts no-mbtree:bframes=1 -pass 2 -b:v 836k -s
> 640x360 bigbuck-900k.mp4
> 
> 
> 2. I want my videos to work on as many devices as possible of course.
> But I'm thinking of starting with 5 or 6 bit rates.  We have only upto
> 720p sources and stream on a Wowza server.  What bitrates do you
> stream?
> 
> Apple seems to recommend 8 files
> https://developer.apple.com/library/ios/technotes/tn2224/_index.html#//apple_ref/doc/uid/DTS40009745-CH1-SETTINGSFILES
> 
> Kaltura says you can get up to 40 if you have different files for
> desktop, iOS and Android.
> http://knowledge.kaltura.com/best-practices-multi-device-transcoding
> 
> Google does 5 versions with live encoder and I'm liking this.  I've
> seen they have 144p too on YouTube even though it's not listed.
> https://support.google.com/youtube/answer/2853702?hl=en
> 
> TLDR;
> Single or 2pass for key frame alignment?
> How many files and at what bitrates is a good starting point for
> mobile and desktop?
> 
> Thanks.
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user



More information about the ffmpeg-user mailing list