[MEncoder-users] Mencoder Subtitles not working

James Hastings-Trew jimht at shaw.ca
Thu Feb 26 13:11:38 CET 2009


James Hastings-Trew wrote:
> James Hastings-Trew wrote:
>   
>> Reimar Döffinger wrote:
>>   
>>     
>>> On Wed, Feb 25, 2009 at 07:44:50AM -0600, James Hastings-Trew wrote:
>>>   
>>>     
>>>       
>>>> mencoder video.h264 -sws 9 -vf scale=1280:720 -sub subtitles.srt -utf8 
>>>> -subfont-autoscale 0 -subfont-text-scale 35 -subpos 98 -ovc lavc -o test.avi
>>>>     
>>>>       
>>>>         
>>> -vf scale=1280:720,expand=osd=1,scale
>>> or something like that.
>>>   
>>>     
>>>       
>> That didn't do it, neither did  -vf 
>> scale=1280:720,expand=1280:720:0:0;1,scale
>>   
>>     
> 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.  Putting the video into an 
> .mp4 container with mp4box was a dead-end, but I think eac3to can bundle 
> video into an .mkv container instead of as a raw stream, so I'm going to 
> try that next.
>
>   
The .mkv format didn't work, but this did:

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.




More information about the MEncoder-users mailing list