I have converted my .mkv file into an .mp4 by using the command:
sudo avconv -i input.mkv -codec copy output.mp4
I am trying to play the mp4 file in the browser, but the audio is not playing. The video player shows that it is on mute, but the button is disabled so you cannot turn it off of mute.
Other mp4s are working, but they were not converted from .mkv. Any help would be much appreciated.
In an MP4 container, browsers usually support only H.264 video and either AAC or MP3 audio. The output from your
avconv
command should show the format of your video and audio; look under "Input #0" for the lines that start with "Stream #". If you audio is not already AAC or MP3 you will want to convert it instead of just copying it to the MP4 container. You can copy the video and convert only the audio with a command like this:The
-c:v copy
will copy the video, and-c:a libmp3lame
will convert the audio to MP3 using thelibmp3lame
encoder.-q:a 2
sets the audio quality; use a lower number for better quality (and a larger file). You could instead convert to AAC audio if youravconv
was configured with non-free codecs enabled and a good quality AAC encoder.