Log in

View Full Version : ffmpeg command line help


Dave1024
27th May 2013, 12:47
Hi All,

I need to remux one video file of MPEG-2 and one audio file of PCM in to MOV using ffmpeg.I need to set the track ID for video as 12 and audio as 13. Video file comes first index audio comes as second.

Which is the command line option satisfy my needs.

By default video takes as ID :1 and Audio takes as ID :2 [media info output]. I desired to change this to 12 and 13 respectively.

Thanks
Dave

fvisagie
28th May 2013, 08:54
-streamid from Advanced Options (http://www.ffmpeg.org/ffmpeg-all.html#Advanced-options) seems like the one:

‘-streamid output-stream-index:new-value (output)’

Assign a new stream-id value to an output stream. This option should be specified prior to the output filename to which it applies. For the situation where multiple output files exist, a streamid may be reassigned to a different value.

For example, to set the stream 0 PID to 33 and the stream 1 PID to 36 for an output mpegts file:


ffmpeg -i infile -streamid 0:33 -streamid 1:36 out.ts


So in this case you might try

ffmpeg -i MPEG-2.m2v -i PCM.wav -streamid 0:12 -streamid 1:13 remuxed.mov



By default video takes as ID :1 and Audio takes as ID :2 [media info output]. I desired to change this to 12 and 13 respectively.


As I have it MediaInfo uses 0-based stream numbers - first stream is called '0'? Either way, you may need to adjust the stream IDs above up or down by 1 to get what you're looking for.

Cheers,
Francois

Dave1024
28th May 2013, 09:39
Hi,

I don't get any change after remuxing using the above advanced option of -streamid.
My command line is as follows :-

ffmpeg.exe -i F:\ExpMov\QT_Explore\ProRes.mov -i F:\ExpMov\QT_Explore\audi1.wav -streamid 0:12 -streamid 1:13 -vcodec prores -acodec pcm_s24le F:\ExpMov\QT_Explore\Pass2.mov

Still mediainfo and other tools shows track id for video as 1 and audio as 2.
Is there any mistake in my command/-streamid is only for TS(transport stream)?

Any other mechanisam available ?

For video result as follows

<ID_String>1</ID_String>

For audio result as follows

<ID_String>2</ID_String>


Thanks
Dave

fvisagie
28th May 2013, 13:05
Still mediainfo and other tools shows track id for video as 1 and audio as 2.

I've found the same now, doing some testing on .mp4 files. With DV AVI files I find video as 0 and audio as 1. I can't explain this difference.

Is there any mistake in my command/-streamid is only for TS(transport stream)?


I'm starting to wonder/fear whether the -streamid applies to MPEG-2 transport streams only - its documentation refers to PID, and that in turn seems to relate to MPEG-2 transport streams: http://en.wikipedia.org/wiki/MPEG_transport_stream#PID.

I'm afraid I have no further suggestions to offer at this point. Good luck!

Dave1024
29th May 2013, 06:26
Hi Francois,

I don't think even in TS file -streamid command is working fine. My experiments don't show any changes in a result TS file.
I strongly suspect that this is a bug in ffmpeg.

Thanks
Dave