[mythtv] MythTV Recording System Future

Isaac Richards ijr at po.cwru.edu
Sun Jul 20 12:24:47 EDT 2003


On Sunday 20 July 2003 10:12 am, Torbjörn Jansson wrote:
> I have started to write a directshow filter, I tried to use a DMO first but
> that was too limited to make it work.
> I can open .nuv files with mpeg4 encoded video and mp3 or uncompressed
> audio.
> Rtjpeg is not implemented yet and it can't seek yet.
> I haven't been able to test hardware mjpeg since I don't have that kind of
> card, maybe someone have a short sample file?
> 
> The filter doesn't decompress the video or audio, that’s done by for
> example the normal windows divx codec and mp3 codec.
> For some reason that I haven't figured out yet directshow doesn't like to
> connect the video output to the divx codec automaticaly.

Might it be easier to just include libavcodec to do the decoding (it's been 
ported to windows for other projects), as then you wouldn't have to worry 
about mjpeg or this?  You're going to have to include the rtjpeg stuff 
anyway, so...

> I have a few questions about mythtv .nuv file format.
>
> Sometimes the audio frames have the keyframe set to '_' what does that
> mean? Is that a continuation of the previous frame?

The keyframe member of the rtframeheader struct?  It's unused for audio.

> I looked at a .nuv file with a hex editor and noticed that the audio
> packets (mp3 audio) have the string "LAME3.93" followed by some 0x55 or
> 0xAA at the end of each packets. It sounds fine with that extra data at the
> end, but why is it there?

This is (I believe) the padding lame produces when run in low-latency mode.  
Basically, it's data that's not decoded to pad out the audio to a complete 
mp3 frame length.

> In directshow I need to create timestamps on all samples (IMediaSample,
> both audio and video) shoud I use the rtframeheader::timecode or count
> frames and use the sync frames? Video frame number woud be something like
> last_videosync_timecode+current_keyframe
>
> I don't think I got the timestampin entierly right because after a few
> minutes on one of my test files the audio and video gets realy out of sync.
> The audio and video is synced fine until that point in the file.

You should use the timestamps that are in the frameheaders, no counting.  The 
audio timestamps need to be adjusted by the 'effdsp' variable (see 
AudioOutputOSS::AddSamples()) for it to sync up properly.  effdsp is 
basically the actual rate the soundcard recorded at for the given time 
period, instead of what you requested -- soundcards aren't very accurate, and 
the sample rate floats around a bit.  The 'timecode' member of the frame 
header contains this information on every audio sync (frametype = S, comptype 
= A) frame.

Isaac


More information about the mythtv-dev mailing list