VideoHelp Forum
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. Anonymous543
    Guest
    Hlo everyone,
    Am getting error while doing 2 pass encoding with libx265(hevc) in ffmpeg cli

    Image
    [Attachment 62584 - Click to enlarge]


    Anyone have idea? Why am getting this?

    And how I can solve this error?
    Quote Quote  
  2. Anonymous543
    Guest
    codes which i used to encode was..

    ffmpeg -y -i input.mp4 -c:v libx265 -b:v 160k -x265-params pass=1 -an -f null NUL && ^


    ffmpeg -i input.mp4 -c:v libx265 -b:v 160k -x265-params pass=2 -an video.mp4




    https://trac.ffmpeg.org/wiki/Encode/H.265
    Quote Quote  
  3. Code:
    ffmpeg -i input.mp4 -c:v libx265 -b:v 160k -x265-params pass=1 -an -f mp4 NUL && ^
    ffmpeg -i input.mp4 -c:v libx265 -b:v 160k -x265-params pass=2 -an -f mp4 video.mp4
    Quote Quote  
  4. Anonymous543
    Guest
    -f what it specifies?
    Quote Quote  
  5. Anonymous543
    Guest
    -f specifies format for input or output file?
    Last edited by Anonymous543; 28th Dec 2021 at 08:49.
    Quote Quote  
  6. Anonymous543
    Guest
    Does different formats like .mp4 .mkv makes different CU-tree stats file?
    Last edited by Anonymous543; 28th Dec 2021 at 08:49.
    Quote Quote  
  7. Originally Posted by kirito View Post
    -f specifies format for input or output file?
    -f before -i refers to input
    -f after -i refers to output

    Originally Posted by kirito View Post
    Does different formats like .mp4 .mkv makes different CU-tree stats file?
    Container choice does not affect it
    Quote Quote  
  8. Anonymous543
    Guest
    In pass 1 i put -f null
    And in pass 2 I wanted output.mp4
    So it gave me incomplete cu stats file error


    But when i put -f mp4 in pass 1
    Then I got output.mp4 in pass 2 without errors


    So my question is in pass 1 should I put -f null
    Or -f (output container of pass 2)mp4



    And what if I put -f mkv in pass 1
    And in pass 2 I put output.mp4?
    Quote Quote  
  9. Originally Posted by kirito View Post
    In pass 1 i put -f null
    And in pass 2 I wanted output.mp4
    So it gave me incomplete cu stats file error


    But when i put -f mp4 in pass 1
    Then I got output.mp4 in pass 2 without errors


    So my question is in pass 1 should I put -f null
    Or -f (output container of pass 2)mp4



    And what if I put -f mkv in pass 1
    And in pass 2 I put output.mp4?

    Isn't it obvious ? use the one that works, not the one that fails...
    Quote Quote  
  10. Anonymous543
    Guest
    Ok but i still wanna know
    That why
    -f null fails
    And
    -f mp4 works
    Quote Quote  
  11. Anonymous543
    Guest
    Any one knows?
    Quote Quote  
  12. Anonymous543
    Guest
    my source raw input video name is
    cats.3gp

    when i run h265 2 pass with codes
    Code:
    ffmpeg -y -i cats.3gp -c:v libx265 -b:v 160k -x265-params pass=1 -f null NUL && ^
    ffmpeg -i cats.3gp -c:v libx265 -b:v 160k -x265-params pass=2 outputcats.3gp
    it worked perfectly without any errors





    then i changed my raw input container 3gp to mp4 with this code
    Code:
    ffmpeg -i cats.3gp -c:v copy cats.mp4
    and run that h265 2 pass codes which is

    Code:
    ffmpeg -y -i cats.mp4 -c:v libx265 -b:v 160k -x265-params pass=1 -f null NUL && ^
    ffmpeg -i cats.mp4 -c:v libx265 -b:v 160k -x265-params pass=2 outputcats.mp4

    and this time i got that incomplete cu tree stats file error
    and encoding failed.



    changing container may be the reason of this error
    because it worked when the container was 3gp




    input has only video stream ,thats why i didnot specified audio codec.
    Quote Quote  
  13. Member
    Join Date
    Jul 2009
    Location
    United States
    Search Comp PM
    Most likely a bug. There are two bug reports on this specific error. https://trac.ffmpeg.org/ticket/6450 reported 5 years ago and closed by the reporter when they discover the work-around and https://trac.ffmpeg.org/ticket/8899 opened 16 months ago. Perhaps if you commented on the second bug report you may get a response.
    Quote Quote  
  14. Anonymous543
    Guest
    I don't know how to comment on that site ,may be i have to register which I don't wanna do because i already have so much accounts on different different websites
    Quote Quote  
  15. Member
    Join Date
    Jul 2009
    Location
    United States
    Search Comp PM
    Originally Posted by kirito View Post
    I don't know how to comment on that site ,may be i have to register which I don't wanna do because i already have so much accounts on different different websites
    If you don't want to create an account then you'll need to go with IRC, http://ffmpeg.org/contact.html#IRCChannels.

    I don't think that any of the FFmpeg devs hang out on videohelp and they are likely the only ones who can tell you why it behaves that way.
    Quote Quote  
  16. What OS ?

    -f null for 1st pass works for me with mp4 input and output on windows
    Quote Quote  
  17. Anonymous543
    Guest
    Windows 7
    Quote Quote  
  18. Anonymous543
    Guest
    I'll give you my input video stream in private msg, on that it doesn't works
    Quote Quote  
  19. For completeness - the issue was buggy timestamps for that specific MP4 the OP was using - the stats file does not match

    MKV to MP4 uses a different container timebase and can introduce the issue (especially when the MKV timestamps to begin with are buggy to begin with)

    An input CFR MP4 with good timestamps works ok with that commandline


    In case anyone else has similar issue:

    Easiest workaround is to use -f mp4 in the 1st pass

    Or "fix" the timestamp interpretation using -vf fps=24000/1001 for both passes
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!