Zobrazují se příspěvky se štítkemmencoder. Zobrazit všechny příspěvky
Zobrazují se příspěvky se štítkemmencoder. Zobrazit všechny příspěvky

pátek 24. prosince 2010

Encode movie for IPBOX 420S

The satellite receiver IPBOX 420S is capable to play uploaded MPEG2 files. I was trying to find correct encoder settings for a long time. Finally it is here:

#!/bin/sh
in_vidname=$1
in_subname=${in_vidname%\.*}.srt
out_name=${in_vidname%\.*}.mpeg
echo IN : $in_vidname
echo SUB: $in_subname
echo OUT: $out_name
mencoder \
-sub $in_subname -subcp utf-8 -oac mp3lame \
-subfont-autoscale 1 -nooverlapsub -subpos 70 \
-ovc lavc -of mpeg -mpegopts format=mpeg2:interleaving2 \
-vf scale=720:306,expand=720:576 \
-lavcopts threads=2:vcodec=mpeg2video:vbitrate=2200 \
-ofps 25 \
-o $out_name $in_vidname


Notes:
-oac copy - only usable for some audio (my case - mp3 was fine)
-vf scale=720:304 - find your own depending on movie size - keep aspect if possible

pátek 27. srpna 2010

Batch extract music from video files

Following batch script (windows cmd) extracts audio from any mplayer supported audio or video file and saves the audio in mp3 into output dir. Handy in conjunction with Flash Video Downloader Firefox add-on.


set mplayer=c:\mplayer
set target=c:\music-to-convert\mp3
set source=c:\music-to-convert\flv


cd %source%
for /f %%i in ('dir /b *') do (
echo %%i
set input=%%i
set output=%target%\%%i.mp3
%mplayer%\mencoder -ovc copy -oac mp3lame -lameopts cbr:br=128 -of rawaudio -o "%target%\%%i.mp3" "%%i"
)

pondělí 17. května 2010

Video encoding for Nokia 5310

I needed to encode some video clip to be played on a Nokia 5310 cell phone. After some short research and tuning I have used mencoder. Mencoder is a part of the mplayer package. Mencoder is able to use target profiles for encoding. I have created following profile to create file for Nokia 5310.

[nokia]
profile-desc="MPEG4/AAC"
vf=scale=176:-3,harddup
ovc=lavc=yes
oac=lavc=yes
lavcopts=aglobal=1:vglobal=1:vcodec=mpeg4:vbitrate=65:acodec=libfaac
af=lavcresample=44100
ofps=15
of=lavf=yes
lavfopts=format=mp4

Unfortunately I was not able to run the encoding on Linux (Fedora 12) due to limited support for licensed codecs. Running the task on Windows did the magic. After creating the configuration following commandline did the work:
mencoder source.mp4 -profile nokia -o result.mp4
Video clip playable on Nokia phone was created.

For Windows port of mplayer searches the config in following location:
%MPLAYER_INSTALATION_DIR%\mplayer\mencoder.conf