<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=217.168.73.160</id>
	<title>Maemo Wiki Mirror - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://maemo.octonezd.me/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=217.168.73.160"/>
	<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php/Special:Contributions/217.168.73.160"/>
	<updated>2026-04-22T08:47:43Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://maemo.octonezd.me/index.php?title=Manual_video_encoding&amp;diff=22404</id>
		<title>Manual video encoding</title>
		<link rel="alternate" type="text/html" href="https://maemo.octonezd.me/index.php?title=Manual_video_encoding&amp;diff=22404"/>
		<updated>2008-11-18T04:57:04Z</updated>

		<summary type="html">&lt;p&gt;217.168.73.160: wrap long command lines&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For automatic video conversion tools, see the [[video encoding]] article.&lt;br /&gt;
&lt;br /&gt;
== Mencoder ==&lt;br /&gt;
&lt;br /&gt;
The tool I use to encode video is mencoder that comes with mplayer on Linux. Always start with the cleanest video you can, and make sure it has good A/V sync before you start by watching it on a PC. Make sure the original has a frame rate greater than or equal to the one you are trying to generate. &lt;br /&gt;
&lt;br /&gt;
The recommended way to run mencoder is through tablet-encoder. You can however try running mencoder directly and playing with the options. Be careful about forcing the output frame rate, however. I didn&#039;t get any good result with the below commands. Instead, I got A/V desync and bad effects due do frame rate changes, so I now use some variation of the above shell scripts.&lt;br /&gt;
&lt;br /&gt;
 mencoder infile.avi -oac mp3lame -ovc lavc \&lt;br /&gt;
  -lavcopts vcodec=mpeg4 -vf scale=352:208 -ffourcc DIVX \&lt;br /&gt;
  -ofps 15 -o outfile.avi&lt;br /&gt;
&lt;br /&gt;
This will generate a 15fps 352x208 avi file.&lt;br /&gt;
&lt;br /&gt;
The following mencoder command line will make smaller videos:&lt;br /&gt;
&lt;br /&gt;
 mencoder infile.avi -oac mp3lame -ovc lavc \&lt;br /&gt;
  -lavcopts vcodec=mpeg4:mbd=1:vbitrate=300 -vf scale=352:208 \&lt;br /&gt;
  -ffourcc DIVX -ofps 15 -o outfile.avi&lt;br /&gt;
&lt;br /&gt;
To make even smaller, you can drop down the quality of audio to 64 kbit/s (for 300 kbit video stream, converting audio to 64 kbit versus 128 kbit yields a total save of approx 20%. Notice that for lower bitrate movies percentage is considerably higher):&lt;br /&gt;
&lt;br /&gt;
 mencoder infile.avi -oac mp3lame -lameopts abr:br=64 -ovc lavc \&lt;br /&gt;
  -lavcopts vcodec=mpeg4:mbd=1:vbitrate=300 -vf scale=352:208 \&lt;br /&gt;
  -ffourcc DIVX -ofps 15 -o outfile.avi&lt;br /&gt;
&lt;br /&gt;
The differences are the block detection method (mbd=1) and a capped bitrate see man mencoder for more options&lt;br /&gt;
&lt;br /&gt;
== ffmpeg ==&lt;br /&gt;
&lt;br /&gt;
It is possible to transcode a video with ffmpeg. But the video will have a corrupted fourcc header. This can be corrected with the tool avifix from transcode or by using -vtag DIVX in ffmpeg command line:&lt;br /&gt;
&lt;br /&gt;
 ffmpeg -i infile -vcodec mpeg4 -acodec mp3 -s 176:144 -b 200 -pass 1 outfile.avi&lt;br /&gt;
 ffmpeg -i infile -vcodec mpeg4 -acodec mp3 -s 176:144 -b 200 -pass 2 outfile.avi&lt;br /&gt;
 avifix -i outfile.avi -F &amp;quot;divx&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Or directly (without avifix):&lt;br /&gt;
&lt;br /&gt;
 ffmpeg -i infile -vcodec mpeg4 -acodec mp3 -vtag DIVX -s 176:144 -b 200 -pass 1 outfile.avi&lt;br /&gt;
 ffmpeg -i infile -vcodec mpeg4 -acodec mp3 -vtag DIVX -s 176:144 -b 200 -pass 2 outfile.avi&lt;br /&gt;
&lt;br /&gt;
== transcode ==&lt;br /&gt;
&lt;br /&gt;
I just converted a DVD using transcode using the following command line:&lt;br /&gt;
&lt;br /&gt;
 transcode -i /dev/dvd \&lt;br /&gt;
          -x dvd \&lt;br /&gt;
          -T 1,1-16 \&lt;br /&gt;
          -a 0 &lt;br /&gt;
          -j 48,0,48,0 \&lt;br /&gt;
          -Z 240x160 \&lt;br /&gt;
          -y xvid \&lt;br /&gt;
          -V -w 300 \&lt;br /&gt;
          -N 0x55 \&lt;br /&gt;
          -b 48 \&lt;br /&gt;
          -o output.avi&lt;br /&gt;
&lt;br /&gt;
This transcodes chapters 1 to 16 of title 1. The DVD has 720x576, but uses only 720x480, so I clipped off the remaining 96 black pixels with the -j option. Output size is 240x160. Video bitrate is 300kbps, audio is 48kbps. The &amp;quot;xvid&amp;quot; codec (a symlink to xvid2 on my system) gives very good results with the default settings. Do not use &amp;quot;mpeg4&amp;quot;, it needs too much processor power for decoding which causes loads of artefacts when playing on the Nokia, even if it looks good on a PC.&lt;br /&gt;
&lt;br /&gt;
I used the transcode package with Debian unstable.&lt;br /&gt;
&lt;br /&gt;
afterwards, I fixed the FOURCC with&lt;br /&gt;
&lt;br /&gt;
 avifix -i output.avi -F DIVX&lt;br /&gt;
&lt;br /&gt;
The resulting AVI file has 114 MByte for 45 minutes/25fps. Things can certainly be improved by tuning xvid options using a ./xvid2.cfg, but I didn&#039;t try that yet.&lt;br /&gt;
&lt;br /&gt;
Here is another example, where the DVD has 720x576 fully used for 4:3 content. I chose 256x192 as output size (4x64, 3x64). This time I used the xvid4 codec. Note that you must not use B-frames, the 770/N800 doesn&#039;t seem to be able to handle them. You can turn them off by setting max_bframes=0 in your xvid4.cfg, you can easily do this with the xvid4conf tool. After you did this, the following command line will do the rest:&lt;br /&gt;
&lt;br /&gt;
 transcode -i /dev/dvd \&lt;br /&gt;
          -x dvd \&lt;br /&gt;
          -T 1,-1 \&lt;br /&gt;
          -a 0 &lt;br /&gt;
          -Z 256x192 \&lt;br /&gt;
          -y xvid4 \&lt;br /&gt;
          -V -w 300 \&lt;br /&gt;
          -N 0x55 \&lt;br /&gt;
          -b 48 \&lt;br /&gt;
          -o output.avi&lt;br /&gt;
&lt;br /&gt;
The -T 1,-1 option will convert the whole title 1 (all chapters). You can try a lower video bitrate by adjusting the -w parameter (300kbps in this example). Don&#039;t forget to fix the FOURCC with the avifix command (as above)! The quality is very good, and it works fine with 25fps.&lt;br /&gt;
&lt;br /&gt;
Additional informations regarding transcode and IT 2006 beta :&lt;br /&gt;
&lt;br /&gt;
I suggest using the following command-line :&lt;br /&gt;
&lt;br /&gt;
 transcode -i /dev/dvd \&lt;br /&gt;
          -x dvd \&lt;br /&gt;
          -T 1,-1 \&lt;br /&gt;
          -a 0 &lt;br /&gt;
          -Z 352x208 \&lt;br /&gt;
          --keep_asr \&lt;br /&gt;
          -y ffmpeg \&lt;br /&gt;
          -F mpeg4 \&lt;br /&gt;
          -w 300 \&lt;br /&gt;
          -N 0x55 \&lt;br /&gt;
          -b 48 \&lt;br /&gt;
          -R 1 \&lt;br /&gt;
          -o output.avi&lt;br /&gt;
&lt;br /&gt;
and &lt;br /&gt;
 transcode -i /dev/dvd \&lt;br /&gt;
          -x dvd \&lt;br /&gt;
          -T 1,-1 \&lt;br /&gt;
          -a 0 &lt;br /&gt;
          -Z 352x208 \&lt;br /&gt;
          --keep_asr \&lt;br /&gt;
          -y ffmpeg \&lt;br /&gt;
          -F mpeg4 \&lt;br /&gt;
          -w 300 \&lt;br /&gt;
          -N 0x55 \&lt;br /&gt;
          -b 48 \&lt;br /&gt;
          -R 2 \&lt;br /&gt;
          -o output.avi&lt;br /&gt;
&lt;br /&gt;
using ffmpeg, there is no need to fix FOURCC. -R x is used to do two-pass encoding. --keep_asr will resize source video to fit in the specified target resolution, no need to worry about cropping or adding black borders if source isn&#039;t using the same aspect ratio (DVD often uses 1.77 anamorphic format ), transcode will take care of it. The only choice to do is target resolution : 320x208 or 240x144 for 16:9 source, 352x288 or 176x144 for 4:3 source.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Users]]&lt;/div&gt;</summary>
		<author><name>217.168.73.160</name></author>
	</entry>
</feed>