Hello monks...

After searching here and CPAN, I'm still deeply ignorant. I'm not sure if what I want to do is even possible, but here goes...

I have a source of continuous streaming video, compressed with a proprietary MPEG4-based codec. I would like to get the packets, write them to a file, and make the file recognizable to Windows Media Player. Getting the packets is easy:
#!/usr/bin/perl use warnings; use strict; use IO::Socket; my $data; open OUT, ">file.avi"; my $local = new IO::Socket::INET->new(LocalPort=>10000, Proto=>'udp'); while(1) { $local->recv($data,1024); print OUT "$data"; }
but the file doesn't play.

Looking at the contents of a legitimate .avi file, I find certain header information and what may be EOF characters.

Is there any convenient way to generate valid Windows .avi header/trailer information for a collection of video packets turned into a file?

Is there anything else I would have to do to my collection of packets to turn it into a legitimate .avi file?

(Or am I completely deluded?)

In reply to Turn network video stream into playable .avi file? by McMahon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.