Showing posts with label transcode. Show all posts
Showing posts with label transcode. Show all posts

Friday, September 18, 2009

Transcoding MJPEG to Xvid

Videos from the Canon IXUS 80 weren't playing properly for me either with VLC (Linux or XP) or Media Player.. so I thought I'd try transcoding them. It worked nicely.
See my earlier posts for the transcode install process.

Input file -
[user@aspireone ~]$ tcprobe -i MVI_2282.avi
[tcprobe] RIFF data, AVI video
[avilib] V: 30.000 fps, codec=MJPG, frames=7607, width=640, height=480
[avilib] A: 44100 Hz, format=0x01, bits=16, channels=1, bitrate=705 kbps,
[avilib] 254 chunks, 22364580 bytes, CBR
[tcprobe] summary for MVI_2282.avi, (*) = not default, 0 = not detected
import frame size: -g 640x480 [720x576] (*)
frame rate: -f 30.000 [25.000] frc=0 (*)
audio track: -a 0 [0] -e 44100,16,1 [48000,16,2] -n 0x1 [0x2000] (*)
bitrate=705 kbps
length: 7607 frames, frame_time=33 msec, duration=0:04:13.564

Transcode to Xvid -
transcode -i MVI_2282.avi -y xvid4 -o MVI_2282.xvid

Output file -
[user@aspireone ~]$ tcprobe -i MVI_2282.xvid
[tcprobe] RIFF data, AVI video
[avilib] V: 29.970 fps, codec=XVID, frames=7606, width=640, height=480
[avilib] A: 44100 Hz, format=0x55, bits=16, channels=1, bitrate=128 kbps,
[avilib] 7606 chunks, 4055761 bytes, CBR
[tcprobe] summary for MVI_2282.xvid, (*) = not default, 0 = not detected
import frame size: -g 640x480 [720x576] (*)
frame rate: -f 29.970 [25.000] frc=4 (*)
audio track: -a 0 [0] -e 44100,16,1 [48000,16,2] -n 0x55 [0x2000] (*)
bitrate=128 kbps
length: 7606 frames, frame_time=33 msec, duration=0:04:13.786

The other benefit -
[user@aspireone ~]$ du -h MVI_2282.*
435M MVI_2282.avi
59M MVI_2282.xvid

Wednesday, December 31, 2008

Converting videos to play on the Sony Ericsson P1i

All the playing around with transcoders for the Creative Zen got me thinking about watching videos on my Sony Ericsson P1i. It has roughly the same size and resolution screen as the Zen, although probably less colours, and a even more limited video player.

First I tried using transcode, but quickly learned that the P1i video player likes 3GP files, which use MPEG4/H.263/H.264 for video, and AMR/AAC for audio. Both of these codecs have license/patent issues, which means they aren't built into your usual rpm files.

I then found this blog post and was inspired to try using ffmpeg. The vanilla rpm on my aspire one didn't include aac/amr, so I gave source building a try.

Install SVN, and checkout the source for ffmpeg
sudo yum install svn
svn checkout svn://svn.mplayerhq.hu/ffmpeg/trunk ffmpeg

Install amr and faac codecs
sudo yum install amrnb amrnb-devel
sudo yum install faac-devel

Configure and make ffmpeg
./configure --enable-libfaac --enable-libamr-nb --enable-nonfree
make

Convert avi file to 3gp
./ffmpeg -i /mnt/nas/somebody.avi -s qcif -vcodec h263 -acodec libfaac -ab 128000 -y somebody.3gp

Copy to phone, and play
cp somebody.3gp /media/PHONE\ CARD/video/

it works!
I found that the player couldn't handle resolutions other than qcif (176x144). More experimentation is required to see what else it can handle.

I've read that H.264 would be worth trying, and perhaps the audio rate I'm using is an overkill. This post also is interesting.

Still, I'm not that sure I actually want to watch video on the phone... so perhaps I'll just end here :)

Happy New Year!

Friday, December 26, 2008

Dependencies and video transcoding

Well it seems that I'd made one of the great Fedora no-nos and enable yum repositories for both livna and freshrpms.

This led to the problems below, whilst trying to install transcode -
ffmpeg-libs-0.4.9-0.42.20071121.lvn8.i386 from installed has depsolving problems
--> Missing Dependency: libx264.so.56 is needed by package ffmpeg-libs-0.4.9-0.42.20071121.lvn8.i386 (installed)
Error: Missing Dependency: libx264.so.56 is needed by package ffmpeg-libs-0.4.9-0.42.20071121.lvn8.i386 (installed)

I found an explanation here -
http://linux.derkeiler.com/Mailing-Lists/Fedora/2008-01/msg04547.html

And resolved it by disabling the livna repo, then -
[user@localhost ~]$ sudo yum erase ffmpeg-libs
This was installed from livna, and then re-install my video utilities from freshrpms -

[user@localhost ~]$ sudo yum install transcode
[user@localhost ~]$ sudo yum install dvdrip

[user@localhost ~]$ sudo yum erase libdvbpsi
[user@localhost ~]$ sudo yum install vlc

I was then able to reencode and resize videos for the Creative Zen as follows -

[user@localhost ~]$ transcode -i /mnt/nas/Music\ Videos/input.mpg -y xvid4 -o test.avi -Z 320x240 -w 768,100
(Transcode takes a plethora of options which probably need tweaking... that I'll try to get back to some time)

Connecting to the Creative Zen requires MTP (Media Transfer Protocol), so -

[user@localhost ~]$ sudo yum install libmtp libmtp-devel libmtp-examples

[user@localhost ~]$ mtp-sendfile test.avi test.avi

And surprisingly enough... it works!