Difference between revisions of "Clean"

From LinuxTVWiki
Jump to: navigation, search
m (Updated link to MEncoder)
(Minor corrections, removal of quotation - better in the MPlayer article really, removed ProjectX and vdrsync sections as they don't contain any useful tutorial information (in my opinion))
Line 1: Line 1:
 
'''Cleaning''' a stream means to remove errors from it.  
 
'''Cleaning''' a stream means to remove errors from it.  
  
Usually the MPEG stream that you recieved over an aerial contains some errors as the reception is not always perfect. Such slightly damaged streams  might crash your video editing software if you want to edit it after (although players like [[gxine]] are quite tolerant). Therefore, cleaning is mostly interesting if you want to [[post-process]]/[[recode]] your recording.  
+
Usually the MPEG stream that you received over an aerial contains some errors as the reception is not always perfect. Such slightly damaged streams  might crash your video editing software if you want to edit it after (although players like [[MPlayer]] and [[gxine]] are quite tolerant). Therefore, cleaning is mostly interesting if you want to [[post-process]]/[[recode]] your recording.  
  
It's not important for just watching films. See the MPlayer documentation:
+
=== MEncoder ===
 
+
''The player is rock solid playing damaged MPEG files (useful for some VCDs), and it plays bad AVI files which are unplayable with the famous windows media player. Even AVI files without index chunk are playable, and you can temporarily rebuild their indexes with the -idx option, or permanently with MEncoder, thus enabling seeking! As you see, stability and quality are the most important things, but the speed is also amazing. There is also a powerful filter system for video and audio manipulation.''
+
 
+
===Cleaning a Stream with MEncoder ===
+
 
A good way of cleaning up a corrupted stream is to run it through [[MEncoder]]. The following will clean up the structure of a program stream:
 
A good way of cleaning up a corrupted stream is to run it through [[MEncoder]]. The following will clean up the structure of a program stream:
  
   $ mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg \
+
   $ mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg -oac copy -ovc copy original_ps.mpeg -o cleaned_ps.mpeg
  -oac copy -ovc copy \
+
  original_ps.mpeg -o cleaned_ps.mpeg
+
  
 
This forces MEncoder to read the file as an MPEG2 stream and uses aggressive error detection and correction, but otherwise just copies the audio and video stream (so no [[re-encoding]] and it's quite fast).  
 
This forces MEncoder to read the file as an MPEG2 stream and uses aggressive error detection and correction, but otherwise just copies the audio and video stream (so no [[re-encoding]] and it's quite fast).  
  
You can also use this method to extract specific pids from a [[transport stream]] and produce a clean [[program stream]], by using the -aid and -vid options to MEncoder to select the audio and video pids repectively:
+
You can also use this method to extract specific PIDs from a [[transport stream]] and produce a clean [[program stream]], by using the -aid and -vid options to MEncoder to select the audio and video PIDs repectively:
 
+
  $ mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg \
+
  -oac copy -ovc copy -aid 600 -vid 601 \
+
  original_ts.mpeg -o cleaned_ps.mpeg
+
 
+
  
=== Project X===
+
  $ mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg -oac copy -ovc copy -aid 600 -vid 601 original_ts.mpeg -o cleaned_ps.mpeg
See [[Project X]].
+
  
  
=== vdrsync ===
+
=== ProjectX ===
Easily to install, divides an MPEG [[PS]] into its audio and video [[ES]]s. It is very fault tolerant. (Well, not too fault tolerant, as it didn't cope with all my recordings.)
+
It is possible to clean up a stream using the GUI (and console) features of [[ProjectX]].

Revision as of 11:20, 22 April 2007

Cleaning a stream means to remove errors from it.

Usually the MPEG stream that you received over an aerial contains some errors as the reception is not always perfect. Such slightly damaged streams might crash your video editing software if you want to edit it after (although players like MPlayer and gxine are quite tolerant). Therefore, cleaning is mostly interesting if you want to post-process/recode your recording.

MEncoder

A good way of cleaning up a corrupted stream is to run it through MEncoder. The following will clean up the structure of a program stream:

 $ mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg -oac copy -ovc copy original_ps.mpeg -o cleaned_ps.mpeg

This forces MEncoder to read the file as an MPEG2 stream and uses aggressive error detection and correction, but otherwise just copies the audio and video stream (so no re-encoding and it's quite fast).

You can also use this method to extract specific PIDs from a transport stream and produce a clean program stream, by using the -aid and -vid options to MEncoder to select the audio and video PIDs repectively:

 $ mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg -oac copy -ovc copy -aid 600 -vid 601 original_ts.mpeg -o cleaned_ps.mpeg


ProjectX

It is possible to clean up a stream using the GUI (and console) features of ProjectX.