[FFmpeg-user] FFMPeg reading from Logitech C920 generating H264 source produces empty output file
William C Bonner
wimbonner at gmail.com
Sun Sep 1 20:15:11 CEST 2013
It still works after I changed the code and rebuilt ffmpeg. I do not notice
any difference between the two methods AVSTREAM_PARSE_HEADERS and
AVSTREAM_PARSE_FULL.
One thing related to FFMPEG pulling the stream directly from /dev/video0
that I'd not seen before is that I'm getting a huge number of errors
similar to:
[rtp @ 0x10cd7d0] Non-monotonous DTS in output stream 0:0; previous:
5149646, current: 5149316; changing to 5149647. This may result in
incorrect timestamps in the output file.
I was getting these errors before applying your patch, so it seems to be
related to the raw video coming from v4l2 or the C920 itself, but I was not
getting these errors in my previous method of having a C++ program pulling
data from the v4l2 interface and feeding it to FFMPEG via a pipe.
On Sun, Sep 1, 2013 at 1:17 AM, Carl Eugen Hoyos <cehoyos at ag.or.at> wrote:
> William C Bonner <wimbonner <at> gmail.com> writes:
>
> > I looked at https://trac.ffmpeg.org/ticket/2882 as
> > well as looking at the patch submitted.
> >
> > I just now manually installed the patch in my local
> > copy of the source and rebuilt ffmpeg. Now things
> > seem to work with or without the -copyinfk flag.
>
> Thank you for testing!
>
> Does it still work (without -copyinkf !) if you use
> AVSTREAM_PARSE_HEADERS instead of AVSTREAM_PARSE_FULL ?
>
> Carl Eugen
>
> diff --git a/libavdevice/v4l2.c b/libavdevice/v4l2.c
> index 33668c1..c7cd519 100644
> --- a/libavdevice/v4l2.c
> +++ b/libavdevice/v4l2.c
> @@ -931,6 +931,9 @@ static int v4l2_read_header(AVFormatContext *s1)
> if (codec_id == AV_CODEC_ID_RAWVIDEO)
> st->codec->codec_tag =
> avcodec_pix_fmt_to_codec_tag(st->codec->pix_fmt);
> + else if (codec_id == AV_CODEC_ID_H264) {
> + st->need_parsing = AVSTREAM_PARSE_HEADERS;
> + }
> if (desired_format == V4L2_PIX_FMT_YVU420)
> st->codec->codec_tag = MKTAG('Y', 'V', '1', '2');
> else if (desired_format == V4L2_PIX_FMT_YVU410)
>
>
> _______________________________________________
> ffmpeg-user mailing list
> ffmpeg-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
More information about the ffmpeg-user
mailing list