You are here

Transfer videos to Nokia N810 and N770

Image

[Information below is for a PC running Linux]

Today, I wanted to transfer some videos to the N810. Those videos were shot with a Sony DCR-SR72, a hard disk-based camcorder.

I try first with a short sequence. Transferring it from the PC to the N810 is easy: simply use the provided USB cable. Playing it is another matter: the N810 multimedia player issues a warning message, telling that the sequence uses an unsupported codec.

To know how the video is encoded, I run mplayer against the file. Result : MPEG2 for the video. According to its specifications, the N810 can display 3GP, AVI, WMV, MP4, H263, H.264, MPEG-1, MPEG-4, RV.

Now, displaying properties of one of the videos delivered on the N810 memory card, I get :

AVI file format detected.
[aviheader] Video stream found, -vid 0
[aviheader] Audio stream found, -aid 1 VIDEO: [divx] 400x240 24bpp 25.000 fps 699.6 kbps (85.4 kbyte/s)

Thus, an ffmpeg command that generates a video file that can be read by the N810 is :

ffmpeg -i <inputFilename>.MPG -s 400x240 -r 24 -b 699600 <outputFilename>.mp4  

And to convert all my video files to the N810 format, I use the following script:

#!/usr/bin/env bash 
# Get all files. The * is important, to get the dir spec.
for fileName in $( ls -rt /* )
do
# Some info about our progression.
echo $fileName
# Remember directory spec.
dirNameIn=`dirname $fileName`
# Get file name.
fileNameIn=`basename $fileName`
# Build target file name.
fileNameOut='/'$fileNameIn.mp4
# Resize file.
ffmpeg -i $fileName -s 400x240 -r 24 -b 699600 $fileNameOut
done

The size of each output file is about 10 times less than the size of the original video file.

To preserve aspect ratio, it may be necessary to add padding pixels. Get the size of the source movie with the command:

ffmpeg -i <inputFilename>

And, if necessary, add top, bottom, left or right padding pixels, with the options

-padtop <pixels>
-padbottom <pixels>
-padleft <pixels>
-padright <pixels>

For quicktime videos, I simply used the following command:

ffmpeg -i <inputFileName>.mov -target pal-vcd  <outputFileName>.avi

(image size was already acceptable, for the N810).

23-Apr-2010 - update: converting CCTV4 stream

After a few tests, I found the following ffmpeg configuration, to convert CCTV4 streaming videos available at mms://cctv-live-cctv1.wm.llnwd.net/cctv_live_cctv4:

ffmpeg -i <inputFileName>.wmv -s 400x320 -r 24 -b 699600 <outputFileName>.avi

The stream itself is recorded using mplayer:

mplayer http_proxy://<proxyAddress>:<proxyPort>/mms://cctv-live-cctv1.wm.llnwd.net/cctv_live_cctv4 

CCTV4 video stream is in 480x384.

02-Oct-2010 - update: converting DVD / video DVD

When the DVD contains several VOB files:

  • concatenate them: cat file1.vob file2.vob > fileToConvert.vob

Then, with resulting VOB file:

  • using avidemux, open the vob file. Avidemux indexes it
  • select desired part of the video
  • set Video to MPEG-4 ASP (avcodec), with following configuration:
    • encoding mode: two pass - average bitrate
    • average bitrate: 1000 kb/s
  • add a video filter:
    • Transformation / Resize, set to 400 x 240
  • set Audio to MP3 (lame)
  • set Format to AVI
  • then, save video (File / Save / Save video)

Often, audio is out of synch with video. Reason is not clear yet for me. It seems that following method works, to put audio back into synch:

  • using Audio / Main track menu, display shift value
  • use it for Shift field, in main window (after having negated it)

 


 

I offered my Nokia 770 to my youngest child. And I promised him to transfer some of his preferred TV programs, recorded on a DVD, to the tablet. So, let's do it. Firstly, the properties of one the Nokia 770 preloaded videos are:

VIDEO:  [DIVX]  352x208  24bpp  15.000 fps  389.5 kbps (47.5 kbyte/s) Clip info:  Software: MEncoder dev-CVS-050626-17:02-3.4.2 

Given the clip info, I install mencoder. And try the following command:

mencoder VR_MOVIE.VRO -ovc lavc -lavcopts
vcodec=mpeg4:acodec=mp3:vbitrate=390:abitrate=41 -ffourcc divx
-vf scale=352:208:1 -o movie.avi -oac mp3lame

VR_MOVIE.VRO being the video to be converted, and movie.avi being the converted video. That works!

The TV show being in fact the concatenation of three different shows, I then use AviDemux to generate three files. Parameters: copy for video, copy for audio, and AVI for format.

To optimize the output video (size, quality...), the Gentoo MEncoder Introduction Guide is a good starting point...

When the video is available as several VOB files, simply concatenate those files: cat file1.vob file2.vob file3.vob > outputFile.vob