Hi,

I would like to restore an exact bit for bit copy of an mpeg2 movie
streamed via multicast MPEG-TS.
I'm using VLC as the multicast server.
The reason for this is that I want to share the received data from a
MPEG-TS with the help of the BitTorrent protocol.
The BitTorrent protocol requires an hash sum to be calculated from the
file size of the file to be shared, and then divides the file into
several pieces. Therefore, the data I need to get out of the MPEG-TS
stream has to be an exact bit for bit copy of the original file,
otherwise the hash sum will differ.

I'm sending the MPEG-TS over UDP (can't change this, it's due to
hardware), so I know I can't predict packet loss and other
disturbances caused by the network transfer.

If it's any help, I'm allowed to prepare the file before I stream it,
i.e. converting it to another codec/container.

I've tried to follow the first part of the dranger tutorial
(http://dranger.com/ffmpeg/tutorial01.html), but instead of saving the
images of the movie to file, I wrote the frames to file.
The code I used for this is:

AVContextFormat * out_format_context;
AVPacket packet;

(Code which copies the codec information from the input stream,
prepares preload, maxdelay,
 allocates out_format_context and more)

av_write_header(out_format_context);
av_init_packet(&packet);

while (av_read_frame(in_format_context, &packet) >= 0)
{
    av_interleaved_write_frame(out_format_context, &packet);
    av_free_packet(&packet);
}

av_write_trailer(out_format_context);

I'm able to playback the saved data in VLC, but it has "glitches" in
the playback.
When I compare the saved file with the original file with hexdump,
they differ a lot.

Does anyone know a solution to this?

If you need any more information, see more of the code or anyting
else, I will gladly provide it.

I'm grateful for any help,
Erik Helin
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user

Reply via email to