[FFmpeg-devel] NC camera patch
Sat Jan 10 16:10:46 CET 2009
nicolas martin wrote:
>> nicolas martin wrote:
>>>> nicolas martin wrote:
>>>>> Hi all,
>>>>> I finally made some code to read the camera feed sent by NC46** types
>> Just my two cents...
>>> + * NC cameras feed demuxer.
>>> + * Copyright (c) 2008 Nicolas Martin <martinic at iro.umontreal.ca>,
>>> Edouard Auvinet
>>> + *
>>> + * This file is part of FFmpeg.
>>> + *
>>> + * FFmpeg is free software; you can redistribute it and/or
>>> + * modify it under the terms of the GNU Lesser General Public
>>> + * License as published by the Free Software Foundation; either
>>> + * version 2.1 of the License, or (at your option) any later version.
>>> + *
>>> + * FFmpeg is distributed in the hope that it will be useful,
>>> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
>>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
>>> + * Lesser General Public License for more details.
>>> + *
>>> + * You should have received a copy of the GNU Lesser General Public
>>> + * License along with FFmpeg; if not, write to the Free Software
>>> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
>>> 02110-1301 USA
>>> + */
>>> +#include "avformat.h"
>>> +#define NC_VIDEO_FLAG 0xA5010000
>>> +static int nc_probe(AVProbeData *probe_packet)
>>> + return
>> If I understood well the format, the next four bytes should also be
>> NC_VIDEO_FLAG for valid files. So, its better to check also for them to
>> avoid false positives.
> Just the first four bytes should be NC_VIDEO_FLAG, the next one is
> unused and the two following are the size of the next paquet.
Indeed. I should not read code so late ;-) So maybe something like the
following would be more robust:
static int nc_probe(AVProbeData *probe_packet)
if (AV_RL32(probe_packet->buf) != NC_VIDEO_FLAG)
size = AV_RL16(probe_packet->buf + 5);
if (size + 20 > probe_packet->buf_size)
if (AV_RL32(probe_packet->buf+16+size) == NC_VIDEO_FLAG)
Also your code gives the warning
> Seems stream 0 codec frame rate differs from container frame rate: 100.00 (100/1) -> 25.00 (25/1)
Is the frame rate correct? I cannot be seem with your sample (no
More information about the ffmpeg-devel