So a lot of times on this forum I see references to ffmpeg commands running the x264 codec and then sometimes commands running the x264 cli. As a long time user of ffmpeg, I got to wondering that maybe ffmpeg just adds an unecessary layer to encodes iow slows it down.
Does anyone have any advice on using one or the other? Thanks as always.
+ Reply to Thread
Results 1 to 12 of 12
-
-
Pros/cons . Depends on the situation
Not all options are supported by ffmpeg libx264 . You were doing blu-ray encodes; --qpfile is an important one that is missing in ffmpeg when doing blu-ray to set IDR frames for chapters
x264 (vanilla version) doesn't support audio or filtering (e.g. resize) . If you need something quick for some scenarios, maybe a device or web - it's often faster with ffmpeg because it encodes audio & muxes at the same time with 1 command. (But there are other compiled binaries that have audio and filtering patches) -
Thanks pdr.
Actually, I am not trying to encode to blu-ray compliant. I just need to compress/encode my ProRes422 video to something that can be watched on a PC or TV. Granted, I am pushing it through a bunch of denoising, sharpening, color correction and various scene edits. But at the end of it all, I record 1920x1080p30 ProRes422 content and want to just encode it to 1920x1080p30 H.264. So the only requirement I am putting on x264 is to compress. No filters, resizing, etc.
One thing I seem to have noticed is that using x264.exe cli to encode from PP via frameserving seems to max out my hyperthreaded cpu much better than frameserving to ffmpeg and libx264. So that is a plus!
You bring up a good point about muxing that seems to be confounding me for some reason. After generating my .m4v, I am trying to figure out what to do with my audio. I have tried various methods. But it seems to me, the most straightforward is to encode as AAC straight out of PP then mux the m4v and m4a using ffmpeg. But I keep getting strange errors. Any recommendations on a suitable workflow?
ThanksLast edited by SameSelf; 6th Jun 2015 at 13:13.
-
You can try setting -threads manually to some higher number
But some ffmpeg builds are compiled and optimized for certain CPU architectures like AMD, which run slower on Intel chips (and vice versa)
You bring up a good point about muxing that seems to be confounding me for some reason. After generating my .m4v, I am trying to figure out what to do with my audio. I have tried various methods. But it seems to me, the most straightforward is to encode as AAC straight out of PP then mux the m4v and m4a using ffmpeg. But I keep getting strange errors. Any recommendations on a suitable workflow?
m4v as in elementary h.264 video ? direct from AME ?
Other options - you can mux with mkvtoolnix or mp4box
To mux elementary streams in ffmpeg, you need to specify the -f (for format of the specific stream ), before the -i (for input of that specific stream) -
-
Compiled for different architectures? That is news to me. The ffmpeg version I have must not be optimized for my Intel cpu then.
I am not sure tbh. Here is my workflow. Use DebugMode Frameserver to frameserve out of PP to an avisynth script which I open in x264 to encode to m4v. So I assume DMFS bypasses AME altogether. But I am not sure what you mean by an elementary H.264.
Code:x264.exe --preset slow --tune film --crf 20 -o "output.m4v" "signpost.avs"
Code:ffmpeg -i .m4v -i .m4a -c copy .mp4
Code:[mp4 @ 0000000005496c00] pts has no valueB time=00:01:06.38 bitrate=17192.2kbits/s
-
NeroAACEnc has a HUGE encoder delay, which may lead to sync issues...
It was designed for compressing Audio-CD tracks, apparently -
Good to know. I am a little nervous about grabbing just any tool for the job. To me the most intuitive workflow is to export my audio out of PP using AME to encode into the AAC format. Then wrap/mux the video and audio files into an MP4. But maybe exporting out of PP to a WAV and encoding to AAC with some other tool is preferred?
-
An elementary stream is independent audio or video , without a container. For an AVC stream, precede the -i with -f h264
You should specify the correct framerate as an input option (before -i ) when muxing elementary streams
You might need to use the bitstream filter -bsf:a aac_adtstoasc depending on the AAC audio (it will tell you)
ffmpeg -r 24 -f h264 -i input.m4v -f aac -i input.aac -c:v copy -c:a copy output.mp4 -
For me x264 always produces best quality and compliance, ffmpeg always produces fastest encodes at decent quality. So when quality and compliance is a priority, I'll always choose x264. When I'm just uploading to web, I'll always choose ffmpeg for speed and convenience.
That's it in a nutshell.......Got my retirement plans all set. Looks like I only have to work another 5 years after I die........ -
I simplified posted script below just to show important lines, that gives me no lag, everything is fine, in sync, avi is coming from frame server,
Code:SET x264="%~dp0tools\x264\x264.exe" SET BePipe="%~dp0tools\BePipe\BePipe.exe" SET neroAacEnc="%~dp0tools\neroAacEnc\neroAacEnc.exe" SET MP4box="%~dp0tools\MP4box\MP4box.exe" echo AviSource("signpost.avi") > "avs.avs" echo #add whatever to script >> "avs.avs" %x264% --crf 18 --bff --sar 8:9 --ref 6 --vbv-bufsize 20000 --vbv-maxrate 20000 --output "out.264" "avs.avs" %BePipe% --script "Import(^avs.avs^)" ^| %neroAacEnc% -lc -cbr 256000 -if - -of "out.m4a" %MP4box% -add "out.264" -add ""out.m4a"#audio -new "out.mp4"
so it uses x264 cli, avisynth, nero encoder and mp4box, ..., I understand that if used to ffmpeg it could get more easy, etc, but this separation has its advantages also, if using mkvmerge for muxing instead of mp4box, it is more versatile than ffmpeg or for example, you do not trust nero, then you use some other audio encoder, favorite of yours, I think they can be piped also ... -
Thanks racer-x. That's good to know. I think I am pretty happy frameserving to x264 vs ffmpeg now. With PDR's help I got all the kinks worked out. As for the audio, I simply export it as an elementary aac stream out of PPro using AME. It's quick and no need for external filters/encoders. And as far as I can tell perfectly fine. Then wrap the streams as an MP4 using mp4box.
Similar Threads
-
x264 CLI How to Hard-code Subtitles?
By dark_cross in forum SubtitleReplies: 4Last Post: 8th Apr 2013, 20:06 -
X264 CLI Syntax Help
By Eva-Unit01 in forum DVD RippingReplies: 9Last Post: 2nd Dec 2011, 17:42 -
Multiavchd:override presets by using custom x264 cli
By lutinor in forum Newbie / General discussionsReplies: 0Last Post: 4th May 2011, 02:53 -
x264 CLI
By zammil in forum Video ConversionReplies: 16Last Post: 22nd Jan 2011, 11:22 -
Need help with .vob's + x264 cli
By Frost746 in forum Newbie / General discussionsReplies: 2Last Post: 20th Jul 2010, 21:14