[MEncoder-users] embedded subtitles in an avi file
James Hastings-Trew
jimht at shaw.ca
Sat May 23 16:30:55 CEST 2009
David Liebman wrote:
> I have a sample dv video file and a sub station alpha subtitle file. I
> would like to embed the subtitles in the video and convert the video to
> a smaller .avi file in one process. I have tried to view my subtitles
> using mplayer and they show fine. Using mencoder the subtitles never
> show up on the screen. This is what I tried, but it didn't work.
>
> mencoder fan001.avi -sub fanText.ass -ss 10 -endpos 10 -o fanOut.avi
>
> I also tried the above command with the option '-ass'. I found that when
> I used the -ass option with mplayer the subtitles were not easily
> readable, though they were there. The subtitles look better without the
> '-ass' option. When I used the '-ass' option with mencoder there were no
> subtitles recorded in the final avi file, as before. I did some research
> and came up with the following commands which I put in a shell script:
>
> mkfifo video.yuv audio.wav
>
> mplayer -ao null -vo yuv4mpeg:file=video.yuv -sub fanText.ass fan001.avi
> &
>
> mplayer -ao pcm:file=audio.wav -vo null -vc dummy fan001.avi &
>
> ffmpeg -f yuv4mpegpipe -i video.yuv -i audio.wav -b 800k -ab 128k
> fanOutYuvText.avi
>
> These commands do record the subtitles, but the quality of the recording
> is poor. Why does that first mencoder command not work?
I have found that mencoder subtitles don't work if the source video
stream does not have proper timestamps. I don't know if that is your
problem, but since you are using a pipe, I would suspect that as a
possibility.
I refer you back to an earlier posting I made about a similar issue:
> The plot thickens. I believe the problem I am having is the
result of
> the input file "video.h264" not having any timestamps. It's a raw
video
> stream dump from eac3to, a blu-ray demuxer. When I encoded
video.h264 to
> an intermediate video file, and then used the encoded file as the
source
> with the subtitle options, voila, the subtitles showed up in the
output.
> Of course re-re-encoding a file is a lousy way to run an airport,
so I'm
> going to have to figure out how to get the raw video stream into some
> kind of container where there ARE timestamps.
mencoder video.h264 -ovc copy -nosound -o video.avi
mencoder video.avi -sws 9 -vf scale=1280:720,expand=osd=1 -sub
subtitles.srt -utf8 -subfont-autoscale 0 -subfont-text-scale 35 -subpos
98 -ovc lavc -o test.avi
(the second line is just a test encode I use - not my real encoding
parameters :) . Somehow doing the framecopy into an .avi container
fixes
the video up so that mencoder is able to add the subtitles. Yay me.
It is entirely possible that this has nothing to do with your problem.
__________ Information from ESET NOD32 Antivirus, version of virus signature database 4098 (20090522) __________
The message was checked by ESET NOD32 Antivirus.
http://www.eset.com
More information about the MEncoder-users
mailing list