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:
the error is: Coult not write header for output file #0 (incorrect codec parameters ?): Error number -5 occurredCode: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"
+ Reply to Thread
Results 1 to 10 of 10
-
-
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) -
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? -
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 -
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
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
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.. -
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 -
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!
Similar Threads
-
Is there a guide to merging multiple DVD titles into a single output file?
By Lolipop Jones in forum DVD RippingReplies: 10Last Post: 11th Nov 2016, 19:19 -
How do I use FFMPEG to output an MPEG-TS file with multiple programs?
By Videogamer555 in forum Video ConversionReplies: 13Last Post: 31st Aug 2014, 05:45 -
FFMPEG - How to record multiple RTMP streams into multiple files
By wwwmaster2k in forum Capturing and VCRReplies: 1Last Post: 11th Jul 2014, 12:51 -
New HDTV- single component input
By XxHaimBondxX in forum DVB / IPTVReplies: 12Last Post: 30th Oct 2012, 08:13 -
Encode with FFMPEG with multiple input files...
By RogerTango in forum Video ConversionReplies: 3Last Post: 20th Jun 2011, 01:12