[FFmpeg-user] RTSP stream fps 29.97 instead of 30

Jonathan Viney jonathan.viney at gmail.com
Tue Oct 3 02:56:31 EEST 2017


Hi,

I am pulling an RTSP stream from an Axis 4K IP camera. The stream from the
camera is 30fps, but the resulting stream from ffmpeg is 29.97fps. Here is
the command:

ffmpeg -rtsp_transport tcp -i rtsp://10.9.9.1:554/axis-media/media.amp
-loglevel debug

The rtsp log shows a framerate of 30:

a=framerate:30.000000

The full log output is below. Is there a way to force the framerate to 30
fps?

This video undergoes a second pass where it gets re-encoded, so we could
adjust the frame rate there if necessary. But it would be preferable for it
to be right at this step.

Kind Regards,
-Jonathan.


ffmpeg version N-87616-g792b1629a8-static http://johnvansickle.com/ffmpeg/
Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.4.0 (Debian 6.4.0-7) 20170920
  configuration: --enable-gpl --enable-version3 --enable-static
--disable-debug --disable-ffplay --disable-indev=sndio
--disable-outdev=sndio --cc=gcc-6 --enable-fontconfig --enable-frei0r
--enable-gnutls --enable-gray --enable-libfribidi --enable-libass
--enable-libvmaf --enable-libfreetype --enable-libmp3lame
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg
--enable-librubberband --enable-librtmp --enable-libsoxr --enable-libspeex
--enable-libvorbis --enable-libopus --enable-libtheora --enable-libvidstab
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp --enable-libx264
--enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 77.101 / 55. 77.101
  libavcodec     57.106.104 / 57.106.104
  libavformat    57. 82.102 / 57. 82.102
  libavdevice    57.  9.101 / 57.  9.101
  libavfilter     6.106.100 /  6.106.100
  libswscale      4.  7.103 /  4.  7.103
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100
Splitting the commandline.
Reading option '-rtsp_transport' ... matched as AVOption 'rtsp_transport'
with argument 'tcp'.
Reading option '-i' ... matched as input url with argument 'rtsp://
10.9.9.1:554/axis-media/media.amp'.
Reading option '-loglevel' ... matched as option 'loglevel' (set logging
level) with argument 'debug'.
Finished splitting the commandline.
Parsing a group of options: global .
Applying option loglevel (set logging level) with argument debug.
Successfully parsed a group of options.
Parsing a group of options: input url rtsp://
10.9.9.1:554/axis-media/media.amp.
Successfully parsed a group of options.
Opening an input file: rtsp://10.9.9.1:554/axis-media/media.amp.
[tcp @ 0x40d2c00] No default whitelist set
[rtsp @ 0x40d0d80] SDP:
v=0
o=- 8374289283112756277 1 IN IP4 10.9.9.1
s=Session streamed with GStreamer
i=rtsp-server
t=0 0
a=tool:GStreamer
a=type:broadcast
a=range:npt=now-
a=control:rtsp://10.9.9.1:554/axis-media/media.amp
m=video 0 RTP/AVP 96
c=IN IP4 0.0.0.0
b=AS:240000
a=rtpmap:96 H264/90000
a=fmtp:96
packetization-mode=1;profile-level-id=640033;sprop-parameter-sets=Z2QAM6w0yAPABD/8BbgICAoAAAfSAAHUwdDAAGP/gAAMf+Nd5caGAAMf/AAAY/8a7y4b04A=,aO48MA==
a=control:rtsp://10.9.9.1:554/axis-media/media.amp/stream=0
a=framerate:30.000000
a=transform:1.000000,0.000000,0.000000;0.000000,1.000000,0.000000;0.000000,0.000000,1.000000

[rtsp @ 0x40d0d80] video codec set to: h264
[rtsp @ 0x40d0d80] RTP Packetization Mode: 1
[rtsp @ 0x40d0d80] RTP Profile IDC: 64 Profile IOP: 0 Level: 33
[rtsp @ 0x40d0d80] Extradata set to 0x40d2f80 (size: 65)
[rtsp @ 0x40d0d80] setting jitter buffer size to 0
[rtsp @ 0x40d0d80] hello state=0
[h264 @ 0x40d4220] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x40d4220] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x40d4220] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x40d4220] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x40d4220] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x40d4220] Reinit context to 3840x2160, pix_fmt: yuvj420p
[h264 @ 0x40d4220] no picture
[rtsp @ 0x40d0d80] All info found
[rtsp @ 0x40d0d80] rfps: 29.250000 0.019208
[rtsp @ 0x40d0d80] rfps: 29.333333 0.015021
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 29.416667 0.011348
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 29.500000 0.008189
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 29.583333 0.005544
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 29.666667 0.003414
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 29.750000 0.001797
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 29.833333 0.000695
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 29.916667 0.000107
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 30.000000 0.000033
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 60.000000 0.000130
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 120.000000 0.000522
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 240.000000 0.002087
    Last message repeated 1 times
[rtsp @ 0x40d0d80] rfps: 29.970030 0.000000
[rtsp @ 0x40d0d80] rfps: 59.940060 0.000000
Input #0, rtsp, from 'rtsp://10.9.9.1:554/axis-media/media.amp':
  Metadata:
    title           : Session streamed with GStreamer
    comment         : rtsp-server
  Duration: N/A, start: 0.033367, bitrate: N/A
    Stream #0:0, 23, 1/90000: Video: h264 (High), 1 reference frame,
yuvj420p(pc, bt709, progressive, left), 3840x2160 [SAR 1:1 DAR 16:9], 0/1,
29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Successfully opened the file.
At least one output file must be specified


More information about the ffmpeg-user mailing list