?

Log in

No account? Create an account
Re-encoding media for the N95 - Nick [entries|archive|friends|userinfo]
Nick

[ website | gagravarr.org ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Re-encoding media for the N95 [Jul. 9th, 2007|10:18 pm]
Nick
Since the Nokia N95 does have a very nice, 320x240 colour screen, I thought it might provide a good opportunity to watch some of my media on the go. For example, I'm currently watching my way through my Roswell High DVD box sets, but progress is limited to when I have 45 minutes to sit in front of the TV, or have my laptop + spare time + the dvds. I figured having the episodes on the N95 could help out here :)

After a bit of googling, a found a really good post on the S60 blog on using ffmpeg to transcode. This appeared to offer everything I was after, so I had a try.

I initially had a bit of faff getting versions of ffmpeg and faad2/faac that played nicely together, but after discovering debian-multimedia.org, all was sorted. I then discovered that my newer ffmpeg took the audio bitrate in bps, not kbps (as with the version in the blog post), which did confuse me at first. With all that worked out, I was then ready to produce half a dozen different versions of one episode to test with.

On the audio front, I found the suggest bitrate of 64kbps AAC to low. With bud earphones, I couldn't hear the difference between the original and the re-encoded with my test file at 96kbps, and at 112kbps for my nice headphones. So, I think I'll probably go with 96kbps (-ab 96000).

On the video front, I found that dropping the framerate did have a surprisingly big effect on watchability, so I opted to leave it un-changed. I couldn't really see the difference between 350kbps and 400kbps on the video when at 320x180 pixels, so I've opted for the lower one for now. YMMV

So, for now, the command I'm using to re-encode with is:
ffmpeg -i <input.mpg> -f mp4 -vcodec mpeg4 -b 350000 -s 320x180 -acodec aac -ar 48000 -ab 96000 -ac 2 <output.mp4>

Update: I've written a wrapper shell script, which uses mplayer to figure out the appropriate resolution. You can download it from here
linkReply

Comments:
From: michaelcole
2007-07-10 02:44 am (UTC)

Perfect..

Been looking for a code like this for my wife she wants some of her movies on her phone, while she is bored she can watch, her programs.

Even if we have two TV's and a TV card in the computer, It is sometimes hard to really get to watch the programs you want.

This will give her the option now.

We also have one in the van But she does not get to use it as my daughter spends her time watching the same DVD's over and over again.

I was wondering if there is any cable to a bigger screen for these phones. I think that would make them the perfect devices.
(Reply) (Thread)
From: gagravarr
2007-07-10 07:07 am (UTC)

Re: Perfect..

My N95 did come with a svideo+audio output cable. It seems to work fairly well for displaying the phone's screen to the TV, except it does seem to be limited to the same resolution as the phone (didn't appear to do a higher resolution on the TV)
(Reply) (Parent) (Thread)
[User Picture]From: nedrichards
2007-07-15 05:06 pm (UTC)

Re: Perfect..

I was under the impression that the phone should export at 640x480 (eg at the resolution it can capture video at) but that could just be plain wrong.
(Reply) (Parent) (Thread)
From: gagravarr
2007-07-20 12:37 pm (UTC)

Re: Perfect..

Finally had a chance to test it.

The menu, and many of the apps are restricted to 320x240 on the TV output. However, the video player app and the picture viewer app are both able to render at 320x240 to the phone and simultaniously render at 640x480 to the TV :)

So, if you are planning to watch on a TV, encode at 640x480. If you're only ever going to watch on the phone, 320x240 should be fine.
(Reply) (Parent) (Thread)
From: (Anonymous)
2007-07-15 07:09 pm (UTC)

Script for encoding...

this may help make thing a little easier. I find the quality really good.
(Reply) (Thread)
From: (Anonymous)
2007-07-15 07:11 pm (UTC)

Script for encoding...

this may help make thing a little easier. I find the quality really good.

n9enc script (www.gatito.co.uk%22)
(Reply) (Thread)