gpt4 book ai didi

audio - 使用 ffmpeg 同步带有音频的视频文件正在返回没有音频的视频

转载 作者:行者123 更新时间:2023-12-03 00:26:54 30 4
gpt4 key购买 nike

当我尝试使用 ffmpeg 将 .mov 视频与 .m4a 音频文件同步时

ffmpeg -ss 00:00:2 -i test.m4a  -i test.mov -c:v copy -c:a aac -strict experimental output.mp4

它就像一个魅力。但是现在我已经使用 adobe XD 录制了一个可用性测试视频,它返回了一个 .mp4 (MPEG-4) 视频,我使用返回 .m4a 音频文件的 quicktimre 手动录制了音频。

尝试使用 ffmpeg 合并它们会返回没有任何音频的视频:
ffmpeg -i video.mp4  -i audio.m4a -c:v copy -c:a aac -strict experimental output.mp4
ffmpeg version 4.1 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
configuration: --prefix=/usr/local/Cellar/ffmpeg/4.1_1 --enable-shared --enable-pthreads --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gpl --enable-libmp3lame --enable-libopus --enable-libsnappy --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libx265 --enable-libxvid --enable-lzma --enable-opencl --enable-videotoolbox
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
creation_time : 2019-07-31T14:43:18.000000Z
com.apple.quicktime.make: Apple
com.apple.quicktime.model: MacBookPro15,1
com.apple.quicktime.software: Mac OS X 10.14.5 (18F203)
com.apple.quicktime.creationdate: 2019-07-31T17:43:17+0300
Duration: 00:03:46.05, start: 0.000000, bitrate: 498 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 374x812 [SAR 1:1 DAR 187:406], 390 kb/s, 60 fps, 60 tbr, 6k tbn, 12k tbc (default)
Metadata:
creation_time : 2019-07-31T14:43:18.000000Z
handler_name : Core Media Video
encoder : H.264
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, stereo, fltp, 0 kb/s (default)
Metadata:
creation_time : 2019-07-31T14:43:18.000000Z
handler_name : Core Media Audio
Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'audio.m4a':
Metadata:
major_brand : M4A
minor_version : 0
compatible_brands: M4A mp42isom
creation_time : 2019-07-31T14:47:26.000000Z
iTunSMPB : 00000000 00000840 00000000 00000000009DFBC0 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
Duration: 00:03:54.78, start: 0.047891, bitrate: 225 kb/s
Stream #1:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 224 kb/s (default)
Metadata:
creation_time : 2019-07-31T14:47:26.000000Z
handler_name : Core Media Audio
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
Press [q] to stop, [?] for help
[aac @ 0x7fb5a4806a00] Too many bits 16384.000000 > 12288 per frame requested, clamping to max
Output #0, mp4, to 'output.mp4':
Metadata:
major_brand : qt
minor_version : 0
compatible_brands: qt
com.apple.quicktime.creationdate: 2019-07-31T17:43:17+0300
com.apple.quicktime.make: Apple
com.apple.quicktime.model: MacBookPro15,1
com.apple.quicktime.software: Mac OS X 10.14.5 (18F203)
encoder : Lavf58.20.100
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, bt709), 374x812 [SAR 1:1 DAR 187:406], q=2-31, 390 kb/s, 60 fps, 60 tbr, 12k tbn, 6k tbc (default)
Metadata:
creation_time : 2019-07-31T14:43:18.000000Z
handler_name : Core Media Video
encoder : H.264
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, stereo, fltp, 96 kb/s (default)
Metadata:
creation_time : 2019-07-31T14:43:18.000000Z
handler_name : Core Media Audio
encoder : Lavc58.35.100 aac
frame=13563 fps=0.0 q=-1.0 Lsize= 10903kB time=00:03:46.08 bitrate= 395.1kbits/s speed= 916x
video:10699kB audio:10kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 1.805767%

我怎样才能绕过这个限制?

最佳答案

Adobe XD 视频中有一个音频流,所以 ffmpeg 选择了它。
Stream #0:1 -> #0:1 (aac (native) -> aac (native))
使用 -map 显式选择音频源。
ffmpeg -i video.mp4 -i audio.m4a -map 0:v -map 1:a -c:v copy -c:a aac -strict experimental output.mp4

关于audio - 使用 ffmpeg 同步带有音频的视频文件正在返回没有音频的视频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57294335/

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