Deadend on converting a video file with multiple video streams
As I found very few clues in the net and on the official documentation pages on ffmpeg.org, I've tried by myself many differents ways to convert a AVI file in wich there are 2 video streams incorporated.
It ended allways by an error. Looks like ffmpeg doesn't like puting 2 video streams together in one file.
Let's call the input file "doublevideo.avi". Inside, there are 3 streams: 0=> video1; 1=> audio1: 2=> video2. And I want to convert them to x264-aac in mp4 format.
The first try was to convert without any special multiple streaming options:
Here, no problem, the video is clean and working. But it has only one video stream, the second one was leaved behind.
So, now I tried the option -map to tell ffmpeg to put the 3 streams inside the ouput video:
It give me that error message: "Number of stream maps must match number of output streams".
Here is the full error message:
3 streams input, 3 streams output and it tells me that the number of stream maps must match!? That's awkward! Looks like, ffmpeg doesn't like to put 2 video streams in one file here.
Never mind, I try another solution: I use -map on a second converting process to have 2 videos in 2 separated files and I'll mux them after the convertions:
so now I have videout1.mp4 which has my firt video stream inside it and I also have videout2.mp4 which has my second video stream inside. Let's put them together with the -newvideo ffmpeg's option:
It seems to work, and it comes with an output file with 2 videos and one audio inside. Great! BUT, the second video stream was converted into an mpeg4 stream (and was in 200k b/s) completely avoiding my "-vcodec copy" option.
So, now I have a video file that contains 2 differents converting video streams: one in x264 and another one in mpeg4 (wich is lesser quality).
So, I've tried to put all the parameters in the second stream:
Ok, now I have a 350kbps video stream, but still in mpeg4.
I've tried many other solution, like puting the final format in m4v, and it gave me that error:
Above the error message, I could read in red:
So, I've tried to put "-vpre slow" "-vpre medium", etc...it allways give me the same damn message.
So, here is the end of my story. Of course, I've tried many other things with the ffmpeg manual, but I'll spare you the other less interesting issues I've found.
Thank you for reading me until here. I know it is long, but I think it is worth to find a solution for this as it is actualy the answer to "how to convert a 3D video file with ffmpeg?" question.
Thank you for your attention
[jake hi] "Great! BUT, the second video stream was converted into an mpeg4 stream (and was in 200k b/s) completely avoiding my "-vcodec copy" option."
When using new video you have to specify the encoding setting just before it (and after the output file).
So instead of:
ffmpeg -y -i videout1.mp4 -i videout2.mp4 -vcodec copy -acodec copy -vcodec copy -acodec copy videout12.mp4 -newvideo
ffmpeg -y -i videout1.mp4 -i videout2.mp4 -vcodec copy -acodec copy videout12.mp4 -vcodec copy -acodec copy -newvideo