[FFmpeg-devel] NC camera patch

nicolas martin elvadrias
Sat Jan 10 01:01:34 CET 2009


> nicolas martin wrote:
>
>> Hi all,
>>
>> I finally made some code to read the camera feed sent by NC46** types
>> cameras.
>>
>> Thanks for reading and sharing your thoughts !
>
> The format looks quite simple and your code quite complicated.
> Maybe I missed some subtlety in the format.
> So let me first describe the format as I understand it:
> Each frame is composed of:
>  - A header (16 bytes)
>    * 4 bytes : a flag (eg: 0x1A5  (big-endian))
>    * 1 byte  : unknown/unused
>    * 2 bytes : data_size (only when flag == 0x1A5)
>    * 9 bytes : unknown/unused
>  - MPEG4 data frame (data_size bytes)
> Please correct me if there's something wrong here.
>
> If my description is right, you could write your frame reader
> function trivially, with something like that:
>
>  flag = get_be32(pb);
>         get_byte(pb);
>  size = get_le16(pb);
>  url_fskip(pb, 9);
>  if (flag != 0x1A5)
>      /* error handling */;
>  av_new_packet(pkt, size)
>  get_buffer(pb, pkt->data, size);
>
> You need some more error checking, etc...
> But basically, this code should be enough.
>
> BTW: you should upload a sample file like described in [1] to allow
> other developers to test your code.
>
Ok I uploaded a sample in nc_camera

> Oh, and your nc_read_header() seems to contain code which is
> totally unrelated to your format (MJPEG, DIRAC, etc...).
> And you don't need to use s->iformat->value if it's hardcoded
> to MPEG4.

I joined the version I modified using your tips.
I still don't know what to put in nc_read_header() by the way
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: patch.txt
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090109/13e5f840/attachment.txt>
-------------- next part --------------



Thanks

Nicolas
>
>
> Aurel
>
> [1] http://ffmpeg.org/bugreports.html
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-devel




More information about the ffmpeg-devel mailing list