[FFmpeg-trac] #7178(avformat:new): RTSP framerate reported by camera is ignored

FFmpeg trac at avcodec.org
Tue May 1 20:16:36 EEST 2018


#7178: RTSP framerate reported by camera is ignored
-----------------------------------+--------------------------------------
             Reporter:  RomanVega  |                     Type:  defect
               Status:  new        |                 Priority:  normal
            Component:  avformat   |                  Version:  git-master
             Keywords:             |               Blocked By:
             Blocking:             |  Reproduced by developer:  0
Analyzed by developer:  0          |
-----------------------------------+--------------------------------------
 I'm using ffmpeg to copy from an RTSP stream into a .ts file and it
 incorrectly reports the source fps, then copies this incorrect value into
 the output.

 {{{
 ./ffmpeg -rtsp_transport tcp -use_wallclock_as_timestamps 1 -i
 'rtsp://<user>:<pw>@<ip>/MediaInput/h264' -c:v copy /tmp/output.ts
 ffmpeg version N-90820-gd06b01f Copyright (c) 2000-2018 the FFmpeg
 developers
   built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.9) 20160609
   configuration: --pkg-config-flags=--static --extra-libs='-lpthread -lm'
 --enable-nonfree
   libavutil      56. 15.100 / 56. 15.100
   libavcodec     58. 19.100 / 58. 19.100
   libavformat    58. 13.100 / 58. 13.100
   libavdevice    58.  4.100 / 58.  4.100
   libavfilter     7. 19.100 /  7. 19.100
   libswscale      5.  2.100 /  5.  2.100
   libswresample   3.  2.100 /  3.  2.100
 Input #0, rtsp, from 'rtsp://<user>:<pw>@<ip>/MediaInput/h264':
   Metadata:
     title           : Media Presentation
   Duration: N/A, start: 1525193769.927267, bitrate: N/A
     Stream #0:0: Video: h264 (High), yuv420p(tv, progressive), 640x480
 [SAR 1:1 DAR 4:3], 15 fps, 30 tbr, 90k tbn, 30 tbc
 Output #0, mpegts, to '/tmp/output.ts':
   Metadata:
     title           : Media Presentation
     encoder         : Lavf58.13.100
     Stream #0:0: Video: h264 (High), yuv420p(tv, progressive), 640x480
 [SAR 1:1 DAR 4:3], q=2-31, 15 fps, 30 tbr, 90k tbn, 90k tbc
 Stream mapping:
   Stream #0:0 -> #0:0 (copy)
 Press [q] to stop, [?] for help
 }}}

 This is reading from a Panasonic WV-SFV110 IP camera which I configured
 through its web UI to output at 10fps. I tried other fps too but ffmpeg
 always reports 15fps. Looking at the output file, it does in fact contain
 the correct number of frames each second as configured on the camera --
 confirmed by filming a stopwatch, running the above command, then
 splitting into individual frames with ffmpeg and manually checking.

 Running a Wireshark capture, the camera is sending an SDP packet
 containing '..a=framerate:10..'. I believe this should be handled in some
 way
 [https://github.com/FFmpeg/FFmpeg/blob/d06b01fc2d4f5e031d45f9460d1eea610d23d6c5/libavformat/rtsp.c#L535
 here]. I'd have a stab at implementing it myself but I can't figure out
 where the default 15 comes from or if I'm missing the point entirely.

 I also ran against a Cisco 3050 IP camera and I get the same results.

 FWIW a similar openRTSP command reads the correct framerate from the
 camera and puts it into the output file.

 Using the -r option doesn't seem to help.

--
Ticket URL: <https://trac.ffmpeg.org/ticket/7178>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list