[mythtv] [PATCH] Add streaming output to transcoder
ou401cru02 at sneakemail.com
Fri Aug 15 08:51:42 EDT 2003
The following patch adds the ability to write raw audio/video to sperate
fifos. These can then be used by programs like mencoder to build new
streams without understanding the nuv format. It also allows for
processing the cutlists before reencoding, and should produce better
output than any other current solution.
The patch adds a 'FIFOWriter' class, which can be used to write to an
arbitrary number of fifos simultaneously. The FIFOWriter class will
detect deadlock in the case if non-symmetric fifo reading (one empty,
another full), and will create more buffers to alleviate the situation.
The spin-loops from the previous prototype have been replaced with cond
variables, which greatly improves performance. There is still the
possibility for run-away buffer creation, and it would be nice to add
throttling in the future.
to use the new feature, add '--fifodir <directory>' to the mythtranscode
command-line. It will create two fifos in that directory (audout and
vidout), and block until they are opened for processing. Once opened,
mythtranscode will dump raw (uncompressed) data frames to the fifos.
CVS mencoder (> 0.91) is able to read these streams using a command like:
mencoder -audiofile <path>/audout -audio-demuxer 20 -rawaudio rate=32000
-rawvideo on:w=640:h=480:fps=29.97 -ovc lavc -oac mp3lame -o out.avi
Make sure to set the width, height, fps, and audio sample rate equal to
the input stream.
Currently, subtitles aren't supported, but that is mostly because I don't
have any nuvs with subtitles, and don't know if mencoder can handle them
in raw format.
This patch is clean, and should be thread safe. All changes are
localized to the transcoder and shouldn't affect anyone unless they
specifically run mythtranscode with these new options.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 14833 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20030815/ba0ee54a/transcode11.bin
More information about the mythtv-dev