[vlc-devel] [BOUNTY] Handling on-the-fly aspect/size changes when transcoding

Bjørn Olav Ruud bjorn.ruud at gmail.com
Wed Jun 27 13:46:24 CEST 2007


BACKGROUND

The company I work for has developed an IPTV solution that uses VLC to
transcode from MPEG-2 TS over UDP multicast to MPEG-4 TS over UDP
multicast. Audio is copied directly, and video is transcoded to a 2
Mbit/s bitrate. The source TS (MPEG-2) has the same content as the
original DVB-S TV channel feed. Most of the channels use full D1 PAL
resolution (704x576 or 720x576) and have on the fly changes between
4:3 and 16:9 aspect ratio. Some of them also broadcast segments in a
reduced resolution (544x576).
Our transcoding setup runs on Gentoo Linux (both 32-bit and 64-bit),
while playback is mostly done on Windows.


THE PROBLEM

The MPEG TS streams we receive can change aspect ratio and resolution
on the fly, and VLC does not handle this properly when transcoding is
performed (ordinary playback works as intended). For instance,
transcoding a MPEG-2 video stream in TS to a MPEG-4 ASP video stream
in TS will use the initial size and aspect for the whole transcoded
stream. Transcoding to MPEG-2 yields the same result.
This behaviour has been tested and verified on v0.8.6b and SVN (as of
22.06.2007), both on Windows and Linux.

MPEG-2 video TS samples are available here:

ftp://82.117.42.160/nrk1-169-43-169lowres.ts (72 MB)
ftp://82.117.42.160/nrk1-43-169.ts (102 MB)

The first clip goes from 16:9 to 4:3, and back to 16:9 at reduced
resolution. The second clip goes from 4:3 to 16:9.


FINDINGS

Reproducing the transcoding process with an unmodified ffmpeg gave the
same result:

ffmpeg.exe -i nrk1-169-43-169lowres.ts -f mpegts -vcodec mpeg4 -b
2000K -acodec copy aspect-ffmpeg-test.ts

With the attached ffmpeg-aspect.diff, each frame is checked for a
change in aspect and updated accordingly. Transcoding then works
correctly. VLC and ffmpeg differ in at least two ways which could be
the source of the problem. First, libavcodec could be used
differently, and incomplete data could be sent to the library. Second,
the container muxers are different implementations.
I tried ensuring the pictures sent to the encoder had correct aspect
values, as seen in patches vlc-ffmpeg-encoder.diff and
vlc-libmpeg2.diff. These patches may not be the correct way to deal
with the problem, or something is missing. Anyway, they didn't work as
intended.


REQUIREMENTS

Both provided samples must work flawlessly when transcoding to MPEG-4
video in TS. That is, on the fly aspect and size changes must be
handled properly.


THE BOUNTY

The first to submit a patch that meets the above requirements will be
awarded $1000 USD.
For questions and further details, contact me either through the list,
via private email, or at the email address below.



Regards,

Bjorn Ruud
CTO
Hospital IT

web:  http://hospitality.no/
mail: bjorn at hospitality.no
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ffmpeg-aspect.diff
Type: application/octet-stream
Size: 735 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070627/d81de4dc/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vlc-ffmpeg-encoder.diff
Type: application/octet-stream
Size: 1955 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070627/d81de4dc/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vlc-libmpeg2.diff
Type: application/octet-stream
Size: 665 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20070627/d81de4dc/attachment-0002.obj>
-------------- next part --------------
_______________________________________________
vlc-devel mailing list
vlc-devel at videolan.org
http://mailman.videolan.org/listinfo/vlc-devel


More information about the vlc-devel mailing list