passlogfile cannot be found with multiple outputs...
I am encoding a single video to different formats/codecs using 2 pass encoding and a single command. The problem is that the way ffmpeg assign names to the passlogfile's for each output stream is not too smart. For example I call ffmpeg on a video so I set the first pass (-pass 1) with no audio (-an) and output to /dev/null. And set a custom name for the first pass log file (-passlogfile 2pass). This creates two log files named: 2pass-0.log and 2pass-1.log and everything seems ok. Unfortunately for the second pass I want to add the audio part too and here is when problems arise. With audio included now the output streams index is shifted as there are two new output streams (audio streams). In this case the second video stream for the first pass had index 1 but in the second pass it has index 2. This causes the second pass to look for a log file named "2pass-2.log" that does not exist and ffmpeg bails out. I can avoid this by including the audio streams also in the first pass but I would like to know if I can avoid this audio double encoding or if ffmpeg ignores audio streams in the first pass?? regads Horacio ## Fisrt pass ffmpeg -i AKB48.avi -s 640x480 -deinterlace -g 250 -async 50 -an -vcodec wmv2 -b 1900000 -pass 1 -f asf -y /dev/null -s360x270 -deinterlace -an -vcodec flv -b 500000 -pass 1 -passlogfile 2pass -f swf -y /dev/null FFmpeg version SVN-r16263, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --enable-gpl --enable-libx264 --enable-libamr-wb --enable-libamr-nb --enable-nonfree --enable-libfaac --enable-libfaad --enable-libtheora --enable-libvorbis --enable-encoder=g726 --enable-swscale --enable-encoder=ljpeg --enable-encoder=mjpeg --enable-libmp3lame --prefix=/usr --enable-pthreads --enable-libdirac libavutil 49.12. 0 / 49.12. 0 libavcodec 52. 8. 0 / 52. 8. 0 libavformat 52.23. 1 / 52.23. 1 libavdevice 52. 1. 0 / 52. 1. 0 libswscale 0. 6. 1 / 0. 6. 1 built on Dec 22 2008 15:28:11, gcc: 4.3.2 Input #0, avi, from 'AKB48.avi': Duration: 00:00:30.03, start: 0.000000, bitrate: 30348 kb/s Stream #0.0: Video: dvvideo, yuv411p, 720x480, 29.97 tb(r) Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Output #0, asf, to '/dev/null': Stream #0.0: Video: wmv2, yuv420p, 640x480, q=2-31, pass 1, 1900 kb/s, 29.97 tb(c) Output #1, swf, to '/dev/null': Stream #1.0: Video: flv, yuv420p, 360x270, q=2-31, pass 1, 500 kb/s, 29.97 tb(c) Stream mapping: Stream #0.0 -> #0.0 Stream #0.0 -> #1.0 Press [q] to stop encoding frame= 900 fps= 81 q=2.8 Lq=5.6 size= 0kB time=30.03 bitrate= 0.0kbits/s video:8924kB audio:0kB global headers:0kB muxing overhead -99.999989% ## Second pass ffmpeg -i AKB48.avi -s 640x480 -deinterlace -g 250 -async 50 -acodec wmav2 -ac 2 -ab 100k -vcodec wmv2 -b 1900000 -pass2 -f asf -y AKB48.wmv -s 360x270 -deinterlace -acodec libmp3lame -ar 22050 -vcodec flv -b 500000 -pass 2 -passlogfile 2pass -f swf -y AKB48.swf FFmpeg version SVN-r16263, Copyright (c) 2000-2008 Fabrice Bellard, et al. configuration: --enable-gpl --enable-libx264 --enable-libamr-wb --enable-libamr-nb --enable-nonfree --enable-libfaac --enable-libfaad --enable-libtheora --enable-libvorbis --enable-encoder=g726 --enable-swscale --enable-encoder=ljpeg --enable-encoder=mjpeg --enable-libmp3lame --prefix=/usr --enable-pthreads --enable-libdirac libavutil 49.12. 0 / 49.12. 0 libavcodec 52. 8. 0 / 52. 8. 0 libavformat 52.23. 1 / 52.23. 1 libavdevice 52. 1. 0 / 52. 1. 0 libswscale 0. 6. 1 / 0. 6. 1 built on Dec 22 2008 15:28:11, gcc: 4.3.2 Input #0, avi, from 'AKB48.avi': Duration: 00:00:30.03, start: 0.000000, bitrate: 30348 kb/s Stream #0.0: Video: dvvideo, yuv411p, 720x480, 29.97 tb(r) Stream #0.1: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Cannot read log file '2pass-2.log' for pass-2 encoding: No such file or directory
On date Friday 2008-12-26 14:30:54 +0900, Horacio Sanson encoded:
I am encoding a single video to different formats/codecs using 2 pass encoding and a single command. The problem is that the way ffmpeg assign names to the passlogfile's for each output stream is not too smart.
For example I call ffmpeg on a video so I set the first pass (-pass 1) with no audio (-an) and output to /dev/null. And set a custom name for the first pass log file (-passlogfile 2pass). This creates two log files named: 2pass-0.log and 2pass-1.log and everything seems ok.
Unfortunately for the second pass I want to add the audio part too and here is when problems arise. With audio included now the output streams index is shifted as there are two new output streams (audio streams). In this case the second video stream for the first pass had index 1 but in the second pass it has index 2. This causes the second pass to look for a log file named "2pass-2.log" that does not exist and ffmpeg bails out.
I can avoid this by including the audio streams also in the first pass but I would like to know if I can avoid this audio double encoding or if ffmpeg ignores audio streams in the first pass??
Currently it looks like you can't do that, you have to use the same number and order for the streams in the output when performing the first and second pass encoding (and the documentation for -passlogfile is wrong). Check this for some possible solution: http://thread.gmane.org/20081226120236.GB2535 at geppetto [...] Regards. -- ffmpeg-user random tip #11 One minute of video silence with ffmpeg: ffmpeg -t 60 -s qcif -f rawvideo -pix_fmt rgb24 -r 25 -i /dev/zero \ -y silence.mpeg
participants (2)
-
hsanson@gmail.com -
stefano.sabatini-lala@poste.it