0

So this always worked before.

I have a video file, lets call it 1.mp4 I have an audio file that plays, lets call it 2.mp3

As per this solution, Merging video and audio, with audio re-encoding, I try to merge them using this command:

ffmpeg -i 1.mp4 -i 2.mp3 -c:v copy -c:a aac output.mp4

1.mp4 has a shorter length than 2.mp3, so I want the audio to cut off at the end of the video clip.

The result file output.mp4 has no sound.

Additionally, the audio stream does show up in VLC when I play it. It shows as an audio track titled simple_aac.

I don't tend to lean towards believing VLC didn't work, as it has been a pretty stable option for playing otherwise unplayable video and audio on Linux since forever.

Blind Spots
  • 2,607
  • 1
  • 16
  • 21

1 Answers1

-1

If the video is shorter than audio or vice versa and you need to cutoff whichever's the shortest then you might want to use -shortest flag

ffmpeg -i 1.mp4 -i 2.mp3 -c:v copy -c:a aac -shortest output.mp4
  • this is interesting. so the audio clip plays on vlc. the output file pipes out some errors. ffmpeg doesn't appear to be working as it should. wonder how this might happen. audio stream exists. tried playing it on mplayer as an alternative same problem, no sound. – Jack Assim May 06 '23 at 16:15
  • can you share link to your your input file and the FFmpeg command you're running? – Abrar Ahmed May 07 '23 at 09:47