Tovid Wiki
(+category)
No edit summary
 
Line 17: Line 17:
 
These commands use [http://www.imagemagick.org ImageMagick] to display a grayscale representation of the difference between IMAGE_1 and IMAGE_2, with lighter areas indicating greater difference. The '-normalize' option is useful for images that are very similar. Use this to get a quick visualization of image quality, in particular the degredation and artifacts that are often introduced during conversion to another image format.
 
These commands use [http://www.imagemagick.org ImageMagick] to display a grayscale representation of the difference between IMAGE_1 and IMAGE_2, with lighter areas indicating greater difference. The '-normalize' option is useful for images that are very similar. Use this to get a quick visualization of image quality, in particular the degredation and artifacts that are often introduced during conversion to another image format.
   
Newer versions of ImageMagick include the 'compare' utility. Try:
+
ImageMagick also includes the 'compare' utility. Try:
   
 
$ compare IMAGE_1 IMAGE_2 x: &
 
$ compare IMAGE_1 IMAGE_2 x: &
Line 31: Line 31:
 
Some video formats (.mkv, for one) may contain subtitles; to make these appear when encoding with tovid, you can use the '-slang en' option to mplayer. There are additional options for controlling the size and placement of subtitles. Here's a command that may work (tweak to meet your needs):
 
Some video formats (.mkv, for one) may contain subtitles; to make these appear when encoding with tovid, you can use the '-slang en' option to mplayer. There are additional options for controlling the size and placement of subtitles. Here's a command that may work (tweak to meet your needs):
   
$ tovid -mplayeropts "-slang en -subpos 80 -subfont-text-scale 20" \
+
$ tovid mpg -mplayeropts "-slang en -subpos 80 -subfont-text-scale 20" \
 
-in ... -out ...
 
-in ... -out ...
   
 
== Run tovid in the background ==
 
== Run tovid in the background ==
   
To run tovid in the background, use a command like this:
+
To run a tovid encoding session in the background, use a command like this:
   
$ tovid -in ... -out ... >/dev/null 2>/dev/null </dev/null &
+
$ tovid mpg -in ... -out ... >/dev/null 2>/dev/null </dev/null &
   
   
Line 49: Line 49:
 
[CROP] Crop area: X: 48..675 Y: 0..479 (-vf '''crop=624:480:50:0''').1 0
 
[CROP] Crop area: X: 48..675 Y: 0..479 (-vf '''crop=624:480:50:0''').1 0
   
Wait until the cropping dimensions stabilize, then close mplayer. Now run tovid, passing those crop values in a ''-vf-pre'' filter:
+
Wait until the cropping dimensions stabilize, then close mplayer. Now run 'tovid mpg', passing those crop values in a ''-vf-pre'' filter:
   
$ tovid -mplayeropts "-vf-pre '''crop=624:480:50:0'''" -in ... -out ...
+
$ tovid mpg -mplayeropts "-vf-pre '''crop=624:480:50:0'''" -in ... -out ...
   
 
You may also need to include the ''-aspect'' option, since cropping will throw off tovid's auto-aspect calculation.
 
You may also need to include the ''-aspect'' option, since cropping will throw off tovid's auto-aspect calculation.
 
 
[[Category:HOWTO]]
 
[[Category:HOWTO]]

Latest revision as of 22:30, 19 August 2011

Listed here are some techniques and command-lines for performing certain tasks related to video encoding or disc authoring. Add short tips below; if you have a more lengthy tip (such as a HOWTO for a more involved task), please create a separate article and link it here.

Video frame dump[]

It's often hard to compare the quality of two videos simply by watching them. The human eye is very forgiving when it comes to video, and it's useful to do a frame-by-frame comparison. To get a dump of every frame in VIDEO, use the following command:

$ mplayer -nosound -vo png VIDEO


Compare two images[]

If you want to see the difference between two images (IMAGE_1 and IMAGE_2), use one of these commands:

$ convert IMAGE_1 IMAGE_2 -compose difference -composite x: &
$ convert IMAGE_1 IMAGE_2 -compose difference -composite -normalize x: &

These commands use ImageMagick to display a grayscale representation of the difference between IMAGE_1 and IMAGE_2, with lighter areas indicating greater difference. The '-normalize' option is useful for images that are very similar. Use this to get a quick visualization of image quality, in particular the degredation and artifacts that are often introduced during conversion to another image format.

ImageMagick also includes the 'compare' utility. Try:

$ compare IMAGE_1 IMAGE_2 x: &

If you like numbers, you might enjoy:

$ compare -metric MAE IMAGE_1 IMAGE_2 null:

Try the metrics MSE, PSE, PSNR, and RMSE for different comparison types. For more on comparing images, see Anthony Thyssen's notes on the subject.

Integrated subtitles[]

Some video formats (.mkv, for one) may contain subtitles; to make these appear when encoding with tovid, you can use the '-slang en' option to mplayer. There are additional options for controlling the size and placement of subtitles. Here's a command that may work (tweak to meet your needs):

$ tovid mpg -mplayeropts "-slang en -subpos 80 -subfont-text-scale 20" \
     -in ... -out ...

Run tovid in the background[]

To run a tovid encoding session in the background, use a command like this:

$ tovid mpg -in ... -out ... >/dev/null 2>/dev/null </dev/null &


Cropping letterbox bars[]

If you have letterbox bars in your source video, you can crop them out while encoding with tovid. The easiest way to find the cropping dimensions is to use mplayer's 'cropdetect' filter:

$ mplayer -vf cropdetect LetterboxedVideo.avi
...
[CROP] Crop area: X: 48..675  Y: 0..479  (-vf crop=624:480:50:0).1 0

Wait until the cropping dimensions stabilize, then close mplayer. Now run 'tovid mpg', passing those crop values in a -vf-pre filter:

$ tovid mpg -mplayeropts "-vf-pre crop=624:480:50:0" -in ... -out ...

You may also need to include the -aspect option, since cropping will throw off tovid's auto-aspect calculation.