what FFMPEG performance settings to use for processing videos for the web -
i have few questions regarding usage of ffmpeg processing videos web. i'm beginner please bear me (although read docs on internet)
performance
- first of all, given fact ffmpeg utilizes cores @ 100%, actual parallelism efficiency?
let's assume following scenario. have video (fullhd, doesn't matter encoders / compression format used obtain video) , want resize (downscale) various sizes (e.g. 240px, 480px , 720px height) using mp4 format (thus using libx264 aac codecs).
using ffmpeg, see of laptop's cores (8) used @ 100% , wondering scenarios can improve overall performance of whole processing task. leads 2 scenarios: assuming video mentioned above input, obtaining 3 output videos (@ 240px, 480px , 720px height sizes), we:
- process input video , obtain 1 output video @ time, , let cores work @ same time @ 100%;
- process video obtain output videos in parallel, bounding each output video single processor core which'll work @ 100%;
so question reduced parallelism efficiency of ffmpeg program.
this means letting ffmpeg process task procvideo
- which takes 1 input video produce 1 single output video (transcoding/downscaling , on) - on n processor cores doesn't mean finish task n times faster letting run same task bound single core. if efficiency smaller 100%, it's better have n procvideo
tasks in parallel, each bound single core, rather doing task sequentially each output video.
codecs
other above performance problem, usage of codecs bugs me. trying obtain mp4 videos because of wide implementation of format in html5 browsers.
so having video input in format, want convert mp4. i'm using libx264 codec aac.
- use libx264, x264 or h264 video encoding/decoding?
- use libfdk_aac, libaacplus or aac audio encoding/decoding aac?
also, know licesing fees each of above codec, online resources on these quite limited / hard understand.
if shed light on questions, grateful! time!
there few unrelated questions here.
ffmpeg performance
all follows based on personal experience, , no means empirical evidence.
try might, you'll hard-pressed find software more optimized ffmpeg in performance. keep in mind of work in case done libx264, mature , insanely fast. (just try encode equivalent video h.265 using ffmpeg , not-quite-mature-yet x265, , you'll understand mean).
so in summary, can assume single encoding fast possible on machine, , parallelizing not improve anything.
an alternative solution test ask ffmpeg encode several files in single invocation, decoding part of pipeline done once, explained here: https://trac.ffmpeg.org/wiki/creating%20multiple%20outputs.
in end, should test each case measuring total encoding time each scenario.
codecs
x264 , libx264 1 , same, difference being latter used ffmpeg instead of being standalone tool. "h264", i'm not sure mean. in ffmpeg, h264 decoder, while libx264 encoder. don't have choice there.
about aac, essential information present in web page: https://trac.ffmpeg.org/wiki/encode/aac if can obtain build of ffmpeg linked against libfdk_aac, safest bet quality audio.
license fees
this sensitive subject. people outright refuse give advice, , i'm no exception, because legal advice implies liability in case of litigation.
to sum things up, see following urls:
- https://en.wikipedia.org/wiki/h.264/mpeg-4_avc#patent_licensing
- https://en.wikipedia.org/wiki/advanced_audio_coding#licensing_and_patents
some might argue difficulty of understanding information somehow done on purpose in order confuse general public.
Comments
Post a Comment