[MPlayer-users] Hardcoding subtitles with mencoder / mplayer

245 views
Skip to first unread message

Jos van Riswick

unread,
Mar 20, 2012, 12:40:59 PM3/20/12
to mplaye...@mplayerhq.hu
I'm trying to hardcode subtitles into an mpeg movie. First, when I try to
just play with mplayer, everything is fine:


mplayer movie.3.mpeg -sub movie.subtitles.srt -subfont-text-scale 2.3


plays the movie, and shows subtitles in a small font. But:


mencoder movie.3.mpeg -sub movie.subtitles.ass -subfont-text-scale 2 -oac
copy -ovc copy -o movie.subtitles.mpeg


adds the subtitles, but without scaling. And this:


mencoder movie.3.mpeg -sub movie.subtitles.ass -subfont-text-scale 2 -oac
copy -ovc lavc -o movie.subtitles.mpeg


adds the subtitles with scaling, but also the subtitles with no scaling on
top of the scales ones. So I'm seeing two sets of subtitles
simultaneously....

What am I doing wrong? ? ? I tried to change the font size in the .ass
file, but with no result....


josvanr
_______________________________________________
MPlayer-users mailing list
MPlaye...@mplayerhq.hu
https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users

Mathieu Westphal

unread,
Mar 20, 2012, 1:15:25 PM3/20/12
to MPlayer usage questions, feature requests, bug reports
with ass sub, use ass options.


mencoder movis.avi -ass -UTF8 -sub
Ashes.and.Snow.2005.DVDRip.XviD-D0PE.srt -ass-font-scale 2 -o
newmovie.avi -oac copy -ovc lavc

Jos van Riswick

unread,
Mar 20, 2012, 2:21:25 PM3/20/12
to MPlayer usage questions, feature requests, bug reports
thnx... but ... sorry the font is still large...

For reference I'll paste my command line:

mencoder movie.3.mpeg -ass -UTF8 -sub movie.subtitles.ass -ass-font-scale 2
-o movie.subtitles.mpeg -oac copy -ovc lavc

What type of subtitle file can I use if I want to use -subfont-text-scale?
I just need a simple way to add some text comments to a video. I'm
using subtitleeditor (on linux platform) to edit the subtitles and I can
export them to various formats.


josvanr


On Tue, Mar 20, 2012 at 6:15 PM, Mathieu Westphal

>
>>
> with ass sub, use ass options.
>
>

> mencoder movis.avi -ass -UTF8 -sub Ashes.and.Snow.2005.DVDRip.**XviD-D0PE.srt


> -ass-font-scale 2 -o newmovie.avi -oac copy -ovc lavc
>

> ______________________________**_________________
> MPlayer-users mailing list
> MPlaye...@mplayerhq.hu
> https://lists.mplayerhq.hu/**mailman/listinfo/mplayer-users<https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users>

Reimar Döffinger

unread,
Mar 20, 2012, 6:24:36 PM3/20/12
to MPlayer usage questions, feature requests, bug reports
On Tue, Mar 20, 2012 at 05:40:59PM +0100, Jos van Riswick wrote:
> mencoder movie.3.mpeg -sub movie.subtitles.ass -subfont-text-scale 2 -oac
> copy -ovc copy -o movie.subtitles.mpeg
>
>
> adds the subtitles, but without scaling.

No, that's just not possible. If there are subtitles with -ovc copy that
is because they were there in the input file.

Jos van Riswick

unread,
Mar 20, 2012, 6:26:28 PM3/20/12
to mplaye...@mplayerhq.hu
hello

for whoever whats to know I found out what happened:

when using mplayer to play movie.subtitles.mpeg,
mplayer automatically looks for a subtitles file like
movie.subtitles.ass or movie.subtitles.srt. When it is
there, it displays those subtitles in some standard
large font. So in my first invocation of mencoder,
(see below)
no subtitles were actually hardcoded, but I thought they
were because I did see them when playing the movie.
But mplayer was actually displaying them 'on the fly'.

In the second invocation of mencoder below, the small
font subtitles were hardcoded. But when playing the movie
in mplayer, the large subtitles were added over that on
the fly, because the srt and ass file with the same name
as the movie were still there ! (:p fiew, confusing)

Anywayz, hope this helps someone....


josvanr

Jos van Riswick

unread,
Mar 20, 2012, 6:28:41 PM3/20/12
to MPlayer usage questions, feature requests, bug reports
yes thnx... mplayer apparently displays the subtitles automatically
when it finds a subtitle file..........

Mathieu Westphal

unread,
Mar 20, 2012, 6:44:32 PM3/20/12
to MPlayer usage questions, feature requests, bug reports
Sorry, i haven't seen you want to reduce the size of the sub , so the
command is :
mencoder movie.avi -ass -sub sub.ass -ass-font-scale 0.5 -o as.avi -oac
copy -ovc lavc

I always use -ass* options, so i cannot inform you about -subfont
options, i guess it will work with simple .srt sub .

This works for me and reduce by two the size of my sub.

Anyway there is good other ass options (like ass-*-margin wich allow you
to move sub up and down in black space so the frame is full visible )

Hope this help

Mathieu

Albert Scholtalbers

unread,
Mar 20, 2012, 7:01:32 PM3/20/12
to MPlayer usage questions, feature requests, bug reports
The only way to get subs hardcoded into MPEG2 files as far as I know of is
by using FFmpegx on Mac, not even it's "brother" on Windows via FFmpeg, or
very buggy Avidemux
See here: http://ffmpegx.com/audio.html

If you don't have Mac hardware, try a Virtual Machine

Albert

Jos van Riswick

unread,
Mar 20, 2012, 7:05:13 PM3/20/12
to MPlayer usage questions, feature requests, bug reports
yes thnx!!! Jos

>>> mencoder movis.avi -ass -UTF8 -sub Ashes.and.Snow.2005.DVDRip.****


>>> XviD-D0PE.srt
>>>
>>> -ass-font-scale 2 -o newmovie.avi -oac copy -ovc lavc
>>>

>>> ______________________________****_________________
>>> MPlayer-users mailing list
>>> MPlaye...@mplayerhq.hu
>>> https://lists.mplayerhq.hu/****mailman/listinfo/mplayer-users<https://lists.mplayerhq.hu/**mailman/listinfo/mplayer-users>
>>> **<https://lists.mplayerhq.hu/**mailman/listinfo/mplayer-users<https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users>
>>> **>

Albert Scholtalbers

unread,
Mar 25, 2012, 8:55:21 AM3/25/12
to MPlayer usage questions, feature requests, bug reports
@Jos

Does this mean that mencoder can produce MPEG2 files with hardcoded subs?

Thx in advance

2012/3/20 Jos van Riswick <jos...@gmail.com>

> yes thnx!!! Jos
>
> On Tue, Mar 20, 2012 at 11:44 PM, Mathieu Westphal <
> mathieu....@gmail.com> wrote:
>
> > Sorry, i haven't seen you want to reduce the size of the sub , so the
> > command is :
> > mencoder movie.avi -ass -sub sub.ass -ass-font-scale 0.5 -o as.avi -oac
> > copy -ovc lavc
> >
> > I always use -ass* options, so i cannot inform you about -subfont
> options,
> > i guess it will work with simple .srt sub .
> >
> > This works for me and reduce by two the size of my sub.
> >
> > Anyway there is good other ass options (like ass-*-margin wich allow you
> > to move sub up and down in black space so the frame is full visible )
> >
> > Hope this help
> >
> > Mathieu
>

Mathieu Westphal

unread,
Mar 25, 2012, 9:51:07 AM3/25/12
to MPlayer usage questions, feature requests, bug reports
Something like that

mencoder -o hardcodedsubmovie.avi -oac copy -ovc lavc -lavcopts msmpg4v2
-sub sub.srt movie.avi

Jos van Riswick

unread,
Mar 25, 2012, 1:09:23 PM3/25/12
to MPlayer usage questions, feature requests, bug reports
I think so, the output format doesn't matter I think.

I'm now using this command line:


mencoder -sub movie.srt -subfont-text-scale 1.8 -ofps 6 -ovc lavc
-lavcopts vcodec=msmpeg4v2:vbitrate=800000 -nosound -o
movie.withsubtitles.avi movie.avi

that works fine ! The subtitles will be 'burned' into move.subtitles.avi.
Only remember that with these file names, when
you do

mplayer movie.avi

the subtitles defined in 'movie.str' will be displayed by mplayer
'on the fly'......


Jos

On Sun, Mar 25, 2012 at 3:51 PM, Mathieu Westphal <
mathieu....@gmail.com> wrote:

> Something like that
>
> mencoder -o hardcodedsubmovie.avi -oac copy -ovc lavc -lavcopts msmpg4v2
> -sub sub.srt movie.avi
>
> On 03/25/2012 02:55 PM, Albert Scholtalbers wrote:
>
>> @Jos
>>
>> Does this mean that mencoder can produce MPEG2 files with hardcoded subs?
>>
>> Thx in advance
>>
>> 2012/3/20 Jos van Riswick<jos...@gmail.com>
>>
>>
>>
>>> yes thnx!!! Jos
>>>
>>> On Tue, Mar 20, 2012 at 11:44 PM, Mathieu Westphal<
>>> mathieu....@gmail.com> wrote:
>>>
>>>
>>>
>>>> Sorry, i haven't seen you want to reduce the size of the sub , so the
>>>> command is :
>>>> mencoder movie.avi -ass -sub sub.ass -ass-font-scale 0.5 -o as.avi -oac
>>>> copy -ovc lavc
>>>>
>>>> I always use -ass* options, so i cannot inform you about -subfont
>>>>
>>>>
>>> options,
>>>
>>>
>>>> i guess it will work with simple .srt sub .
>>>>
>>>> This works for me and reduce by two the size of my sub.
>>>>
>>>> Anyway there is good other ass options (like ass-*-margin wich allow you
>>>> to move sub up and down in black space so the frame is full visible )
>>>>
>>>> Hope this help
>>>>
>>>> Mathieu
>>>>
>>>>
>>>
>>>

>> ______________________________**_________________
>> MPlayer-users mailing list
>> MPlaye...@mplayerhq.hu
>> https://lists.mplayerhq.hu/**mailman/listinfo/mplayer-users<https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users>
>>
>>
>
> ______________________________**_________________
> MPlayer-users mailing list
> MPlaye...@mplayerhq.hu
> https://lists.mplayerhq.hu/**mailman/listinfo/mplayer-users<https://lists.mplayerhq.hu/mailman/listinfo/mplayer-users>

Reply all
Reply to author
Forward
0 new messages