VideoHelp Forum


Try StreamFab All-in-One and rip streaming video! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 12 of 12
Thread
  1. 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.
    Quote Quote  
  2. 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)
    Quote Quote  
  3. 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?

    Thanks
    Last edited by SameSelf; 6th Jun 2015 at 13:13.
    Quote Quote  
  4. Originally Posted by SameSelf View Post
    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 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?
    What strange errors ?

    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)
    Quote Quote  
  5. If you use avisynth script to tweak video via frame server, you can use the same avisynth script that you go from PP to encode audio as well, using Bepipe and for example nero encoder

    Code:
    BePipe.exe --script "Import(^your_script.avs^)" | neroAacEnc.exe -lc -cbr 256000 -if - -of "out.m4a"
    Quote Quote  
  6. Originally Posted by poisondeathray View Post
    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)
    Compiled for different architectures? That is news to me. The ffmpeg version I have must not be optimized for my Intel cpu then.

    Originally Posted by poisondeathray View Post
    What strange errors ?

    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)
    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"
    Now, I just need to define an suitable workflow for my audio then mux it with the m4v. There is lots of stuff out there on the web. The biggest problem I have when invoking the following command is:

    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
    Does this have something to do with the -f flags before -i you mention?
    Quote Quote  
  7. DECEASED
    Join Date
    Jun 2009
    Location
    Heaven
    Search Comp PM
    Originally Posted by _Al_ View Post
    ....... and for example nero encoder
    NeroAACEnc has a HUGE encoder delay, which may lead to sync issues...

    It was designed for compressing Audio-CD tracks, apparently
    Quote Quote  
  8. Originally Posted by El Heggunte View Post
    Originally Posted by _Al_ View Post
    ....... and for example nero encoder
    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?
    Quote Quote  
  9. 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
    Quote Quote  
  10. Member racer-x's Avatar
    Join Date
    Mar 2003
    Location
    3rd Rock from the Sun
    Search Comp PM
    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........
    Quote Quote  
  11. Originally Posted by SameSelf View Post
    Originally Posted by El Heggunte View Post
    Originally Posted by _Al_ View Post
    ....... and for example nero encoder
    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?
    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"
    I downloaded a while ago the whole thing that does that dropping frame server avi onto batch file, dmfs avi to mp4.zip, which is a bit sophisticated,you can have your avisynth script in ini file, it controls for avisynth syntax error or if there is audio (m4a or mp4 or aac) with same signpost name it muxes that audio into mp4, not using avs script audio

    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 ...
    Quote Quote  
  12. Originally Posted by racer-x View Post
    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.......
    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.
    Quote Quote  



Similar Threads