Suppose I have two files called foo.mp4
and foo.srt
. The mp4 file doesn't have subtitles, and I want to add subtitles from the foo.srt
file.
The utility mencoder
is frequently recommended in this context. I tried using, for example:
mencoder foo.mp4 -sub foo.srt -ovc lavc -oac copy -o foo.mpg
This worked for me before. However, here I get
Audio format 0x4134504d is incompatible with '-oac copy', please try '-oac pcm' instead or use '-fafmttag' to override it.
I don't know what this means. Running mediainfo
on this file gives the following information for the audio
stream.
Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 1h 47mn
Bit rate mode : Variable
Bit rate : 93.7 Kbps
Maximum bit rate : 110 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 71.8 MiB (9%)
Language : English
Encoded date : UTC 2014-11-19 03:58:38
Tagged date : UTC 2014-11-19 03:58:40
Trying
mencoder foo.mp4 -sub foo.srt -ovc lavc -oac pcm -o foo.mpg
works, but produces a video that is visibly worse with regard to quality.
I suppose ffmpeg
could also be an option, but I've not figured out how to use it to do this.
I'm using Debian wheezy. The versions of mencoder
and ffmpeg
that ship with wheezy are:
2:1.0~rc4.dfsg1+svn34540-1+deb7u1 (mencoder)
6:0.8.16-1 (ffmpeg)
However, I managed to backport a newer version of ffmpeg
from unstable,
namely: 7:2.5.1-1
.
avi
was a typo. The answer is, whatever I can eventually create a DVD with. This usually involves creating a DVD structure, and then an ISO from that. The first step involves creating a file from the original video file usingffmpeg
, and I give this ampg
extension for reasons I'm not clear. After that this file is processed bydvdauthor
to produce a directory structure, and then converted into an iso withgenisoimage
. So, I suppose that answer is, whatever formats work.