[mythtv] Call for Submission: replace existing "21.1 I'd like to
watch the files without using MythTV / I'd like to convert the
files to some other format."
Geoffrey Hausheer
ou401cru02 at sneakemail.com
Mon Oct 20 18:29:02 EDT 2003
Don't you hate it when you spend a bunch of time writing a nice document,
then your browser crashes?
Anyhow, here it goes again. Hopefully the respective owners of nuvexport
and mkmovie (or some knowledgeable users) will step up and fill out the
respective info.
------------------
21.1 I'd like to watch the files without using MythTV / I'd like to
convert the files to some other format.
MythTV comes with a utility called 'mythtranscode' which can decode nuv
files into raw format for use with other applications. This command-line
utility was not designed to be easily used by the end-user, but instead
to be called by other applications or scripts. Programs like mkmovie and
nuvexport are better suited to the end user. However, since
mythtranscode can be a useful tool, directions on using it follow. There
is also a patch for mplayer/mencoder to read nuv files directly, but it
is not-maintained, and not currently up to date.
mythtransocde writes out raw streams, which means that they do not
contain any container information such as resolution, frame-rate, or
audio sampling rate. In order to process the output, you must supply
this information to the processing utility. Luckily enough,
mythtranscode provides the relevant information on stdout.
There are two modes in which mythtranscode can write out raw streams.
The first has no synchronization. It is assumed that the processing
utility will read audio and video at a constant rate. This method is
useful when a single application will be processing the raw output, such
as mencoder or ffmpeg. the second method assumes that two separate
applications will be processing the audio and video streams
independently, and there is no rate control between them.
Examples using mythtranscode:
First start mythtranscode:
mythtranscode --chanid 1036 --starttime 2003-10-20T15:30:00 --profile
autodetect --fifodir . &
When this program starts, it will create two fifos ('audout' and
'vidout') in the directory specified, and will print out information
about the video stream.
Next start the processing application. The following assume that the
stream is NTSC 640x480 with 32kbps audio.
For encoding using mencoder (NOTE: You must use mencoder 1.0PRE1 or later
for this to work. the older 0.9x WILL NOT WORK!):
mencoder -audiofile audout -audio-demuxer 20 -rawaudio rate=32000
-rawvideo on:w=640:h=480:fps=29.97 -ovc lavc -oac mp3lame -o out.avi
vidout
Using ffmepg:
ffmpeg -f u16le -ar 32000 -ac 2 -i audout -f rawvideo -s 640x480 -r 29.97
-i vidout -vcodec mpeg4 -b 2000 -acodec mp3 -ab 128 out.avi
Or to play directly using mplayer (again 1.0PRE1 or later is needed):
mplayer -audiofile audout -audio-demuxer 20 -rawaudio rate=32000
-rawvideo on:w=640:h=480:fps=29.97 vidout
If you wanted to write the raw data to separate audio and video files for
later processing, the following would work (note the use of --fifosync
for rate-control):
mythtranscode --chanid 1036 --starttime 2003-10-20T15:30:00 --profile
autodetect --fifodir . --fifosync &
cat audout > audio.raw &
cat vidout > video.yuv
This just summarizes mails I've sent several times in the past. I'm not
sure the above really belongs in section 21.1, but it should probably be
in the documentation somewhere, regardless.
.Geoff
More information about the mythtv-dev
mailing list