[FFmpeg-user] Troubles with video record

Yuri Moroz crazysiberianscientist at gmail.com
Sun Dec 13 12:40:26 CET 2015


I try to capture video stream from web-cam Logitech c920 to file on
Raspberry Pi.
I do:
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1920,height=1080,pixelformat=1
v4l2-ctl -d /dev/video0 --set-parm=20
sudo ffmpeg -f v4l2 -input_format h264 -i /dev/video0 -c:v copy ./output.mkv

Often, I get some message from ffmpeg:

ffmpeg version N-77184-g3f07f12 Copyright (c) 2000-2015 the FFmpeg
developers
  built with gcc 4.9.2 (Raspbian 4.9.2-10)
  configuration: --arch=armel --target-os=linux --enable-gpl
--enable-libx264 --enable-nonfree
  libavutil      55. 10.100 / 55. 10.100
  libavcodec     57. 17.100 / 57. 17.100
  libavformat    57. 19.100 / 57. 19.100
  libavdevice    57.  0.100 / 57.  0.100
  libavfilter     6. 20.100 /  6. 20.100
  libswscale      4.  0.100 /  4.  0.100
  libswresample   2.  0.101 /  2.  0.101
  libpostproc    54.  0.100 / 54.  0.100
Input #0, video4linux2,v4l2, from '/dev/video0':
  Duration: N/A, start: 5114.530596, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuvj420p(pc), 1280x720
[SAR 1:1 DAR 16:9], -5 kb/s, 30 fps, 30 tbr, 1000k tbn, 60 tbc
File './output.mkv' already exists. Overwrite ? [y/N] y
[matroska @ 0x28371f0] Codec for stream 0 does not use global headers but
container format requires global headers
Output #0, matroska, to './output.mkv':
  Metadata:
    encoder         : Lavf57.19.100
    Stream #0:0: Video: h264 (H264 / 0x34363248), yuvj420p, 1280x720 [SAR
1:1 DAR 16:9], q=2-31, -5 kb/s, 30 fps, 30 tbr, 1k tbn, 1000k tbc
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
Press [q] to stop, [?] for help
[matroska @ 0x28371f0] Non-monotonous DTS in output stream 0:0; previous:
0, current: -1152917; changing to 0. This may result in incorrect
timestamps in the output file.
[matroska @ 0x28371f0] Non-monotonous DTS in output stream 0:0; previous:
0, current: -1152885; changing to 0. This may result in incorrect
timestamps in the output file.
[matroska @ 0x28371f0] Non-monotonous DTS in output stream 0:0; previous:
0, current: -1152853; changing to 0. This may result in incorrect
timestamps in the output file.
[matroska @ 0x28371f0] Non-monotonous DTS in output stream 0:0; previous:
0, current: -1152907; changing to 0. This may result in incorrect
timestamps in the output file.
[matroska @ 0x28371f0] Non-monotonous DTS in output stream 0:0; previous:
0, current: -1152878; changing to 0. This may result in incorrect
timestamps in the output file.

Message "Non-monotonous DTS in output stream.." appear randomly.

If there are too many messages like Non-monotonous DTS in output stream
0:0, then produced video file has bad structure (timestamps of frames are
bad).

How to fix error? : Non-monotonous DTS in output stream 0:0; previous: 0,
current: -1152917; changing to 0. This may result in incorrect timestamps
in the output file.


More information about the ffmpeg-user mailing list