如何在使用 FFmpeg 转换时复制无法识别的流?

如何在使用 FFmpeg 转换时复制无法识别的流?

我正在尝试使用 FFmpeg 压缩一些包含多个流的视频,其中一些流无法被 FFmpeg 识别:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'GX010686.MP4':
  Metadata:
    major_brand     : mp41
    minor_version   : 538120216
    compatible_brands: mp41
    creation_time   : 2018-12-10T19:09:25.000000Z
    firmware        : HD7.01.01.51.00
  Duration: 00:08:52.54, start: 0.000000, bitrate: 60136 kb/s
    Stream #0:0(eng): Video: hevc (Main) (hvc1 / 0x31637668), yuvj420p(pc, bt709), 3840x2160 [SAR 1:1 DAR 16:9], 59886 kb/s, 59.94 fps, 59.94 tbr, 60k tbn, 59.94 tbc (default)
    Metadata:
      creation_time   : 2018-12-10T19:09:25.000000Z
      handler_name    : GoPro H.265
      encoder         : GoPro H.265 encoder
      timecode        : 19:27:44:06
    Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 189 kb/s (default)
    Metadata:
      creation_time   : 2018-12-10T19:09:25.000000Z
      handler_name    : GoPro AAC  
      timecode        : 19:27:44:06
    Stream #0:2(eng): Data: none (tmcd / 0x64636D74) (default)
    Metadata:
      creation_time   : 2018-12-10T19:09:25.000000Z
      handler_name    : GoPro TCD  
      timecode        : 19:27:44:06
    Stream #0:3(eng): Data: bin_data (gpmd / 0x646D7067), 35 kb/s (default)
    Metadata:
      creation_time   : 2018-12-10T19:09:25.000000Z
      handler_name    : GoPro MET  
    Stream #0:4(eng): Data: none (fdsc / 0x63736466), 13 kb/s (default)
    Metadata:
      creation_time   : 2018-12-10T19:09:25.000000Z
      handler_name    : GoPro SOS

当我使用 时ffmpeg -i $file -c:v libx265 -crf 23 -c:a libvorbis -q:a 5 $newfilename,只有音频和视频流最终出现在新文件中。因此我尝试了ffmpeg -i $filename -map 0 -c copy -c:v libx265 -crf 23 -c:a libvorbis -q:a 5 $newfilename,但这给了我以下错误:

[mp4 @ 0xf974ce7d500] Could not find tag for codec none in stream #2, codec not currently supported in container
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
Error initializing output stream 0:0 --

我知道 FFmpeg 不理解这些附加元数据,但它不需要理解。我怎样才能将带有编解码器的流复制none到新文件中?

相关内容