Video Player

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(Make sure we don't switch tty3 to QVGA as that would affect X)
(how to encode DVD for watching on the neo)
Line 32: Line 32:
 
taken from http://lists.openmoko.org/pipermail/neo1973-hardware/2007-October/000267.html
 
taken from http://lists.openmoko.org/pipermail/neo1973-hardware/2007-October/000267.html
  
To make your videos openmoko compatible use mencoder like this:
+
To make your videos/DVDs neo1973 compatible use mencoder like this:
  mencoder input.avi -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=300 -vf rotate=2,scale=240:320 -oac mp3lame -lameopts br=64:cbr -o output2.avi
+
Find out the -vf cropping parameters with
It will rotate the video, scale it and encode it to mpeg4 with a bitrate of 300kBit/s. Works like a charm.
+
mplayer input.avi -vf cropdetect
 +
let it run a few seconds and insert the given cropping values into this command
 +
  mencoder input.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=300 -vf crop=xx:xx:xx:xx,rotate=2,scale=-2:320 -oac mp3lame -lameopts br=64:cbr -o output2.avi
 +
To encode a DVD first find out the -vf cropping parameters with
 +
mplayer -dvd-device /path/to/dvd dvd:// -vf cropdetect -sb 50000000
 +
let it run a few seconds and insert the given cropping values into this command
 +
mencoder -dvd-device /path/to/dvd dvd:// -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=300 -vf crop=xx:xx:xx:xx,rotate=2,scale=-2:320 -oac mp3lame -lameopts br=64:cbr -o output.avi
 +
This will rotate the video/DVD, scale it and encode it to mpeg4 with a bitrate of 300kBit/s. Works like a charm.
  
 
To avoid console blanking type
 
To avoid console blanking type

Revision as of 15:50, 14 November 2007

Not a proper 'app' page, just an overview of my understanding. --Speedevil 17:39, 16 February 2007 (CET)


Video is problematic.

On the minus side.

  • The CPU is certainly not fast enough to decode 480*640 video.
  • The display is portrait, which means that an additional rotation step is needed for most landscape video, adding to CPU usage.
  • Downloading an arbitrary video, and playing it without transcoding it, then playing it later will not be possible.

However.

On the positive side.

  • The LCD can be switched to a 240*320 stretch mode, which is much less taxing.
  • Re-encoding video to rotate it, and scale to 320*240, and encoding with a low CPU use codec such as MPEG-1 may well make half-screen doubled videos playable at 25fps.
  • If not, then it almost certainly will be possible at 12fps.
  • Playing most very small - postage stamp - videos as are sent by many phones should be possible.
  • 1G of storage should give several hours of mpeg4 video, as the quality can be reduced somewhat without being visible on the screen.

From a conversation with XorA, in the IRC channel.

400kbps mpeg4 works on a 200Mhz neo (without sound) on prerotated 240*320 ffmpeg codec videos, at 25fps, using stock mplayer.

With sound, this drops to 18fps.

There are optimisations for mplayer that look promising to get 25fps with sound.

For switching between QVGA and VGA mode do the following with a compatible kernel:

chvt 4 && echo qvga-normal > /sys/devices/platform/s3c24xx-spi-gpio.1/spi0.0/state && fbset qvga

vice versa:

echo normal > /sys/devices/platform/s3c24xx-spi-gpio.1/spi0.0/state && fbset vga && chvt 3

taken from http://lists.openmoko.org/pipermail/neo1973-hardware/2007-October/000267.html

To make your videos/DVDs neo1973 compatible use mencoder like this: Find out the -vf cropping parameters with

mplayer input.avi -vf cropdetect

let it run a few seconds and insert the given cropping values into this command

mencoder input.avi -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=300 -vf crop=xx:xx:xx:xx,rotate=2,scale=-2:320 -oac mp3lame -lameopts br=64:cbr -o output2.avi

To encode a DVD first find out the -vf cropping parameters with

mplayer -dvd-device /path/to/dvd dvd:// -vf cropdetect -sb 50000000

let it run a few seconds and insert the given cropping values into this command

mencoder -dvd-device /path/to/dvd dvd:// -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=300 -vf crop=xx:xx:xx:xx,rotate=2,scale=-2:320 -oac mp3lame -lameopts br=64:cbr -o output.avi

This will rotate the video/DVD, scale it and encode it to mpeg4 with a bitrate of 300kBit/s. Works like a charm.

To avoid console blanking type

echo -e '\033[9;0]' > /dev/ttyX

where 'X' is your terminal number - for example if you did chvt 4 then /dev/tty4 is your terminal.

Personal tools

Not a proper 'app' page, just an overview of my understanding. --Speedevil 17:39, 16 February 2007 (CET)


Video is problematic.

On the minus side.

  • The CPU is certainly not fast enough to decode 480*640 video.
  • The display is portrait, which means that an additional rotation step is needed for most landscape video, adding to CPU usage.
  • Downloading an arbitrary video, and playing it without transcoding it, then playing it later will not be possible.

However.

On the positive side.

  • The LCD can be switched to a 240*320 stretch mode, which is much less taxing.
  • Re-encoding video to rotate it, and scale to 320*240, and encoding with a low CPU use codec such as MPEG-1 may well make half-screen doubled videos playable at 25fps.
  • If not, then it almost certainly will be possible at 12fps.
  • Playing most very small - postage stamp - videos as are sent by many phones should be possible.
  • 1G of storage should give several hours of mpeg4 video, as the quality can be reduced somewhat without being visible on the screen.

From a conversation with XorA, in the IRC channel.

400kbps mpeg4 works on a 200Mhz neo (without sound) on prerotated 240*320 ffmpeg codec videos, at 25fps, using stock mplayer.

With sound, this drops to 18fps.

There are optimisations for mplayer that look promising to get 25fps with sound.

For switching between QVGA and VGA mode do the following with a compatible kernel:

chvt 4 && echo qvga-normal > /sys/devices/platform/s3c24xx-spi-gpio.1/spi0.0/state && fbset qvga

vice versa:

echo normal > /sys/devices/platform/s3c24xx-spi-gpio.1/spi0.0/state && fbset vga && chvt 3

taken from http://lists.openmoko.org/pipermail/neo1973-hardware/2007-October/000267.html

To make your videos openmoko compatible use mencoder like this:

mencoder input.avi -sws 2 -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=300 -vf rotate=2,scale=240:320 -oac mp3lame -lameopts br=64:cbr -o output2.avi

It will rotate the video, scale it and encode it to mpeg4 with a bitrate of 300kBit/s. Works like a charm.

To avoid console blanking type

echo -e '\033[9;0]' > /dev/ttyX

where 'X' is your terminal number - for example if you did chvt 4 then /dev/tty4 is your terminal.