hello everyone!
I have a problem to do a 2pass encoding with ffmpeg (latest zeranoe build).
those are my command lines:
1st pass
2nd passCode:"H:\Project\Suite HEVC\bin\Release\data\bin64\ffmpeg.exe" -hwaccel auto -i "H:\video\Interstellar IMAX.mkv" -map 0:v:0 -c:v libx265 -pass 1 -b:v 5000k -preset 5 -x265-params level=0:profile=undefined:pmode:no-pme:pme:no-high-tier:ref=3:bframes=4:open-gop:keyint=250:min-keyint=25:b-adapt=2:bframe-bias=0:rc-lookahead=20:no-scenecut:b-pyramid:me=hex:subme=2:merange=57:temporal-mvp:weightp:no-weightb:max-merge=2:no-weightb:no-rect:no-amp:vbv-bufsize=0:vbv-maxrate=0:vbv-init=0.9:no-slow-firstpass:no-strict-cbr:qcomp=0.6:qstep=4:aq-mode=1:aq-strength=1.0:cutree:no-early-skip:ctu=64:no-fast-cfb:ipratio=1.4:pbratio=1.3:cbqpoffs=0:crqpoffs=0:rd=3:psy-rd=0.3:psy-rdoq=1:b-intra:no-fast-intra:rdoq-level=1:no-tskip:no-tskip-fast:cu-lossless:tu-intra-depth=1:tu-inter-depth=1:strong-intra-smoothing:no-constrained-intra:nr-intra=0:nr-inter=0:qblur=0.5:cplxblur=20:signhide:sar=16:stats="H:\video\Interstellar IMAX.stats" -f null -
i have 2 question:Code:"H:\Project\Suite HEVC\bin\Release\data\bin64\ffmpeg.exe" -hwaccel auto -i "H:\video\Interstellar IMAX.mkv" -map 0:v:0 -c:v libx265 -pass 2 -b:v 5000k -preset 5 -x265-params level=0:profile=undefined:pmode:no-pme:pme:no-high-tier:ref=3:bframes=4:open-gop:keyint=250:min-keyint=25:b-adapt=2:bframe-bias=0:rc-lookahead=20:no-scenecut:b-pyramid:me=hex:subme=2:merange=57:temporal-mvp:weightp:no-weightb:max-merge=2:no-weightb:no-rect:no-amp:vbv-bufsize=0:vbv-maxrate=0:vbv-init=0.9:no-slow-firstpass:no-strict-cbr:qcomp=0.6:qstep=4:aq-mode=1:aq-strength=1.0:cutree:no-early-skip:ctu=64:no-fast-cfb:ipratio=1.4:pbratio=1.3:cbqpoffs=0:crqpoffs=0:rd=3:psy-rd=0.3:psy-rdoq=1:b-intra:no-fast-intra:rdoq-level=1:no-tskip:no-tskip-fast:cu-lossless:tu-intra-depth=1:tu-inter-depth=1:strong-intra-smoothing:no-constrained-intra:nr-intra=0:nr-inter=0:qblur=0.5:cplxblur=20:signhide:sar=16:stats="H:\video\Interstellar IMAX.stats" -map 0:a:0 -c:a copy -map 0:a:1 -c:a copy -map 0:a:2 -c:a copy -map 0:s:0 -c:s copy -map 0:s:1 -c:s copy "H:\video\outputtest.mkv"
1. Will declaring a preset cause problem if overrided with params?
2. With those command line there is no output of the .stats file in the first pass. the encode works fine but it's live a ABR mode. how can i correctly declare output path for stats?
can someone please help me to get first and second pass working correcly?
thanks to everyone who will reply!
P.S.
I'm very happy if someone has even suggestions/improvements for this code![]()
+ Reply to Thread
Results 1 to 19 of 19
-
Last edited by z-machine95; 30th Apr 2015 at 05:02.
-
Will declaring a preset cause problem if overrided with params?
About the stats file are you sure ffmpeg even supports the stats option the way you use it?
shouldn't you use:
Code:-passlogfile "path to log file"
users currently on my ignore list: deadrats, Stears555, marcorocchini -
-
Like I wrote, I suspect that ffmpeg doesn't support 2pass encoding using libx265.
-> I would recommend to post into their bug tracker https://trac.ffmpeg.org/ (or ask inside their IRC channel over at FreeNode IRC #ffmpeg)users currently on my ignore list: deadrats, Stears555, marcorocchini -
Perhaps putting the 'pass' parameters into the -x265-params section?
I might be wrong here but.. why do you use 'no-slow-firstpass' in the second pass too?
ffmpeg -h encoder=libx265
-crf <float> E..V.... set the x265 crf (from -1 to FLT_MAX) (default -1)
-preset <string> E..V.... set the x265 preset
-tune <string> E..V.... set the x265 tune parameter
-x265-params <string> E..V.... set the x265 configuration using aeparated list of key=value parameters
-
I've just run a test encode using 2pass and x265 - no problemo!
First pass:
Code:-hide_banner -i "Dummy.mp4" -map 0:0 -c:v libx265 -b:v 1000k -pass 1 -passlogfile "C:\Temp\ffqueue_ffmpeg_multipass" -an -y "Dummy_x265.mp4"
Code:-hide_banner -i "Dummy.mp4" -map 0:0 -map 0:1 -c:v libx265 -b:v 1000k -c:a copy -pass 2 -passlogfile "C:\Temp\ffqueue_ffmpeg_multipass" -y "Dummy_x265.mp4"
Code:"H:\Project\Suite HEVC\bin\Release\data\bin64\ffmpeg.exe" -hwaccel auto -i "H:\video\Interstellar IMAX.mkv" -map 0:v:0 -c:v libx265 -pass 1 -b:v 5000k -preset 5 -x265-params level=0:profile=undefined:pmode:no-pme:pme:no-high-tier:ref=3:bframes=4:open-gop:keyint=250:min-keyint=25:b-adapt=2:bframe-bias=0:rc-lookahead=20:no-scenecut:b-pyramid:me=hex:subme=2:merange=57:temporal-mvp:weightp:no-weightb:max-merge=2:no-weightb:no-rect:no-amp:vbv-bufsize=0:vbv-maxrate=0:vbv-init=0.9:no-slow-firstpass:no-strict-cbr:qcomp=0.6:qstep=4:aq-mode=1:aq-strength=1.0:cutree:no-early-skip:ctu=64:no-fast-cfb:ipratio=1.4:pbratio=1.3:cbqpoffs=0:crqpoffs=0:rd=3:psy-rd=0.3:psy-rdoq=1:b-intra:no-fast-intra:rdoq-level=1:no-tskip:no-tskip-fast:cu-lossless:tu-intra-depth=1:tu-inter-depth=1:strong-intra-smoothing:no-constrained-intra:nr-intra=0:nr-inter=0:qblur=0.5:cplxblur=20:signhide:sar=16:stats="H:\video\Interstellar IMAX.stats" -f null NUL
Last edited by TorBru; 2nd May 2015 at 10:32.
I'm the developer behind FFQueue. My posts might reflect this! ;-) -
with -f null NUL it's created a .log file in specified path but it's empty again.... stats-0.log (0 byte) i have even remove ffmpeg.exe block (windows block every executable files downloaded from internet)
if i declare an output same thing... I cannot run FFmpeg as administrator cause crashes at start .... if i declare C:\ as log output path ffmpeg give me a write error.. permission denied..
but i work only in H: drive so I shouldn't have permission problems...
maybe I will try to do a much simple commands... just to see if there is another problem
what version do you use? i use static 64 bit latest zeranoe build... maybe that's the problemLast edited by z-machine95; 2nd May 2015 at 12:00.
-
I've tested again. The log file created during first pass is empty. It seems like there's absolutely no difference in running 2pass or 1pass encoding. Have you checked the "stats" file (H:\video\Interstellar IMAX.stats) after first pass? Does it exist? I'm not sure but it seems like x265 uses the stats file and not the "passlogfile" to calculate the qp..
I'm the developer behind FFQueue. My posts might reflect this! ;-) -
Yes there is a difference - you need to specify the stats with x265-params . "pass 2" will not overwrite it
e.g
Code:ffmpeg -i input.ext -an -c:v libx265 -b:v 1000k -pass 1 -x265-params pass=1:stats="mylog.log" -f mp4 NUL -y ffmpeg -i input.ext -an -c:v libx265 -b:v 1000k -pass 2 -x265-params pass=2:stats="mylog.log" "output.mp4"
You can verify because mediainfo will report the differences , and the file will be different (filesize is different between 1pass ABR) -
first thanks guys for helping me!
second I will try this.. my first attempt was something like that but without -f null NUL and -pass 1
fingercrossed...
EDIT:
does not work even with this command line... zeranoe build works for you?
logfile must be declared as .log with a unix style path or work good as i wrote?Last edited by z-machine95; 2nd May 2015 at 14:49.
-
i followed poisondeathray tips but still not produce a log file..
maybe i have to declare path with .log extension? someone told me that log pass file path declaration must be formatted in unix style.. it's true?
here are my command lines updated
Code:1st pass "H:\Project\Suite HEVC\bin\Release\data\bin64\ffmpeg.exe" -hwaccel auto -i "H:\videotest\test.mkv" -map 0:v:0 -c:v libx265 -pass 1 -b:v 5000k -preset 5 -x265-params level=0:profile=undefined:pmode:no-pme:pme:no-high-tier:ref=3:bframes=4:open-gop:keyint=250:min-keyint=25:b-adapt=2:bframe-bias=0:rc-lookahead=20:no-scenecut:b-pyramid:me=hex:subme=2:merange=57:temporal-mvp:weightp:no-weightb:max-merge=2:no-weightb:no-rect:no-amp:vbv-bufsize=0:vbv-maxrate=0:vbv-init=0.9:no-slow-firstpass:no-strict-cbr:qcomp=0.6:qstep=4:aq-mode=1:aq-strength=1.0:cutree:no-early-skip:ctu=64:no-fast-cfb:ipratio=1.4:pbratio=1.3:cbqpoffs=0:crqpoffs=0:rd=3:psy-rd=0.3:psy-rdoq=1:b-intra:no-fast-intra:rdoq-level=1:no-tskip:no-tskip-fast:cu-lossless:tu-intra-depth=1:tu-inter-depth=1:strong-intra-smoothing:no-constrained-intra:nr-intra=0:nr-inter=0:qblur=0.5:cplxblur=20:signhide:sar=16:pass=1:stats="H:\videotest\outputtest.stats" -f null NUL 2nd pass "H:\Project\Suite HEVC\bin\Release\data\bin64\ffmpeg.exe" -hwaccel auto -i "H:\videotest\test.mkv" -map 0:v:0 -c:v libx265 -pass 2 -b:v 5000k -preset 5 -x265-params level=0:profile=undefined:pmode:no-pme:pme:no-high-tier:ref=3:bframes=4:open-gop:keyint=250:min-keyint=25:b-adapt=2:bframe-bias=0:rc-lookahead=20:no-scenecut:b-pyramid:me=hex:subme=2:merange=57:temporal-mvp:weightp:no-weightb:max-merge=2:no-weightb:no-rect:no-amp:vbv-bufsize=0:vbv-maxrate=0:vbv-init=0.9:no-strict-cbr:qcomp=0.6:qstep=4:aq-mode=1:aq-strength=1.0:cutree:no-early-skip:ctu=64:no-fast-cfb:ipratio=1.4:pbratio=1.3:cbqpoffs=0:crqpoffs=0:rd=3:psy-rd=0.3:psy-rdoq=1:b-intra:no-fast-intra:rdoq-level=1:no-tskip:no-tskip-fast:cu-lossless:tu-intra-depth=1:tu-inter-depth=1:strong-intra-smoothing:no-constrained-intra:nr-intra=0:nr-inter=0:qblur=0.5:cplxblur=20:signhide:sar=16:pass=2:stats="H:\videotest\outputtest.stats" -map 0:a:0 -c:a copy -map 0:a:1 -c:a copy -map 0:s:0 -c:s copy -map 0:s:1 -c:s copy "H:\videotest\outputtest.mkv"
thanks in advance! -
Have you checked if the stats file is created? If not you might need to escape the path:
https://www.ffmpeg.org/ffmpeg-utils.html#Quoting-and-escaping
Code:stats="H:\\videotest\\outputtest.stats"
I'm the developer behind FFQueue. My posts might reflect this! ;-) -
Although I have no desire to ever use 2-pass encoding in HEVC (or any format for that matter) I had no trouble encoding 2-pass hevc using the latest ffmpeg and PDR's script.
Here's the test script I used:
Code:SET PATH="D:\Backup\Video Apps\Video Encoders\FFmpeg\FFMpeg\64-bit" ffmpeg -i "Plane_1080p.mp4" -an -c:v libx265 -aspect 16:9 -pix_fmt yuv420p -b:v 1000k -x265-params pass=1:stats="mylog.log" -f NULL nul -y ffmpeg -i "Plane_1080p.mp4" -c:v libx265 -aspect 16:9 -pix_fmt yuv420p -b:v 1000k -x265-params pass=2:stats="mylog.log" -c:a aac -strict experimental -ar 48000 -ab 256k -f mp4 "Output.mp4" pause
Got my retirement plans all set. Looks like I only have to work another 5 years after I die........ -
Yes, it has to do with escaping and syntax. When specifying a path for the : separated values in ffmpeg filers (such as for x265-params , x264-params, etc... or other filters that take on a similar syntax with the colon separated notation) you need to use quotes , with apostrophe
So this
stats="H:\videotest\outputtest.stats"
should be
stats="'H:\videotest\outputtest.stats'" -
Thanks guys! It works like a charm!
Thanks!!!!
i have just added escape character for the entire string and get it working:
stats="'H:\videotest\outputtest.stats'"
now i get FILENAME.EXTENSION.cutree.tmp and FILENAME.EXTENSION.temp and they're not empty!
thanks to @poisondeathray @racer-x @TorBru @selur @babiulepLast edited by z-machine95; 3rd May 2015 at 02:28.
Similar Threads
-
What is libx265 encoder codecs? Did you try it? Which software can use it?
By Stears555 in forum Video ConversionReplies: 44Last Post: 20th Oct 2014, 17:45 -
encoding levels pc-->TV with ffmpeg
By marcorocchini in forum Newbie / General discussionsReplies: 1Last Post: 17th Jun 2014, 19:31 -
How to 2Pass encoding with ffmpeg?
By dubya11 in forum Video ConversionReplies: 2Last Post: 9th Apr 2014, 14:13 -
Should i put average bitrate or max bitrate in 2pass encoding mode?
By tendra in forum Video ConversionReplies: 28Last Post: 11th Nov 2011, 07:38 -
ffmpeg output 2gb limit? Is there one? ffmpeg stops encoding h264 @ 2gb
By BrainiakZ in forum Video ConversionReplies: 14Last Post: 30th Mar 2011, 12:04