[vlc-devel] [PATCH]Improved nuv demuxer and new rtjpeg decoder

Gertjan Van Droogenbroeck gertjanvd at gmail.com
Tue Jul 22 16:09:45 CEST 2008


Hello,

Because I did not find a player that supported the MythTV .nuv files
with RTjpeg encoding on Windows, I tried to see what was necessary to
get those files working in VLC.

To be able to play them the nuv demuxer had to be improved with RTjpeg
and seek support and a new RTjpeg decoder was needed. Both those
things should work with the attached patches. I have these patches
running for a couple of days now on Linux and Windows and everything
seems to work fine.

The changes to the nuv demuxer are:
 - aspect ratio is now used
 - only key frames are used for seeking / index table
 - if there is a seektable it is now used (in a seekable stream)
 - GET_LENGTH is set correctly when a seektable is available, if there
isn't a seektable it will make a guess based on the position in the
stream and the stream size
 - seek support improved, it checks if the stream is seekable and it
also checks if the stream is not changing in size (recording)
 - support for rtjpeg decoder

The demuxer was tested on Windows and Linux with a samba share with
recordings from a mythbackend. I have also tested this with MythWeb
with HTTP Direct Download and ASX Stream. If it is detected that the
stream is not seekable (for example the HTTP stream) it will fall back
to the way it worked before and keep fetching new frames until the
position is reached. If you seek to a position before the current
position it will now give a warning.

If a recording is in progress the stream size will change. This will
be detected and then only forward seeking is possible, because
changing the stream pointer on the recorded file failed (at least it
did using the network share).

To decode the RTjpeg files I used RTjpeg.c|h and minilzo.c|h which I
found in the Avidemux SVN. All these files should be GPL licensed. I
also included a README.rtjpeg file from the author of the RTjpeg files
from the MythTV SVN. The code that is not needed for the decoder
(encoding and conversion functions) is now disabled. MMX acceleration
is now an extra option (it is detected in the decoder) and is only
compiled when CAN_COMPILE_MMX is defined.

The rtjpeg decoder and nuv demuxer were tested with some large files
(+10GB), and with a lot of random seek access and during recordings.
Also streaming from MythWeb seems to work fine. Of course lots of
further testing is needed. I also tested these patches with MPEG4
recordings in the nuv format.

The decoder works the same way as the ffmpeg Nuppelvideo decoder. If
the rtjpeg decoder (patch 2) is not available it will use the ffmpeg
decoder. It seems that the ffmpeg decoder does not completely work
with the MythTV recordings. Some blocks are not decoded right. I think
this is a problem with ffmpeg because the rtjpeg decoder (patch 2)
does not have those problems on the same files. The rtjpeg decoder
however uses some static variables in the decoding functions so only
one stream can be decoded at the same time.


Gertjan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Improved-nuv-demuxer.patch
Type: text/x-patch
Size: 21883 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080722/34ad48e9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Add-rtjpeg-decoder.patch.bz2
Type: application/x-bzip2
Size: 34968 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080722/34ad48e9/attachment-0001.bin>


More information about the vlc-devel mailing list