Opened 4 years ago

Closed 14 months ago

#2608 closed defect (needs_more_info)

Editing Track ID (-streamid output-stream-index:new-value - ffmpeg advanced option is not working)

Reported by: Dave1024 Owned by:
Priority: normal Component: undetermined
Version: git-master Keywords: mov
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

I am looking for a command line option to edit track id of .mov file created by ffmpeg
I am aiming to pack a video & audio (in separate files,formats MPEG-2 & RIFF wav respectively) in to a .mov file.
I am able to produce the .mov file but the track id (In media info number with heading ID is default(when it created) and it is 1 for video, 2 for audio. But i need to change this by 3 and 4 at the time of creation it self. How can i achieve the same?Which command line option help us? Any other solution for the same ?

Few more explanation about my problem
I read from internet, i can edit the stream ID which display as ID:# in media info.
The text written as follows

-streamid output-stream-index:new-value
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.

Command line to reproduce the issue

Based on this i gave the command line as follows

ffmpeg.exe -i F:\ExpMov?\ExpQT\ProRes?.mov -i F:\ExpMov?\ExpQT\audi1.wav -i F:\ExpMov?\ExpQT\audi2.wav -i F:\ExpMov?\ExpQT\audi3.wav -map 0:0 -map 1:0 -map 2:0 -map 3:0 -streamid 1:12 -streamid 2:13 -streamid 3:14 -acodec copy -vcodec copy -timecode 09:59:40:00 F:\ExpMov?\ExpQT\Mov_Created.mov

But still i get the same sequence like video ID 1 Audio ID 2.....
ffprobe.exe -show_stream option does not show this value, it shows index.
OS :- Windows 7 64 bit
ffmpeg version info

ffmpeg version N-53380-g0fb7fef Copyright (c) 2000-2013 the FFmpeg developers

built on May 23 2013 14:19:35 with gcc 4.7.3 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-av
isynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enab
le-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetyp
e --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --ena
ble-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-l
ibopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libsp
eex --enable-libtheora --enable-libtwolame --enable-libvo-aacenc --enable-libvo-
amrwbenc --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --
enable-libxvid --enable-zlib
libavutil 52. 33.100 / 52. 33.100
libavcodec 55. 11.100 / 55. 11.100
libavformat 55. 7.100 / 55. 7.100
libavdevice 55. 1.101 / 55. 1.101
libavfilter 3. 69.101 / 3. 69.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100

Change History (6)

comment:1 Changed 4 years ago by Dave1024

The result file looks like as follows

index 0
track id 1
video [input file 1 F:\ExpMov?\ExpQT\ProRes?.mov]

index 1
track id 3
audio[input file 2 F:\ExpMov?\ExpQT\audi1.wav]

index 2
track id 4
audio[input file 3 F:\ExpMov??\ExpQT\audi2.wav]

index 3
track id 12
audio[input file 4 F:\ExpMov??\ExpQT\audi3.wav]

More precisely the track id which is part of 'tkhd' atom. I am looking for how to edit the same..

comment:2 Changed 4 years ago by cehoyos

  • Keywords mov added; track id streamid removed
  • Priority changed from important to normal
  • Version set to git-master

To make this a valid ticket please provide your failing command line together with the complete, uncut console output.

comment:3 Changed 4 years ago by cehoyos

  • Resolution set to needs_more_info
  • Status changed from new to closed

Please reopen this ticket if you can add the missing information.

comment:4 follow-up: Changed 14 months ago by ecolloton

My issue is slightly different from Dave1024's but basically the same. I have files with stream id's that are incompatible with our encoder. To be clear, it is not the mapping or order of the streams that is the issue, just the "id" assigned to them, which can be found in the "ID" field in MediaInfo?.
Currently Video ID = 2 and Audio ID = 3. To re-encode to our XDCAM deck I need to move Video ID to 1 and Audio ID to 2.

FFmpeg documentation states:
"-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."

If I understand this correctly than I ought to be able to move the video stream from "2" to "1" and audio from "3" to "2" like this:
"ffmpeg -i infile.mxf -streamid 2:1 -streamid 3:2 outfile.mxf"

This is clearly not doing what I intended, given the output that follows the command:

C:\Users\ecolloton\Downloads\ffmpeg-20160819-2a3720b-win64-static\ffmpeg-20160819-2a3720b-win64-static\bin

ffmpeg -i C:\Users\ecolloton\Downloads\cpb-aacip-17-30bvr580.mpeg2.mxf -streamid 2:1 -streamid 3:2 C:\Users\ecolloton\Downloads\cpb-aacip-17-30bvr580.mpeg2_ver3.mxf

ffmpeg version N-81391-g2a3720b Copyright (c) 2000-2016 the FFmpeg developers

built with gcc 5.4.0 (GCC)
configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --enable-bzlib --enable-libebur128 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-decklink --enable-zlib
libavutil 55. 29.100 / 55. 29.100
libavcodec 57. 54.100 / 57. 54.100
libavformat 57. 47.101 / 57. 47.101
libavdevice 57. 0.102 / 57. 0.102
libavfilter 6. 52.100 / 6. 52.100
libswscale 4. 1.100 / 4. 1.100
libswresample 2. 1.100 / 2. 1.100
libpostproc 54. 0.100 / 54. 0.100

Guessed Channel Layout for Input Stream #0.1 : 4.0
Input #0, mxf, from 'C:\Users\ecolloton\Downloads\cpb-aacip-17-30bvr580.mpeg2.mxf':

Metadata:

uid : 2ef58da0-b2b7-11e2-8042-00133b250710
generation_uid : 2ef58da0-b2b7-11e2-8043-00133b250710
company_name : OC
product_name : OCTk
product_version : 2.4
product_uid : 109c5440-d21d-b211-8029-001111ebc476
modification_date: 2013-05-01 19:31:01
material_package_umid: 0x060A2B340101010501010D20130000002EF4F160B2B711E2803900133B250710
timecode : 00:00:00;05

Duration: 00:26:56.98, start: 0.000000, bitrate: 62606 kb/s

Stream #0:0: Video: mpeg2video (4:2:2), yuv422p(tv, smpte170m), 720x512 [SAR 128:135 DAR 4:3], Closed Captions, 50000 kb/s, 29.97 fps, 29.97 tbr, 29.97 tbn, 59.94 tbc
Metadata:

file_package_umid: 0x060A2B340101010501010D20130000002DE7A010B2B711E2802D00133B250710

Stream #0:1: Audio: pcm_s16le, 48000 Hz, 4 channels, s16, 3072 kb/s
Metadata:

file_package_umid: 0x060A2B340101010501010D20130000002DE7A010B2B711E2802D00133B250710

No pixel format specified, yuv422p for MPEG-2 encoding chosen.
Use -pix_fmt yuv420p for compatibility with outdated media players.
[mxf @ 00000000026f4d20] Using AVStream.codec to pass codec parameters to muxers is deprecated, use AVStream.codecpar instead.

Last message repeated 1 times

Output #0, mxf, to 'C:\Users\ecolloton\Downloads\cpb-aacip-17-30bvr580.mpeg2_ver3.mxf':

Metadata:

uid : 2ef58da0-b2b7-11e2-8042-00133b250710
generation_uid : 2ef58da0-b2b7-11e2-8043-00133b250710
company_name : OC
product_name : OCTk
product_version : 2.4
product_uid : 109c5440-d21d-b211-8029-001111ebc476
modification_date: 2013-05-01 19:31:01
material_package_umid: 0x060A2B340101010501010D20130000002EF4F160B2B711E2803900133B250710
timecode : 00:00:00;05
encoder : Lavf57.47.101
Stream #0:0: Video: mpeg2video (4:2:2), yuv422p, 720x512 [SAR 128:135 DAR 4:3], q=2-31, 200 kb/s, 29.97 fps, 29.97 tbn, 29.97 tbc
Metadata:

file_package_umid: 0x060A2B340101010501010D20130000002DE7A010B2B711E2802D00133B250710
encoder : Lavc57.54.100 mpeg2video

Side data:

cpb: bitrate max/min/avg: 0/0/200000 buffer size: 0 vbv_delay: -1

Stream #0:1: Audio: pcm_s16le, 48000 Hz, 4.0, s16, 3072 kb/s
Metadata:

file_package_umid: 0x060A2B340101010501010D20130000002DE7A010B2B711E2802D00133B250710
encoder : Lavc57.54.100 pcm_s16le

Stream mapping:

Stream #0:0 -> #0:0 (mpeg2video (native) -> mpeg2video (native))
Stream #0:1 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native))

Press [q] to stop, ? for help
[mxf @ 00000000026f4d20] -d10_channelcount requires MXF D-10 and will be ignored
frame=48461 fps=187 q=31.0 Lsize= 760934kB time=00:26:56.98 bitrate=3855.1kbits/s speed=6.24x
video:90919kB audio:606368kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 9.127749%

comment:5 Changed 14 months ago by ecolloton

  • Resolution needs_more_info deleted
  • Status changed from closed to reopened

comment:6 in reply to: ↑ 4 Changed 14 months ago by cehoyos

  • Resolution set to needs_more_info
  • Status changed from reopened to closed

Replying to ecolloton:

My issue is slightly different from Dave1024's

Which should be a sufficient reason not to reopen three-year old tickets.

Note: See TracTickets for help on using tickets.