VideoHelp Forum


Try NordVPN to access Netflix or other streaming services from any country and also surf safely!
+ Reply to Thread
Results 1 to 21 of 21
Thread
  1. RayPasco pascor's Avatar
    Join Date
    Dec 2016
    Location
    Philadelphis, PA, USA
    Search PM
    Environment: FFmpeg Batch AV Converter v4.3.1, Win 8.1 x64
    Using the 2-pass Wizard.The program complains 'Parameters "-pass 1" and "-f" are required for first pass' though they are both included.

    Image
    [Attachment 58774 - Click to enlarge]

    The parameters work fine in a batch file for both passes.
    There's also something flaky about entering the individual arguments: the entry box splits off the leading dash character if extra spaces aren't inserted before "-pass 1".
    Quote Quote  
  2. I don't know the program you're using. But -f is the ffmpeg option for container format (matroska, mp4, etc.). This ffmpeg command line worked for me with ffmpeg.exe:
    Code:
    ffmpeg -i input.mkv -c:v libx265 -b:v 700k -vsync 1 -max_muxing_queue_size 1024 -an -sn -pass 1 output1.mkv
    ffmpeg -i input.mkv -c:v libx265 -b:v 700k -vsync 1 -max_muxing_queue_size 1024 -c:a copy -c:s copy -pass 2 output2.mkv
    Quote Quote  
  3. RayPasco pascor's Avatar
    Join Date
    Dec 2016
    Location
    Philadelphis, PA, USA
    Search PM
    This is not the issue. My command lines work work correctly unconditionally. BUT, I can not get FF Batch Converter to accept them.


    How can your command line work ? There is no output file for pass 1 !
    Quote Quote  
  4. Originally Posted by pascor View Post
    How can your command line work ? There is no output file for pass 1 !
    You mean the stats file? ffmpeg will default to ffmpeg2pass-0.log.
    Quote Quote  
  5. RayPasco pascor's Avatar
    Join Date
    Dec 2016
    Location
    Philadelphis, PA, USA
    Search PM
    The pass-1 command line MUST end with ..."-pass 1 -y -f AVI NUL". "-y" overwrites any leftover "ffmpeg2pass-0.log" file. The "-f AVI NUL" args specify the one-and-only-one mandatory and acceptable file type that allows pass-1 FFmpeg X265 processing to proceed. Inclusion of this, and only this is absolutely necessary !
    Quote Quote  
  6. Originally Posted by pascor View Post
    The pass-1 command line MUST end with ..."-pass 1 -y -f AVI NUL". "-y" overwrites any leftover "ffmpeg2pass-0.log" file. The "-f AVI NUL" args specify the one-and-only-one mandatory and acceptable file type that allows pass-1 FFmpeg X265 processing to proceed. Inclusion of this, and only this is absolutely necessary !
    To clarify, it doesn't need to be -f AVI

    It can be some other container format file type such as MP4 , MKV etc... it's not important for the 1st pass . NUL is important, and -y is important

    eg. -f MP4 NUL -y
    Quote Quote  
  7. I played with the GUI, it's a buggy GUI

    You need to explicitly enter -x265-params with the log path and name, otherwise it does not work properly - it becomes 1pass VBR .

    (IMO - A GUI should do some of that for you, otherwise you're better off using a bat file)

    You can verify with mediainfo, the 2nd pass should say stats-write=0 / stats-read=2 for 2pass. If it says stats-write=0 / stats-read=0, that's not 2pass (that indicates no stats file is read)

    -pass is required by the GUI, otherwise it complains - it does not look for it in the -x265-params string. I left it in the example

    It should look something like this

    Image
    [Attachment 58777 - Click to enlarge]
    Quote Quote  
  8. RayPasco pascor's Avatar
    Join Date
    Dec 2016
    Location
    Philadelphis, PA, USA
    Search PM
    No joy, same error message as with my command params.
    What version of FFBatch are you using ?

    Image
    [Attachment 58778 - Click to enlarge]
    Quote Quote  
  9. Originally Posted by pascor View Post
    No joy, same error message as with my command params.
    What version of FFBatch are you using ?
    2.3.8 portable win x64
    https://www.videohelp.com/software/FFmpeg-Batch

    I noticed it says v4.3.1 in the 1st post, but I don't see that version - maybe you were referring to ffmpeg version ?
    Quote Quote  
  10. Originally Posted by pascor View Post
    You're missing the "dash" before pass

    you have "pass 1" , not "-pass 1" ; same for "pass 2" , instead of "-pass 2"

    Also, in the 2nd pass change the -x265-params to pass=2
    Quote Quote  
  11. Ah, I see. ffmpeg doesn't automatically pass its "-pass n" argument to x265. So you have to use x265-params to specify it. You don't even have to specify "-pass n" to ffmpeg (though it doesn't hurt). You don't really have to specify a name for the log files, x265 will use it's defaults. You don't have to specify NUL output, you can send the video to a file (you probably want to use NUL in a large batch process, obviously). And -y is only necessary to avoid being prompted when files already exist (again, useful in a batch process).
    Last edited by jagabo; 8th May 2021 at 22:57.
    Quote Quote  
  12. Originally Posted by jagabo View Post
    ffmpeg doesn't automatically pass its "-pass n" argument to x265.
    I think it does, I just left it in there, because that's the way I do it using cmd or batch

    You don't even have to specify "-pass n" to ffmpeg (though it doesn't hurt).
    You do for that GUI, or it complains

    You don't really have to specify a name for the log files, x265 will use it's defaults.
    You do for both cmd and the GUI - otherwise it will be 1 pass abr . It will say stats-write=0 / stats-read=0 in mediainfo, indicated no stats were read
    Quote Quote  
  13. Originally Posted by poisondeathray View Post
    You don't really have to specify a name for the log files, x265 will use it's defaults.
    You do for both cmd and the GUI - otherwise it will be 1 pass abr . It will say stats-write=0 / stats-read=0 in mediainfo, indicated no stats were read
    I used:

    Code:
    ffmpeg -i input.mkv -an       -sn       -c:v libx265 -b:v 700k -vsync 1 -max_muxing_queue_size 1024 -x265-params pass=1 -f Matroska NUL -y
    ffmpeg -i input.mkv -c:a copy -c:s copy -c:v libx265 -b:v 700k -vsync 1 -max_muxing_queue_size 1024 -x265-params pass=2     output2.mkv -y
    x265 created log files x265_2pass.log and x265_2pass.log.cutree during the first pass. The output2.mkv files shows "/ stats-write=0 / stats-read=2 /".
    Quote Quote  
  14. Originally Posted by jagabo View Post
    Originally Posted by poisondeathray View Post
    You don't really have to specify a name for the log files, x265 will use it's defaults.
    You do for both cmd and the GUI - otherwise it will be 1 pass abr . It will say stats-write=0 / stats-read=0 in mediainfo, indicated no stats were read
    I used:

    Code:
    ffmpeg -i input.mkv -an       -sn       -c:v libx265 -b:v 700k -vsync 1 -max_muxing_queue_size 1024 -x265-params pass=1 -f Matroska NUL -y
    ffmpeg -i input.mkv -c:a copy -c:s copy -c:v libx265 -b:v 700k -vsync 1 -max_muxing_queue_size 1024 -x265-params pass=2     output2.mkv -y
    x265 created log files x265_2pass.log and x265_2pass.log.cutree during the first pass. The output2.mkv files shows "/ stats-write=0 / stats-read=2 /".

    So it's not the log path/name, it's -x265-params pass=blah . If you omit -x265-params and use -pass 1 / -pass 2 instead, it says stats-write=0 / stats-read=0
    Quote Quote  
  15. Originally Posted by poisondeathray View Post
    Originally Posted by jagabo View Post
    Originally Posted by poisondeathray View Post
    You don't really have to specify a name for the log files, x265 will use it's defaults.
    You do for both cmd and the GUI - otherwise it will be 1 pass abr . It will say stats-write=0 / stats-read=0 in mediainfo, indicated no stats were read
    I used:

    Code:
    ffmpeg -i input.mkv -an       -sn       -c:v libx265 -b:v 700k -vsync 1 -max_muxing_queue_size 1024 -x265-params pass=1 -f Matroska NUL -y
    ffmpeg -i input.mkv -c:a copy -c:s copy -c:v libx265 -b:v 700k -vsync 1 -max_muxing_queue_size 1024 -x265-params pass=2     output2.mkv -y
    x265 created log files x265_2pass.log and x265_2pass.log.cutree during the first pass. The output2.mkv files shows "/ stats-write=0 / stats-read=2 /".

    So it's not the log path/name, it's -x265-params pass=blah . If you omit -x265-params and use -pass 1 / -pass 2 instead, it says stats-write=0 / stats-read=0
    Yes, which is why I thought ffmpeg wasn't passing its "-pass n" setting to x265. In the example here ffmpeg doesn't even know its performing a 2-pass encoding.

    This may not be of any use to the OP but I wanted to sort it out for myself.
    Quote Quote  
  16. RayPasco pascor's Avatar
    Join Date
    Dec 2016
    Location
    Philadelphis, PA, USA
    Search PM
    The problems were caused by using an outdated version of FFmpeg. Since then such parameters such as "c:a?" are no longer acceptable.


    Thanks to jagabo for going off-topic and segwaying into a private conversation with poisondeathray. My question was left unanswered without giving any useful pointers.
    Quote Quote  
  17. Originally Posted by pascor View Post
    The problems were caused by using an outdated version of FFmpeg. Since then such parameters such as "c:a?" are no longer acceptable.


    Thanks to jagabo for going off-topic and segwaying into a private conversation with poisondeathray. My question was left unanswered without giving any useful pointers.
    -c:a copy works for many years, it works here too

    You've been using incorrect command lines.

    It tells you the errors you're making.

    Also ffmpeg libx265 doesn't use the 1st pass stats unless you use -x265-params with pass=1 or 2 . How is that not a useful pointer ? Your 2pass encodes have been unconditionally incorrect . You're welcome BTW . The GUI makes the pass, but doesn't actually use them either unless you use -x265-params, you can check with -report and mediainfo

    Check the boxes, to see if the GUI has pasted additional information at the end of the line. Scroll down in the box. It only displays 2 lines, but there can be a 3rd hidden line with garbage not shown. It's a buggy GUI
    Quote Quote  
  18. RayPasco pascor's Avatar
    Join Date
    Dec 2016
    Location
    Philadelphis, PA, USA
    Search PM
    I removed args "-x265-params stats" to simplify debugging. It seemed to have no effects at all in either pass.

    My problems were caused by using an outdated version of FFmpeg. Parameter syntaxes such as "c:a" are no longer supported. I am guessing that now "c:a" implies "all audio streams". I haven't yet had the need to check this out.


    When you say "Check the boxes to see if the GUI has pasted additional information at the end of the line", what boxes and lines do you mean ?
    Quote Quote  
  19. Originally Posted by pascor View Post
    I removed args "-x265-params stats" to simplify debugging. It seemed to have no effects at all in either pass.

    My problems were caused by using an outdated version of FFmpeg. Parameter syntaxes such as "c:a" are no longer supported. I am guessing that now "c:a" implies "all audio streams". I haven't yet had the need to check this out.
    -c:a means codec:audio ; it used to be "-acodec" many years ago

    So -c:a copy means copy the audio stream . It's the same thing as -acodec copy , but ffmpeg complains if you use -acodec now, and it will soon be removed


    When you say "Check the boxes to see if the GUI has pasted additional information at the end of the line", what boxes and lines do you mean ?
    I mean put the cursor in the box with the mouse, left click, then use arrow keys to scroll down

    It only displays 2 lines, but when I tested it, the GUI posts garbage at the end of the line on the 3rd line which isn't shown in the screenshot. And there is no way to resize or enlarge the window that I could find. So delete all the garbage entries

    It's not a very good GUI
    Quote Quote  
  20. ...do you think is possible to speedup 1st pass by QSV it ?
    Quote Quote  
  21. No. QSV won't generate the stats required by the second pass of x265.
    Quote Quote  



Similar Threads