I need a video file whose audio and video track duration are always the same. The file must contain an audio track even if source audio has no audio track. How do I tell ffmpeg to add a silent audio track when source has no audio trace. Also, if source has an audio track that is a different duration than the video, I need ffmpeg to append silent audio to make both output audio and video the same duration. Is this possible in one line with ffmpeg?
相关问题
- Improving accuracy of Google Cloud Speech API
- MP4 codec support in Chromium
- Streaming video (C# using FFmpeg AutoGen) sends mu
- How do I decode opus file to pcm file using libavc
- ffmpeg for Android: neon build has text relocation
相关文章
- Handling ffmpeg library interface change when upgr
- How to use a framework build of Python with Anacon
- c++ mp3 library [closed]
- Passing a native fd int to FFMPEG from openable UR
- FFmpeg - What does non monotonically increasing dt
- ffmpeg run from shell runs properly, but does not
- Issues in executing FFmpeg command in Java code in
- Terminal text becomes invisible after terminating
The command below will add a silent track of the same length* as the video, if there is no audio** in the source file.
*Since video frame duration and audio frame duration aren't usually identical, the lengths won't be exactly the same.
**when
map
is not specified, ffmpeg selects a single audio stream from among the inputs with the highest channel count. If there are two or more streams with same no. of channels, it selects stream with lowest index.anullsrc
here has one channel, so it will be passed over except when source has no audio.