ffmpeg stripping out third stream not working

I have files with a third stream which could be some metadata from FCP. This is the output of ffprobe:

ffprobe 00700.mov  
ffprobe version 2.0.1 Copyright (c) 2007-2013 the FFmpeg developers  
  built on Aug 27 2013 20:17:24 with gcc 4.5 (SUSE Linux)  
  configuration: --enable-gpl --enable-shared --enable-libmp3lame --enable-libxvid  --enable-libx264 --enable-nonfree --enable-postproc --enable-version3  
  libavutil      52. 38.100 / 52. 38.100  
  libavcodec     55. 18.102 / 55. 18.102  
  libavformat    55. 12.100 / 55. 12.100  
  libavdevice    55.  3.100 / 55.  3.100  
  libavfilter     3. 79.101 /  3. 79.101  
  libswscale      2.  3.100 /  2.  3.100  
  libswresample   0. 17.102 /  0. 17.102  
  libpostproc    52.  3.100 / 52.  3.100  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x806f860] multiple edit list entries, a/v desync might occur, patch welcome  
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '00700.mov':  
  Metadata:  
    major_brand     : qt    
    minor_version   : 537199360  
    compatible_brands: qt    
    creation_time   : 2013-06-11 15:57:03  
  Duration: 00:02:41.56, start: 0.000000, bitrate: 48439 kb/s  
    Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5c / 0x63356478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 45873 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc  
    Metadata:  
      creation_time   : 2013-06-11 15:57:03  
      handler_name    : Apple Alias Data Handler  
      timecode        : 01:00:00:00  
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, 2 channels, s32, 2304 kb/s  
    Metadata:  
      creation_time   : 2013-06-11 15:57:03  
      handler_name    : Apple Alias Data Handler  
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)  
    Metadata:  
      creation_time   : 2013-06-11 15:58:45  
      handler_name    : Apple Alias Data Handler  
      timecode        : 01:00:00:00  
Unsupported codec with id 0 for input stream 2  

Now I want to strip the third stream (stream 2)

So I use:

ffmpeg -i 00700.mov -vcodec copy -acodec copy -map 0:0 -map 0:1 testout.mov  
ffmpeg version 2.0.1 Copyright (c) 2000-2013 the FFmpeg developers  
  built on Aug 27 2013 20:17:24 with gcc 4.5 (SUSE Linux)  
  configuration: --enable-gpl --enable-shared --enable-libmp3lame --enable-libxvid   --enable-libx264 --enable-nonfree --enable-postproc --enable-version3  
  libavutil      52. 38.100 / 52. 38.100  
  libavcodec     55. 18.102 / 55. 18.102  
  libavformat    55. 12.100 / 55. 12.100  
  libavdevice    55.  3.100 / 55.  3.100  
  libavfilter     3. 79.101 /  3. 79.101  
  libswscale      2.  3.100 /  2.  3.100  
  libswresample   0. 17.102 /  0. 17.102  
  libpostproc    52.  3.100 / 52.  3.100  
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x8086ca0] multiple edit list entries, a/v desync might occur, patch welcome  
Guessed Channel Layout for  Input Stream #0.1 : stereo  
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '00700.mov':  
  Metadata:  
    major_brand     : qt    
    minor_version   : 537199360  
    compatible_brands: qt    
    creation_time   : 2013-06-11 15:57:03  
  Duration: 00:02:41.56, start: 0.000000, bitrate: 48439 kb/s  
    Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5c / 0x63356478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 45873 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc  
    Metadata:  
      creation_time   : 2013-06-11 15:57:03  
      handler_name    : Apple Alias Data Handler  
      timecode        : 01:00:00:00  
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 2304 kb/s  
    Metadata:  
      creation_time   : 2013-06-11 15:57:03  
      handler_name    : Apple Alias Data Handler  
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)  
    Metadata:  
      creation_time   : 2013-06-11 15:58:45  
      handler_name    : Apple Alias Data Handler  
      timecode        : 01:00:00:00  
Output #0, mov, to 'testout.mov':  
  Metadata:  
    major_brand     : qt    
    minor_version   : 537199360  
    compatible_brands: qt    
    encoder         : Lavf55.12.100  
    Stream #0:0(eng): Video: mpeg2video (xd5c / 0x63356478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 45873 kb/s, 25 fps, 12800 tbn, 25 tbc   
    Metadata:  
      creation_time   : 2013-06-11 15:57:03  
      handler_name    : Apple Alias Data Handler  
      timecode        : 01:00:00:00  
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, 2304 kb/s
    Metadata:  
      creation_time   : 2013-06-11 15:57:03  
      handler_name    : Apple Alias Data Handler
Stream mapping:  
  Stream #0:0 -> #0:0 (copy)  
  Stream #0:1 -> #0:1 (copy)  
Press [q] to stop, [?] for help  
frame=   45 fps=0.0 q=-1.0 size=   11470kB time=00:00:02.00 bitrate=46982.6kbitsframe=   99 fps= 99 q=-1.0 size=   25263kB time=00:00:04.00 bitrate=51738.5kbitsframe=  154 fps=101 q=-1.0 size=   38805kB time=00:00:06.12 bitrate=51942.3kbitsframe=  178 fps= 88 q=-1.0 size=   45189kB time=00:00:07.08 bitrate=52286.0kbitsframe=  211 fps= 82 q=-1.0 size=   53860kB time=00:00:09.00 bitrate=49024.2kbitsframe=  239 fps= 78 q=-1.0 size=   61190kB time=00:00:10.00 bitrate=50126.7kbitsframe=  269 fps= 73 q=-1.0 size=   68671kB time=00:00:11.00 bitrate=51140.9kbitsframe=  299 fps= 71 q=-1.0 size=   76513kB time=00:00:12.00 bitrate=52232.9kbitsframe=  332 fps= 69 q=-1.0 size=   83237kB time=00:00:13.24 bitrate=51501.1kbitsframe=  360 fps= 66 q=-1.0 size=   91908kB time=00:00:15.00 bitrate=50193.9kbits  ...and so on till  
frame= 4041 fps= 51 q=-1.0 size=  950203kB time=00:02:42.00 bitrate=48049.8kbitsframe= 4060 fps= 51 q=-1.0 Lsize=  955158kB time=00:02:42.40 bitrate=48181.4kbits/s    
video:909397kB audio:45675kB subtitle:0 global headers:0kB muxing overhead 0.008987%

So again I use ffprobe:

ffprobe testout.mov   
ffprobe version 2.0.1 Copyright (c) 2007-2013 the FFmpeg developers  
  built on Aug 27 2013 20:17:24 with gcc 4.5 (SUSE Linux)  
  configuration: --enable-gpl --enable-shared --enable-libmp3lame --enable-libxvid   --enable-libx264 --enable-nonfree --enable-postproc --enable-version3  
  libavutil      52. 38.100 / 52. 38.100  
  libavcodec     55. 18.102 / 55. 18.102  
  libavformat    55. 12.100 / 55. 12.100  
  libavdevice    55.  3.100 / 55.  3.100  
  libavfilter     3. 79.101 /  3. 79.101  
  libswscale      2.  3.100 /  2.  3.100  
  libswresample   0. 17.102 /  0. 17.102  
  libpostproc    52.  3.100 / 52.  3.100  
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'testout.mov':  
  Metadata:  
    major_brand     : qt    
    minor_version   : 512  
    compatible_brands: qt    
    encoder         : Lavf55.12.100  
  Duration: 00:02:42.40, start: 0.000000, bitrate: 48181 kb/s  
    Stream #0:0(eng): Video: mpeg2video (4:2:2) (xd5c / 0x63356478), yuv422p, 1920x1080 [SAR 1:1 DAR 16:9], 45873 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc  
    Metadata:  
      handler_name    : DataHandler  
      timecode        : 01:00:00:00  
    Stream #0:1(eng): Audio: pcm_s24le (in24 / 0x34326E69), 48000 Hz, stereo, s32, 2304 kb/s  
    Metadata:  
      handler_name    : DataHandler  
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74)  
    Metadata:  
      handler_name    : DataHandler  
      timecode        : 01:00:00:00  
Unsupported codec with id 0 for input stream 2 

Why is it not stripping stream 2? What Am I missing?


Generally, I Have no idea why it's not mapped as it should. But I've found workaround for this:

ffmpeg -i 01300.mov -filter_complex "[0:v]null[video_out];[0:a]anull[audio_out]" -map [video_out] -map [audio_out] out.mov

Looks like ffmpeg cannot map this 3rd stream correctly.


Answering this since it comes up on google search (to help others looking for solutions).

This has been fixed as of this ticket, https://trac.ffmpeg.org/ticket/5492, and you can get rid of the track by adding -write_tmcd 0 to the ffmpeg command.

This is specifically for a Data (tmcd) track. For others (subtitles, data in general, etc.), a combination of either -dn, -map -0:d and similar commands should help.