gpt4 book ai didi

video - 如何使用 ffmpeg 从视频中删除除视频和立体声音频流之外的所有内容?

转载 作者:行者123 更新时间:2023-12-04 22:59:23 28 4
gpt4 key购买 nike

我正在尝试从 mkv 文件中获取干净的 h264 视频。干净的意思是它只有一个视频流和立体声。
输入文件可以有多个 channel 和字幕以及其他我不需要的未知内容。
我正在使用带有此命令的 ffmpeg:

 ffmpeg -i "input.mkv" -ac 2 -vf scale=trunc(oh*a/2)*2:480 -c:v libx264 "output.mp4"

这应该会给我一个 480p 的立体声视频,这是我需要的。
我用 ffmpeg 尝试了多个 -map 或 dispositions 命令来删除字幕,但没有成功。

如何使用 ffmpeg 删除除视频和立体声流之外的所有内容并获得 480p 立体声视频?

编辑:
ffmpeg 的输出 - "input.mkv"-i "output.mp4":
ffmpeg -i "input.mkv" -i "output.mp4"
ffmpeg version N-91972-gbd10c1e9a8 Copyright (c) 2000-2018 the FFmpeg developer

built with gcc 8.2.1 (GCC) 20180813
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconf
g --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-li
freetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-am
wb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy -
enable-libsoxr --enable-libtheora --enable-libtwolame --enable-libvpx --enable-
ibwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 -
enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --e
able-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --e
able-libxvid --enable-libaom --enable-libmfx --enable-amf --enable-ffnvcodec --
nable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --ena
le-avisynth
libavutil 56. 19.101 / 56. 19.101
libavcodec 58. 30.100 / 58. 30.100
libavformat 58. 18.101 / 58. 18.101
libavdevice 58. 4.103 / 58. 4.103
libavfilter 7. 32.100 / 7. 32.100
libswscale 5. 2.100 / 5. 2.100
libswresample 3. 2.100 / 3. 2.100
libpostproc 55. 2.100 / 55. 2.100
[hevc @ 00000000004a5940] Invalid default display window
Input #0, matroska,webm, from 'input.mkv':
Metadata:
title : Elysium (2013)
encoder : libebml v1.3.3 + libmatroska v1.4.4
creation_time : 2016-01-05T22:30:41.000000Z
Duration: 00:01:02.73, start: 0.166000, bitrate: 53638 kb/s
Chapter #0:0: start 0.000000, end 62.896000
Metadata:
title : 00:00:00.000
Stream #0:0(eng): Video: hevc (Main 10), yuv420p10le(tv), 3840x1606, SAR 1:
DAR 1920:803, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
Metadata:
title : Elysium (2013) - Release for ULTRAHDCLUB
BPS : 51036975
BPS-eng : 51036975
DURATION : 00:01:02.604000000
DURATION-eng : 00:01:02.604000000
NUMBER_OF_FRAMES: 1501
NUMBER_OF_FRAMES-eng: 1501
NUMBER_OF_BYTES : 399389852
NUMBER_OF_BYTES-eng: 399389852
_STATISTICS_WRITING_APP: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_DATE_UTC: 2016-01-05 22:30:41
_STATISTICS_WRITING_DATE_UTC-eng: 2016-01-05 22:30:41
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Stream #0:1(eng): Audio: dts (DTS-HD MA), 48000 Hz, 7.1, s16p (default)
Metadata:
title : DTS-HD MA 7.1 - Blu-ray CEE
BPS : 2706639
BPS-eng : 2706639
DURATION : 00:01:02.561000000
DURATION-eng : 00:01:02.561000000
NUMBER_OF_FRAMES: 5865
NUMBER_OF_FRAMES-eng: 5865
NUMBER_OF_BYTES : 21166260
NUMBER_OF_BYTES-eng: 21166260
_STATISTICS_WRITING_APP: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_APP-eng: mkvmerge v8.7.0 ('All of the above') 64bit
_STATISTICS_WRITING_DATE_UTC: 2016-01-05 22:30:41
_STATISTICS_WRITING_DATE_UTC-eng: 2016-01-05 22:30:41
_STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
_STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
title : Elysium (2013)
encoder : Lavf58.18.101
Duration: 00:01:02.73, start: 0.000000, bitrate: 1671 kb/s
Chapter #1:0: start 0.000000, end 62.730000
Metadata:
title : 00:00:00.000
Stream #1:0(eng): Video: h264 (High 10) (avc1 / 0x31637661), yuv420p10le, 1
46x480 [SAR 2030:2027 DAR 38773:16216], 1543 kb/s, SAR 15563:15540 DAR 1920:803
23.98 fps, 23.98 tbr, 24k tbn, 47.95 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #1:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fl
p, 128 kb/s (default)
Metadata:
handler_name : SoundHandler
Stream #1:2(eng): Data: bin_data (text / 0x74786574), 0 kb/s
Metadata:
handler_name : SubtitleHandler
At least one output file must be specified

最佳答案

我可以弄清楚:
-map_metadata -1
成功了。尽管视频仍然无法与 JavaFX 媒体播放器一起使用

编辑:

-profile:v high -level:v 4.0  -pix_fmt yuv420p 

我终于得到了一个兼容 JavaFX 媒体播放器的视频文件 :)

关于video - 如何使用 ffmpeg 从视频中删除除视频和立体声音频流之外的所有内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53396133/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com