Hello all,
i have a Problem with ffmpeg. Its running smooth and fine, but i want ffmpeg to DONT map the streams.
Its better if i explain this with an example.
I have two videos. One, which can be altered and an other that is fixed and can't be processed. Afterall i use the mp4box to append one video to the other. Therefore both videos need to be exactly the same. And here we go.
Video1:
Its a standard video (isma) nothing special about it.Code:Stream #0.0(eng): Audio: mpeg4aac, 44100 Hz, stereo Stream #0.1(eng): Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 25.00 fps(r) Stream #0.2(eng): Data: mp4s / 0x7334706D Stream #0.3(eng): Data: mp4s / 0x7334706D
Now i want to convert video2.
I simplified this command, cause i just want to show you the following:Code:ffmpeg -y -i video2.mp4 -v 1 -threads 1 -vcodec mpeg4 -b 500 -r 25 -s 320x240 -acodec libfaac -ab 96 -ar 44100 -ac 2 -f mp4 -pass 1 video_new.mp4
If you are now going to concenate the videos, they wont fit, cause ffmpeg is changing the stream of the second video ... first stream 0.1 is now video (was audio) and second is audio (was video) ...Code:Duration: 00:08:15.4, start: 0.000000, bitrate: 522 kb/s Stream #0.0(eng): Audio: mpeg4aac, 44100 Hz, stereo Stream #0.1(eng): Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], 25.00 fps(r) Stream #0.2(eng): Data: mp4s / 0x7334706D Stream #0.3(eng): Data: mp4s / 0x7334706D Output #0, mp4, to 'video_new.mp4': Stream #0.0(eng): Video: mpeg4, yuv420p, 320x240 [PAR 1:1 DAR 4:3], q=2-31, pass 1, 0 kb/s, 25.00 fps(c) Stream #0.1(eng): Audio: libfaac, 44100 Hz, stereo, 0 kb/s Stream mapping: Stream #0.1 -> #0.0 Stream #0.0 -> #0.1
I have looked into the documentary and found the "map" parameter, but this isn't going to work cause i dont want to remap them, i just want him to do NOT remap it right from the beginning.
I hope you get the thought behind this...
So the final question is: How to prevent ffmpeg to "map the channels" automatically?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays!
+ Reply to Thread
Results 1 to 6 of 6
Thread
-
Oh! This wasn't supposed to happen...
-
If you're familiar with mp4box, use it on your *source* mp4 files in order to rearrange the stream mapping to the "standard" order (video stream first, then audio stream).
Jean-Philippe Schuck
Un générique, un autre jour, le blog sur les génériques de dessins animés -
Hello jpschuck,
thanx for your answer.
i am familiar with ffmpeg i just have used the mp4box for a few minor things. According to the documentation of mp4box:
To select a desired media track, the following syntax is used:
* -add inputFile#video: adds the first video track in inputFile. DOES NOT WORK for IsoMedia nor MPEG-2 TS files.
* -add inputFile#audio: adds the first audio track in inputFile. DOES NOT WORK for IsoMedia nor MPEG-2 TS files.
* -add inputFile#trackID=ID or -add inputFile#ID: adds the specified track. For IsoMedia files, ID is the track ID. For other media files, ID is the value indicated by MP4Box -info inputFile.
Or do you have an other idea?Oh! This wasn't supposed to happen... -
Originally Posted by Pixelartist
Assuming your first video is named movie1.mp4, use the following command :Code:mp4box -add movie1.mp4#video -add movie1.mp4#audio new_movie.mp4
this is quite not what i wanted...
MP4box is probably even able to extract, remap and append tracks in an one step process but I don't know the commands to do that.Jean-Philippe Schuck
Un générique, un autre jour, le blog sur les génériques de dessins animés -
Well… I just realized this topic was moved from the Mac forum, as it was a Linux oriented question. That's why I was talking about ffmpegX instead of ffmpeg. Actually I was pretty amazed that a Mac user would be using ffmpeg and mp4box through CLI. Yet my answer still applies, unless there are major differences between the Mac and Linux ports of MP4box.
Jean-Philippe Schuck
Un générique, un autre jour, le blog sur les génériques de dessins animés -
Sorry that i posted in the wrong forum!
This is definitly a way to do this! This is a nice workaround and i thank you for this one.
But perhaps there is a way to convince ffmpeg to do not change the mapping in the first place, so i dont have to take that way :P
I will work further on this one (in spite of working solution jpschuck has shown) ...Oh! This wasn't supposed to happen...
Similar Threads
-
solved = struggling to get ffmpeg-php to compile
By richiedood in forum Video ConversionReplies: 30Last Post: 12th Jul 2011, 20:39 -
DVP-NS55P lockups -- SOLVED -- old ffmpeg produces corrupt AC3
By timmus in forum DVD & Blu-ray PlayersReplies: 3Last Post: 14th Nov 2008, 15:09 -
FFMPEG Stream mapping options result in conversion failure
By JackJack in forum Video ConversionReplies: 6Last Post: 27th Jun 2008, 23:19 -
[SOLVED] 'fast action' with ffmpeg or Cinelerra?
By jdetwile in forum LinuxReplies: 2Last Post: 25th Mar 2008, 05:20 -
[solved] ffmpeg and iPod Nano V1.0.2
By Pixelartist in forum LinuxReplies: 6Last Post: 26th Nov 2007, 08:56