使用 ffmpeg 从容器中丢弃数据流 [英] Discard data stream from container using ffmpeg

查看:78
本文介绍了使用 ffmpeg 从容器中丢弃数据流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 ffmpeg 删除 Mp4 容器中的数据(字幕)流.

I am trying to get rid of a data (subtitle) stream within a Mp4 container, using ffmpeg.

这是ffprobe的截图:

Here's the screenshot from ffprobe:

Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test.m4v':
Metadata:
major_brand     : isom
minor_version   : 2
compatible_brands: isomiso2avc1mp41
creation_time   : 2018-01-19T15:10:48.000000Z
Duration: 00:00:42.17, start: 0.000000, bitrate: 6260 kb/s
Chapter #0:0: start 0.000000, end 42.166000
Metadata:
  title           : Chapter 1
Stream #0:0(eng): Data: bin_data (text / 0x74786574), 0 kb/s (default)
Metadata:
  creation_time   : 2018-01-19T15:10:48.000000Z
  handler_name    : Apple Alias Data Handler
Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, 
fltp, 317 kb/s (default)
Metadata:
  creation_time   : 2018-01-19T15:10:48.000000Z
  handler_name    : AAC audio
Stream #0:2(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc), 
1920x1080, 5926 kb/s, 30 fps, 30 tbr, 30k tbn, 60k tbc (default)
Metadata:
  creation_time   : 2018-01-19T15:10:48.000000Z
  handler_name    : H264 video
 **Unsupported codec with id 100359 for input stream 0**

我试过了:

 ffmpeg -i test.m4v -acodec copy -vcodec copy -sn nodata.mp4

数据轨道还在那里,只是从流 0 移到了流 2

Data track still there, just moved from stream 0 to stream 2

我也试过:

 ffmpeg -i test.m4v -acodec copy -vcodec copy -map 0:1 -map 0:2 no2.mp4

相同的结果,跟踪仍然在那里,只是跳到流 0:2 没有运气.

Same result, track still there, just jumped to stream 0:2 no luck.

有什么提示吗?提前致谢

Any hint? Thanks in advance

推荐答案

谢谢,我使用带有负值的 -map_chapters 选项解决了删除数据流的问题.

Thanks, I resolved using the -map_chapters option with negative value to remove the data stream.

完整字符串:

ffmpeg -i in.mp4 -c:v copy -c:a copy -map_chapters -1 out.mp4 

希望这会对其他人有所帮助!

Hope this would help someone else!

这篇关于使用 ffmpeg 从容器中丢弃数据流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆