Editing Manual video encoding

Warning: You are not logged in. Your IP address will be recorded in this page's edit history.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 1: Line 1:
-
__FORCETOC__
 
For automatic video conversion tools, see the [[video encoding]] article.
For automatic video conversion tools, see the [[video encoding]] article.
== Mencoder ==
== Mencoder ==
-
One tool you can 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.  
+
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.  
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'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.
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'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.
Line 40: Line 39:
== ffmpeg ==
== ffmpeg ==
-
It is possible to transcode a video with ffmpeg. The video will have a corrupted fourcc header, but this can be corrected with the tool avifix from transcode or by using -vtag DIVX in ffmpeg command line:
+
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:
  ffmpeg -i infile -vcodec mpeg4 -acodec mp3 -s 176:144 -b 200 -pass 1 outfile.avi
  ffmpeg -i infile -vcodec mpeg4 -acodec mp3 -s 176:144 -b 200 -pass 1 outfile.avi
Line 65: Line 64:
== transcode ==
== transcode ==
-
You can convert a DVD using transcode using the following command line:
+
I just converted a DVD using transcode using the following command line:
  transcode -i /dev/dvd \
  transcode -i /dev/dvd \
Line 79: Line 78:
           -o output.avi
           -o output.avi
-
This transcodes chapters 1 to 16 of title 1. The DVD has 720x576, but uses only 720x480, so the command clips off the remaining 96 black pixels with the -j option. Output size is 240x160. Video bitrate is 300kbps, audio is 48kbps. The "xvid" codec (a symlink to xvid2 on some systems) gives very good results with the default settings. Do not use "mpeg4", 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.
+
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 "xvid" codec (a symlink to xvid2 on my system) gives very good results with the default settings. Do not use "mpeg4", 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.
-
Fix the FOURCC with
+
I used the transcode package with Debian unstable.
 +
 
 +
afterwards, I fixed the FOURCC with
  avifix -i output.avi -F DIVX
  avifix -i output.avi -F DIVX
-
The resulting AVI file has 114 MByte for 45 minutes/25fps. Things can certainly be improved by tuning xvid options using a ./xvid2.cfg.
+
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't try that yet.
-
Here is another example, where the DVD has 720x576 fully used for 4:3 content. The output size is 256x192 (4x64, 3x64). This example uses the xvid4 codec. Note that you must not use B-frames, the 770/N800 doesn'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:
+
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'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:
  transcode -i /dev/dvd \
  transcode -i /dev/dvd \
Line 100: Line 101:
           -o output.avi
           -o output.avi
-
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't forget to fix the FOURCC with the avifix command (as above). The quality is very good, and it works fine with 25fps.
+
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't forget to fix the FOURCC with the avifix command (as above)! The quality is very good, and it works fine with 25fps.
Additional informations regarding transcode and IT 2006 beta :
Additional informations regarding transcode and IT 2006 beta :

Learn more about Contributing to the wiki.


Please note that all contributions to maemo.org wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see maemo.org wiki:Copyrights for details). Do not submit copyrighted work without permission!


Cancel | Editing help (opens in new window)