FORUMS: list search recent posts

FFmpeg 2 pass encoding

COW Forums : FFmpeg

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Jack Passmore
FFmpeg 2 pass encoding
on Oct 22, 2010 at 6:30:45 pm

Hi All,

I was hoping for some help. I think I'm doing this correctly, but I'm not sure. Can someone confirm for me that I am indeed doing 2 pass encoding using the following ffmpeg command?

ffmpeg -i video.avi -pass 1 -ab 320k -acodec libfaac -vcodec libx264 -vpre fast_firstpass -vf "crop=1440:1080:240:0,scale=640:480" -b 2000k -bt 2000k -threads 0 video.mp4

Thanks!
John


Return to posts index

Michael Rampe
Re: FFmpeg 2 pass encoding
on Oct 22, 2010 at 9:13:01 pm

[Jack Passmore] "ffmpeg -i video.avi -pass 1 -ab 320k -acodec libfaac -vcodec libx264 -vpre fast_firstpass -vf "crop=1440:1080:240:0,scale=640:480" -b 2000k -bt 2000k -threads 0 video.mp4"

This is doing the first pass only. For 2 pass libx264 using your example as a base:

ffmpeg -i video.avi -an -vcodec libx264 -vpre fast_firstpass -b 2000k -bt 2000k -vf "crop=1440:1080:240:0,scale=640:480" -pass 1 -threads 0 /dev/null && ffmpeg -i video.avi -ab 320k -acodec libfaac -vcodec libx264 -vpre normal -b 2000k -bt 2000k -vf "crop=1440:1080:240:0,scale=640:480" -pass 2 -threads 0 video.mp4

NOTE: this is all one line.

First pass: ignore audio and write to null as you will not use this video. libx264 generates it's own log file which will be used in the second pass. Use && to run the second ffmpeg line if the first one is successful. Second pass: write audio and video to output format.

Michael


Return to posts index

Jack Passmore
Re: FFmpeg 2 pass encoding
on Oct 27, 2010 at 5:54:12 pm

Great thanks,

This seems to work except for some of the videos where I get an error message and I'm not sure why. Maybe the first pass is dropping frames or something?

[libx264 @ 0x10181f400] 2nd pass has more frames than 1st pass (25082)bits/s ts/s
[libx264 @ 0x10181f400] continuing anyway, at constant QP=28
[libx264 @ 0x10181f400] disabling adaptive B-frames


Return to posts index


Michael Rampe
Re: FFmpeg 2 pass encoding
on Oct 27, 2010 at 11:00:55 pm

My mistake. There is a mismatch in the video presets.

-vpre fast_firstpass should be used with -vpre fast in the second pass instead of -vpre normal as I posted. It also appears that normal is not in the current SVN anymore.

Most of the libx264 presets are "matched" by a fast first pass preset and they need to be used together to work properly.

Check inside the ffpresets folder within your FFmpeg install to see the available presets for your build.

Michael


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]