gpt4 book ai didi

video - FFMPEG 从视频中删除音频使视频变短

转载 作者:行者123 更新时间:2023-12-04 23:07:41 30 4
gpt4 key购买 nike

我试图使用 FFmpeg 从视频中删除音频,我使用的命令是:

ffmpeg -i video.mp4 -an -c copy no_sound.mp4

但最终视频的长度小于原始视频。

原始视频长度 - 0:05:43
最终视频长度 - 0:05:34

以下是 FFmpeg 生成的输出:
    ffmpeg -i video.mp4 -an -c copy no_sound.mp4
ffmpeg version 4.2.2-1ubuntu1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 9 (Ubuntu 9.3.0-3ubuntu1)
configuration: --prefix=/usr --extra-version=1ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 31.100 / 56. 31.100
libavcodec 58. 54.100 / 58. 54.100
libavformat 58. 29.100 / 58. 29.100
libavdevice 58. 8.100 / 58. 8.100
libavfilter 7. 57.100 / 7. 57.100
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 5.100 / 5. 5.100
libswresample 3. 5.100 / 3. 5.100
libpostproc 55. 5.100 / 55. 5.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 1970-01-01T00:00:00.000000Z
encoder : Lavf52.64.2
Duration: 00:05:42.96, start: 0.000000, bitrate: 99 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 816x688 [SAR 1:1 DAR 51:43], 64 kb/s, 1.75 fps, 15 tbr, 15 tbn, 30 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 33 kb/s (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : SoundHandler
Output #0, mp4, to 'no_sound.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 816x688 [SAR 1:1 DAR 51:43], q=2-31, 64 kb/s, 1.75 fps, 15 tbr, 15360 tbn, 15 tbc (default)
Metadata:
creation_time : 1970-01-01T00:00:00.000000Z
handler_name : VideoHandler
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
frame= 584 fps=0.0 q=-1.0 Lsize= 2629kB time=00:05:34.53 bitrate= 64.4kbits/s speed=5.78e+04x
video:2621kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.313674%

为什么会这样?

orignal video file link

最佳答案

视频流是可变帧率的,最后一帧的时间戳为 5m34s。音频更长。播放器将保留最后一帧,直到最长的流(在这种情况下为音频)已完全播放。

萃取没问题。

关于video - FFMPEG 从视频中删除音频使视频变短,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61540205/

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