VideoHelp Forum




+ Reply to Thread
Results 1 to 9 of 9
  1. Hi,

    How can i do editing the track id in a mov file.
    Which command line option help me to achieve the same?

    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.
    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.
    But some other tools while playing the file took the ID value.

    Friends could any body review my command and let me know any mistake is imposed.
    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
    Thanks
    Dave
    Quote Quote  
  2. Member
    Join Date
    Aug 2007
    Location
    Isle of Man
    Search Comp PM
    Hopefully this answer is of some help.

    In addition, the command line above starts reassigning stream IDs from 1, i.e. stream ID 0 will remain unchanged.

    If ProRes.mov contains any additional tracks other than the video you want, you may need negative mapping to exclude those from the output. An example from http://www.ffmpeg.org/ffmpeg-all.html#Advanced-options:
    Code:
    To map all the streams except the second audio, use negative mappings 
        ffmpeg -i INPUT -map 0 -map -0:a:1 OUTPUT   
    Note that using this option disables the default mappings for this output file
    Cheers,
    Francois
    Last edited by fvisagie; 28th May 2013 at 03:30.
    Quote Quote  
  3. Hi Francoi,

    I agree with your suggestion but my requirement is different.
    The audio and video are in individual files with stream index 0 and stream id/track id 1.

    I am trying to map this separate content to single mov file and the desired orientation as follows

    index 0
    track id 1
    video [input file 1]

    index 1
    track id 3
    audio[input file 2]

    index 2
    track id 4
    audio[input file 3]

    index 3
    track id 12
    audio[input file 4]

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

    Welcome to your thoughts.

    Thanks
    Dave
    Quote Quote  
  4. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    You could easily get the tracks in using QTPro, but first: WHY do you need specific track IDs? Most, if not ALL, apps will create consecutive stream #s (per type) when muxing. And most playing/editing apps use the stream#s for handling ident purposes only anyway - they would rarely require a particular stream to exist in a particular extended stream# (not counting first video & first audio, which many apps take for granted and assume exist).

    Scott
    Last edited by Cornucopia; 28th May 2013 at 17:46.
    Quote Quote  
  5. Hi Scott,

    I need to add tone at start of audio track.So extract the original audio.Add tone at start + data from original and put back to mov file. I don't want any change in the mov anatomy or meta data.

    Thanks
    Dave
    Quote Quote  
  6. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    When you talk about adding tone, is that appending (increasing the duration of the clip) or inserting (maintaining the duration)?

    Have you tried just demuxing, editing the audio and re-muxing, to see how well that worked?

    Which metadata are you needing to be intact that you think will be destroyed/altered?

    Scott
    Quote Quote  
  7. Hi Scott,

    Thanks to your question.

    The tone is inserting at start of the audio.
    Demux the video(in native format) and audio(in pcm format) kept it in separate files. Also hold the timecode information from the tmcd track.After audio editing i intent to remux.In my case no change in video/tmcd track. Modification only comes in to audio.

    Issues

    1) Preserving track id.

    My original file had track id 1 for video, 12 for first audio track, 13 for second audio track.
    But after remuxing i lost this and got track id 1 for video,2 for audio first track,3 for audio second track.
    Due to this my automation scripts failed.What is the solution for the same ?

    could you know.
    ffmpeg gave any api support to preserve track id.?
    Is it possible to replace the audio content only in the original file without alter any metadata?

    Thanks
    Dave
    Quote Quote  
  8. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    What automation scripts? Maybe they can be modified to more versatilely adapt to stream changes...

    Scott

    <edit>maybe you could inert/replace the silent bytes with the tone bytes using a hex editor - that will certainly not mess with all the other data/info (as long as you correctly swap according to packet/chunk/sector boundaries).
    Quote Quote  
  9. Hi Scott,

    Editing in hex editor is fine. But practically it is not possible because number of tracks to consider is large.
    I prefer to run the job using scripts. A kind of automation ;-
    With ffmpeg is it possible to edit 'tkhd' atom ?

    Thanks
    Dave
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!