Archive

Archive for the ‘Movies’ Category

Mplayer on Tom Tom

February 8th, 2008 GilesBathgate 5 comments

I am now trying to run Mplayer on Tom Tom so that I can watch videos and drive anyone reading this to drink. I found however that Mplayer requires a lot of system resources that are being used by the Navigation application (ttn) So I needed a way to free up the memory and resources being used by the application. This should be as simple as just killing the application using

killall ttn

But the problem is that the ttn application is responsible for petting the dog. That is to say that there is a WatchDog Timer which resets the device after 15 seconds unless something continuously resets the timer.
All that was needed was a script to reset the timer instead, So here is my solution:

#!/bin/sh
killall ttn &&
while(true) do
echo '\0' > /dev/watchdog
sleep 10
done

The trick is to kill the ttn but also keep the Watchdog from reseting the device. The script also has to be invoked as a background job, so I used an ‘&’ after the command.

./free.sh &
Categories: Computers, Movies, TomTom Tags:

Tricubic interpolation

December 11th, 2007 GilesBathgate No comments

I have been thinking a lot about how to convert between various frame rates. Basic frame rate conversion works by dropping or duplicating frames. For example converting 30fps material to 25fps material will drop one frame in every six. More advanced techniques such as those employed by Motion Perfect or MSU AFRC are able to create new frames based on the existing frames that exist. These frames are more than a simple blend of the existing frames and use motion detection algorithms to resolve an intermediate frame from two source frames.

The approach that I would like to try is to use tricubic interpolation this is similar to the well known bicubic interpolation that is used to scale images in two dimensions. Tricubic interpolation operates in three dimensions x y and t. While there exists a library for calculating interpolated points in three dimensions, I have no clue how to use the library for my purposes because I do not yet fully understand how to compute the numerical derivatives.

Categories: Computers, Movies Tags:

Convert 4:3 to 16:9 Pal

December 3rd, 2007 GilesBathgate No comments

I had some video footage at 4:3 aspect which I wanted to scale and crop to fit a 16:9 wide-screen PAL format. My first attempt was to scale the video to 720×540 (maintaining the 4:3 aspect ratio) and then crop to 720×405 (a 16:9 ratio)

mplayer -vf scale=720:540,crop=720:405 movie.mpg

However PAL has a resolution of 720×576 so I then had to scale the video again

mplayer -vf scale=720:540,crop=720:405,scale=720:576 -aspect 16/9 movie.mpg

What I wanted was to do this in a more simple manner. I realised that I mearly need to scale it to be larger in the first operation, But how much larger? Well since I wanted to crop the same proportion of the image I simply needed to calculate the aspect of the cropped proportion. Which was 540/405 or 4/3 So I actually want my video to be 4/3 taller than its final height. So we want the movie to be 576 × 4/3 = 768

mplayer -vf scale=720:768,crop=720:576 -aspect 16/9 movie.mpg

Scale Diagram

Categories: Computers, Movies Tags:

Streaming Video using netcat?

November 30th, 2007 GilesBathgate No comments

Here is how one can crudely stream video over the network.

On the server run:

nc -l -p 5500 < video.mpg

And on the client run:

nc 192.168.55.8 5500 | mplayer -cache 8192 -
Categories: Computers, Movies Tags:

Loading youtube videos onto my mobile.

November 26th, 2007 GilesBathgate 3 comments

I wanted to view youtube videos on my phone, but unfortunately the mobile youtube site seems to have less content than the full site. So I decided to make my own mobile phone compatible video files and upload it to my phone. First things first I needed to get the flash video file from the youtube URL, which can be done with this handy site. Next i needed to convert the flash video into a .3gp file that is compatible with my mobile phone. This can be done using ffmpeg (I used a windows version of ffmpeg)

I converted the flash video using the following command.

ffmpeg -i movie.flv -s qcif -r 12 -b 30k \
-ar 8000 -ac 1 -ab 12.2k movie.3gp

Finally I copied the files into the video folder on my phone using standard USB Storage Media drivers in windows, which simply present my phone to me as if it were a Hard Drive.

Categories: Computers, Movies Tags:

Make a DVD out of just about any video file.

November 14th, 2007 GilesBathgate No comments

I recently decided to try to transcode an .mp4 (quicktime) movie to burn on to a dvd. Using a windows version of MPlayer and following these instructions I started the transcoding process.

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd:tsaf \
-vf scale=720:432,expand=720:576,harddup -srate 48000 -af \
lavcresample=48000 -lavcopts vcodec=mpeg2video:vrc_buf_size=1835:\
vrc_maxrate=9800:vbitrate=5000:keyint=15:vstrict=0:acodec=ac3:\
abitrate=192:aspect=16/9 -ofps 25 -o movie.mpg movie.mp4

This was not the end of the story however. The next step was to convert the output MPG file info a DVD filesystem. This was done using DVDAuthour fortunately version 0.6.9 comes in precompiled windows binaries. The documentation for DVDAuthour was a little flakey however the easiest way was to create the XML file

<dvdauthor>
     <vmgm />
     <titleset>
         <titles>
             <video format="pal" aspect="16:9" resolution="720x576"/>
             <pgc>
                 <vob file="movie.mpg" />
             </pgc>
         </titles>
     </titleset>
 </dvdauthor>

And then build the dvd filesystem using

dvdauthor -o ./dvd -x dvdauthour.xml

Finally I have to burn the files to disk using the windows version of growisofs (which requires mkisofs) Using the command

growisofs -dvd-compat -Z e: -dvd-video -V "VIDEO_DVD" ./dvd
Categories: Computers, Movies Tags: