Clean: Difference between revisions

From LinuxTVWiki
Jump to navigation Jump to search
(created)
 
m (Added category: Software, Technology)
 
(8 intermediate revisions by 4 users not shown)
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).
Usually the MPEG stream received by an antenna contains some errors as 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-processing|post-process]]/[[recode]] your recording.


=== MEncoder ===
===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 MPEG-2 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 \
$ mencoder -forceidx -lavdopts er=4 -vc ffmpeg12 -of mpeg -oac copy -ovc copy -aid 600 -vid 601 original_ts.mpeg -o cleaned_ps.mpeg

-oac copy -ovc copy -aid 600 -vid 601 \
* [http://www.carfax.org.uk/docs/DVB/ Source: "Digital Video Broadcasting – A practical guide"]
original_ts.mpeg -o cleaned_ps.mpeg

=== ProjectX ===
It is possible to clean up a stream using the GUI (and console) features of [[ProjectX]].
[[Category:Software]]
[[Category:Technology]]

Latest revision as of 01:54, 3 May 2009

Cleaning a stream means to remove errors from it.

Usually the MPEG stream received by an antenna contains some errors as 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 MPEG-2 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.