VideoHelp Forum




+ Reply to Thread
Results 1 to 10 of 10
  1. Member
    Join Date
    Jan 2014
    Location
    Somewhere
    Search Comp PM
    Hello everyone!

    I have a problem. I would like to use multiple input for ffmpeg and output a single file mp4 or mkv.
    The problem is that the video track is converted with a ffmpeg and x265 (using pipeline) while the other tracks (audio and subs) are taken from the main input source.

    The question is, can I do that in one command line? Can I use x265 stdout and use it as ffmpeg input to merge in matroska container with the others tracks from the input file?

    some like that in pseudocode:

    ffmpeg -audiotracks -subtracks -videotrack - pipe x265 output.mkv

    this is a command line I have tried to create:

    Code:
    ffmpeg -i testfull.mkv -map 0:a:0 -c:a:0 ac3 -map 0:s:0 -c:s:0 copy -map 0:v:0 -f yuv4mpegpipe - | x265 --y4m --crf 30 --preset veryfast --input - --output - "H:\Test\output.mkv"
    the error is: Coult not write header for output file #0 (incorrect codec parameters ?): Error number -5 occurred
    Quote Quote  
  2. x265 cannot mux into mkv container - at least "vanilla" builds cannot (only raw bitstream output) .

    Also you would also need a separate named pipe for each stream, video and audio and I don't think there is a pipe for subs

    So you would probably better off doing a batch file (separate command lines, sequential steps), or using ffmpeg alone (libx265 for video)
    Quote Quote  
  3. Member
    Join Date
    Jan 2014
    Location
    Somewhere
    Search Comp PM
    Thank you for reply..

    I would like to maintain only one command line.. and x265 is needed only to convert the video track from the input file... ffmpeg is responsible for the mux.
    How can I correct this?

    should I do ffmpeg -video - | x265 - | ffmpeg -video (stdout x265) -audio -sub output.mkv

    if that is the case can you help me with an example?
    Quote Quote  
  4. I don't think you can pipe from x265 to something else

    Why do you care if it's 1 or multiple commandlines in a batch ? Functionally it will do what you want

    Why not ffmpeg libx265 ? Seems to be a simpler solution for your situation
    Quote Quote  
  5. Member
    Join Date
    Jan 2014
    Location
    Somewhere
    Search Comp PM
    It's simpler to manage one command line instead of multiple in my case...

    this is another example:

    Code:
    ffmpeg -i test1.mkv -f yuv4mpegpipe - | x265 --y4m --crf 30 --preset veryfast --input - --output - | ffmpeg -i test1.mkv -map 0:v:0 - -map 0:a:0 -c:a:0 ac3 -map 0:s:0 -c:s:0 copy H:\output.mkv
    pause
    it complete without error but no mkv is outputted

    I have seen that libx265 is A LOT slower than the external x265 build
    Quote Quote  
  6. Originally Posted by z-machine95 View Post

    I have seen that libx265 is A LOT slower than the external x265 build
    How did you do the test?

    ffmpeg vs. ffmpeg yuv4mpegpipe to x265 is about the same +/- 2-3% within margin of error when testing x64 8bit versions . If you add in the time muxing and separate audio, ffmpeg is a bit faster because it encodes and muxes at the same time, not as a separate step . The longer the video the larger the difference. Also, if you use multiple pipes, each pipe or frameserving stage adds a bit of overhead, each addition makes it a bit slower
    Quote Quote  
  7. Member
    Join Date
    Jan 2014
    Location
    Somewhere
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by z-machine95 View Post

    I have seen that libx265 is A LOT slower than the external x265 build
    How did you do the test?

    ffmpeg vs. ffmpeg yuv4mpegpipe to x265 is about the same +/- 2-3% within margin of error when testing x64 8bit versions . If you add in the time muxing and separate audio, ffmpeg is a bit faster because it encodes and muxes at the same time, not as a separate step . The longer the video the larger the difference. Also, if you use multiple pipes, each pipe or frameserving stage adds a bit of overhead, each addition makes it a bit slower
    I use zeranoe builds with libx265 and ffmpeg and x265 build form x265.eu and there is a lot of difference for me.. same encoding parameters and same inputs... I do not know...

    now I have this command line but i get an errore from the matroska muxer
    Code:
    ffmpeg -fflags +genpts -i test1.mkv -f yuv4mpegpipe - | x265 --y4m --crf 30 --preset veryfast --input - --output - | ffmpeg -y -i test1.mkv -i - -map 1:v -c:v copy -map 0:a:0 -c:a:0 ac3 -map 0:s:0 -c:s:0 copy H:\output.mkv
    can't write packet with unknow timestamp.. I have tried to use genpts fix but it does not work...

    you can confim that ffmpeg libx265 a not slower than external builds? I have just tried and I get at least 2-3 fps slower conversion..
    Quote Quote  
  8. It might be slightly slower when encoding video only. On a 2min mkv input video test 76 vs. 75 FPS . But I wouldn't call it "a low slower" . Again x64 builds, ffmpeg direct vs. ffmpeg yuv4mpegpipe to x265.

    Again, I don't think you can pipe x265 to something else. You couldn't do it with x264 either . You could take the output elementary bitstream and then mux it at a separate stage
    Quote Quote  
  9. Member
    Join Date
    Jan 2014
    Location
    Somewhere
    Search Comp PM
    I'm doing my test again.. I will post my results here
    Quote Quote  
  10. Member
    Join Date
    Jan 2014
    Location
    Somewhere
    Search Comp PM
    Actually you are right... The problem was that with libx265 I have tried to use --pmode... But it completely destroys performance... Instead of 6.2 fps I was getting 4.3fps... Now seems that libx265 is actually faster... I'm measuring about 10 sec improvements (on a test video of 1000 frames)... Just deactivating pmode...

    Now is much easier to manage the problem... Thank you!
    Quote Quote  



Similar Threads

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