I am trying to pipe AVS scripts to the 64 bit version of FFmpeg for x264 encoding using avs2yuv. My problem is 2 pass encoding. Without piping, it works fine. Here's an example of the code I'm using.
For single pass encoding using avs2yuv, no problem. Here's an example.Code:ffmpeg -y -i <inAVS> -c:v libx264 -b:v 6000k -pass 1 -preset medium -an -f mp4 NUL &&\ ffmpeg -i <inAVS> -itsoffset 0.045 -i <inTempWav> -map 0:0 -map 1:0 -c:v libx264 -b:v 6000k -pass 2 -preset medium -c:a aac -b:a 256k <outFile>.mp4
However, for two pass encoding, I cannot get it to work. Here's the code I'm using.Code:avs2yuv <inAVS> - | ffmpeg -y -f yuv4mpegpipe -i - -c:v libx264 -crf 23 -preset medium -an <outFile>.mp4
In the log file I get this error message--Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or heightCode:avs2yuv <inAVS> - | ffmpeg -y -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -pass 1 -preset medium -an -f mp4 NUL &&\ avs2yuv <inAVS> - | ffmpeg -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -pass 2 -preset medium -an <outFile>.mp4
I suspect the problem has to do with how the log file is being set up during pass 1. Any help would be appreciated. Thanks.
wwaag
+ Reply to Thread
Results 1 to 11 of 11
-
-
Try x264-params to specify the pass and log
This works for me on windows
Code:avs2yuv INPUT.avs - | ffmpeg -y -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -x264-params pass=1:stats="log.log" -preset medium -an -f mp4 NUL avs2yuv INPUT.avs - | ffmpeg -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -x264-params pass=2:stats="log.log" -preset medium -an OUTPUT.mp4
Last edited by poisondeathray; 9th Mar 2017 at 13:47.
-
Another option is piping 32bit ffmpeg (if you are using 32bit avs) to 64bit ffmpeg . Pipe speed is about 15-25% faster than avs2yuv
I get about 390-400fps on this avs with avs2yuv
Code:avs2yuv input.avs - | ffmpeg -f yuv4mpegpipe -i - -c:v rawvideo -an -f null NULL
Code:ffmpeg32 -i input.avs -f yuv4mpegpipe - | ffmpeg -f yuv4mpegpipe -i - -c:v rawvideo -an -f null NULL
Last edited by poisondeathray; 9th Mar 2017 at 14:02.
-
You can try to set log file explicitly (part of my script):
first passCode:-pass:v:0 1 -passlogfile:v:0 log_%~n1
Code:-pass:v:0 2 -passlogfile:v:0 log_%~n1
-
Thanks guys but no cigar.
Here is code suggested by pdr
Code:avs2yuv <inAVS> - | ffmpeg -y -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -x264-params pass=1:stats="log.log" -preset medium -an -f mp4 NUL &&\ avs2yuv <inAVS> - | ffmpeg -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -x264-params pass=2:stats="log.log" -preset medium -an <outFile>.mp4
Code:avs2yuv <inAVS> - | ffmpeg -y -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -pass:v:0 1 -passlogfile:v:0 log_%~n1 -preset medium -an -f mp4 NUL &&\ avs2yuv <inAVS> - | ffmpeg -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -pass:v:0 2 -passlogfile:v:0 log_%~n1-preset medium -an <outFile>.mp4
Code:2017/03/09 13:50:18 --ffmpeg version N-83657-g7e4f32f Copyright (c) 2000-2017 the FFmpeg developers 2017/03/09 13:50:18 -- built with gcc 6.3.0 (GCC) 2017/03/09 13:50:18 -- configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib 2017/03/09 13:50:18 -- libavutil 55. 47.100 / 55. 47.100 2017/03/09 13:50:18 -- libavcodec 57. 81.100 / 57. 81.100 2017/03/09 13:50:18 -- libavformat 57. 66.102 / 57. 66.102 2017/03/09 13:50:18 -- libavdevice 57. 2.100 / 57. 2.100 2017/03/09 13:50:18 -- libavfilter 6. 74.100 / 6. 74.100 2017/03/09 13:50:18 -- libswscale 4. 3.101 / 4. 3.101 2017/03/09 13:50:18 -- libswresample 2. 4.100 / 2. 4.100 2017/03/09 13:50:18 -- libpostproc 54. 2.100 / 54. 2.100 2017/03/09 13:50:18 --Input #0, yuv4mpegpipe, from 'pipe:': 2017/03/09 13:50:18 -- Duration: N/A, start: 0.000000, bitrate: N/A 2017/03/09 13:50:18 -- Stream #0:0: Video: rawvideo (I420 / 0x30323449), yuv420p(progressive), 1920x1080, 59.94 fps, 59.94 tbr, 59.94 tbn, 59.94 tbc 2017/03/09 13:50:18 --[libx264 @ 00000000001e87c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX 2017/03/09 13:50:18 --[libx264 @ 00000000001e87c0] ratecontrol_init: can't open stats file 2017/03/09 13:50:18 --Stream mapping: 2017/03/09 13:50:18 -- Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264)) 2017/03/09 13:50:18 --Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height 2017/03/09 13:50:18 --C:\Users\Wayne\Documents\HappyOtterScripts for Vegas\FFmpeg Renders\QuickRender.avs: 1920x1080, 60000/1001 fps, 300 frames 2017/03/09 13:50:18 --error: wrote only 3084509 of 3110400 bytes
wwaag -
Code:
avs2yuv <inAVS> - | ffmpeg -y -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -pass:v:0 1 -passlogfile:v:0 log_pipe -preset medium -an -f mp4 NUL &&\ avs2yuv <inAVS> - | ffmpeg -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -pass:v:0 2 -passlogfile:v:0 log_pipe -preset medium -an <outFile>.mp4
-
I think I may have solved it with the following code. I simply changed the "log.log" to a real file name "F:\x264.log". It does the 2 passes although I never see the x264.log file being created. Here is the revised code:
Code:avs2yuv <inAVS> - | ffmpeg -y -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -x264-params pass=1:stats="F:\x264.log" -preset medium -an -f mp4 NUL &&\ avs2yuv <inAVS> - | ffmpeg -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -x264-params pass=2:stats="F:\x264.log" -preset medium -an <outFile>.mp4
wwaag -
@pandy
Code:avs2yuv <inAVS> - | ffmpeg -y -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -pass:v:0 1 -passlogfile:v:0 log_pipe -preset medium -an -f mp4 NUL &&\ avs2yuv <inAVS> - | ffmpeg -f yuv4mpegpipe -i - -c:v libx264 -b:v 6000k -pass:v:0 2 -passlogfile:v:0 log_pipe -preset medium -an <outFile>.mp4
-
I don't know of any, maybe 64bit avs, not sure. 64bit avisynth plus is more complete these days, almost all filters are available. (That's avsynth+)
Actually avfs should be able to; you would use 32bit avs as normal, but mount the avs. The "dummy" avi generated is compatible in all windows programs 64bit or 32bit .
But the more frameservers you have working the worse the performance. Massive overhead when you start chaining up a few. Sometimes it's just better to use a physical intermediate -
Do you have writing rights in the directory you are working in?
Good question. Apparently, that was the problem all along. Changed the host program (Vegas) to run as admin and all three suggested approaches by pdr and pandy worked. That also explains why changing the location to another directory also worked. Thanks so much to all of you.
@pdr. I did a test run with the avfs.dll a few days ago and it does work. You make a good point about any time savings over a direct render. Will do some testing.
wwaag
Similar Threads
-
Difference Between 1 pass & 2 pass encoding
By iqbal88 in forum Video ConversionReplies: 28Last Post: 29th Oct 2021, 05:19 -
What is difference between 1 pass encoding & 2 pass encoding
By Computerman1 in forum Video ConversionReplies: 18Last Post: 13th Jan 2019, 19:59 -
avs2yuv.exe has stopped working
By vivabarca in forum Blu-ray RippingReplies: 2Last Post: 4th Nov 2015, 16:19 -
ffmpeg 2-pass question
By DamienS in forum Video ConversionReplies: 18Last Post: 1st Dec 2013, 21:44 -
avs2yuv and mplayer in slave mode -> dropping content.
By Selur in forum Software PlayingReplies: 0Last Post: 31st Jul 2013, 02:32