[Home]Import Modules/Import Mplayer

Showing revision 4
Transcode supports the use of mplayer as an import method via -x mplayer,mplayer, leveraging mplayer's miraculous ability to play ANYTHING.

Uwe Malzahn said:

IIRC, you can do:

 -x mplayer="-sub file_containing_the_subs -subpos 93 -subalign 2"

to get subtitles, otherwise refusing to be processed, merged into the stream.


It is necessary to tell Transcode everything it needs to know about the source file.
Such as framerate, framesize, audio sample rate, audio bits per sample, number of audio channels and audio format.

An easy way to obtain this information is to use the following:

 mplayer -vo dummy -identify your_movie_file 2>&1 | grep -E "VIDEO:|AUDIO:"

This will output information similar to the following:

 VIDEO:  [DIV3]  640x352  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
 AUDIO: 44100 Hz, 2 ch, s16le, 96.0 kbit/6.25% (ratio: 12000->192000)

From this info we now have:

 Framerate  =  23.976
 Framesize  =  640x352
 Audio sample rate  =  44100
 Audio bits per sample  =  16
 Number of audio channels  =  2

The Mplayer import module has Mplayer create a PCM audio stream (or 0x1), that Transcode then processes, so:

 Audio format  =  0x1

Given this info the Transcode command-line can now be built, in this example we are Transcoding to create a DVD video stream (.m2v) and a DVD audio stream (.ac3), ready for mplexing:

 transcode -H0 \
           -i your_movie_file \
           -x mplayer,mplayer \
           -f 23.976 -g 640x352 \
           -n 0x1 \
           -e 44100,16,2 \
           -y ffmpeg \
           --export_prof dvd-pal \
           -D0 -N 0x2000 \
           -b 384 \
           -m new_movie_name.ac3 \
           -o new_movie_name

If the source file contains multiple video and/or audio streams, it is possible to Transcode these as well:

 mplayer -vo dummy -identify your_movie_file 2>&1 | grep -E "ID_VIDEO_ID|ID_AUDIO_ID"

This gives:

 ID_VIDEO_ID=2
 ID_AUDIO_ID=3
 ID_AUDIO_ID=4
 ID_VIDEO_ID=5
 ID_VIDEO_ID=6
 ID_VIDEO_ID=7
 ID_VIDEO_ID=8
 ID_VIDEO_ID=9
 ID_VIDEO_ID=10

Based on that, say we want to Transcode the third video stream together with the second audio stream:

mplayer -vid 6 -aid 4 -vo dummy -identify your_movie_file 2>&1 | grep -E "VIDEO:|AUDIO:"

Returns:

 VIDEO:  [SVQ3]  400x238  24bpp  23.976 fps    0.0 kbps ( 0.0 kbyte/s)
 AUDIO: 44100 Hz, 2 ch, s16le, 160.0 kbit/11.34% (ratio: 20000->176400)

Now build the Transode line:

 transcode -H0 \
           -i your_movie_file \
           -x mplayer="-vid 6 -aid 4",mplayer \
           -f 23.976 -g 400x238 \
           -n 0x1 \
           -e 44100,16,2 \
           -y ffmpeg \
           --export_prof dvd-pal \
           -D0 -N 0x2000 \
           -b 384 \
           -m new_movie_name.ac3 \
           -o new_movie_name

Transcode Wiki | Import Modules | Recent Changes | Preferences
Password required to edit | View other revisions | View current revision
Edited February 16, 2006 11:10 am by Rick (diff)
Search: