Wrong tbr from v4l2src device

Hello,

I’m trying to transfer video from v4l2src(tc358840) using gstreamer, but I got the below message from FFmpeg while I was trying to send 60fps video.

Stream #0:0: Video: h264 (Constrained Baseline) ([7][0][0][0] / 0x0007), yuv420p(progressive), 1280x720, q=2-31, 60 fps, 47 tbr, 1k tbn, 1k tbc

So I tried to checked testvideosrc, and it’s ok like below.

Stream #0:0: Video: h264 (Constrained Baseline) ([7][0][0][0] / 0x0007), yuv420p(progressive), 1280x720, q=2-31, 60 fps, 60 tbr, 1k tbn, 1k tbc

In this case, I cannot get a right video due to the wrong tbr number. I think players seems detecting the frame rate as tbr number, not fps number, so the video I sent is played in wrong speed.

In addition, with 30fps video, I got the same tbr number, 47 tbr. I’m checking this on nano with version 32.3.1.

Hi,
Please provide commands so that we can replicate the 47 tbr and 60 tbr cases. And is the information put in VUI? Would like to know which item is parsed as tbr.

Hi,

The command I used is complicated a bit lik below. I send streams to rtmp from v4l2src using gstreamer.

ffmpeg -fflags nobuffer -i rtmp://dev.tbond.telelian.com/live/4922c3bff6a1 -c copy -f null -

So I share the simple command you can use instead as below. It returns 1000k tbr instead of 47 tbr in the same environment.

ffprobe /dev/video0
[video4linux2,v4l2 @ 0x5576c99ed0] ioctl(VIDIOC_G_PARM): Inappropriate ioctl for device
[video4linux2,v4l2 @ 0x5576c99ed0] Time per frame unknown
[video4linux2,v4l2 @ 0x5576c99ed0] Stream #0: not enough frames to estimate rate; consider increasing probesize
Input #0, video4linux2,v4l2, from ‘/dev/video0’:
Duration: N/A, start: 1603.512420, bitrate: N/A
Stream #0:0: Video: rawvideo (UYVY / 0x59565955), uyvy422, 1920x1080, 1000k tbr, 1000k tbn, 1000k tbc

Would like to know which item is parsed as tbr .

I am not so sure what tbr means, but please refer to the link →

Hi,
We try 01_video_encode and don’t observe the issue. The tbr value is identical to fps:

nvidia@nvidia-desktop:~/jetson_multimedia_api/samples/01_video_encode$ ./video_encode 1080.yuv 1920 1080 H264 out.h264 --insert-vui -fps 19 1
Creating Encoder in blocking mode
Opening in BLOCKING MODE
NvMMLiteOpen : Block : BlockType = 4
===== NVMEDIA: NVENC =====
NvMMLiteBlockCreate : Block : BlockType = 4
875967048
842091865
H264: Profile = 66, Level = 51
Could not read complete frame from input file
File read complete.
Got 0 size buffer in capture
App run was successful
nvidia@nvidia-desktop:~/jetson_multimedia_api/samples/01_video_encode$ ffprobe -i out.h264
ffprobe version 3.4.8-0ubuntu0.2 Copyright (c) 2007-2020 the FFmpeg developers
  built with gcc 7 (Ubuntu/Linaro 7.5.0-3ubuntu1~18.04)
  configuration: --prefix=/usr --extra-version=0ubuntu0.2 --toolchain=hardened --libdir=/usr/lib/aarch64-linux-gnu --incdir=/usr/include/aarch64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
  libavutil      55. 78.100 / 55. 78.100
  libavcodec     57.107.100 / 57.107.100
  libavformat    57. 83.100 / 57. 83.100
  libavdevice    57. 10.100 / 57. 10.100
  libavfilter     6.107.100 /  6.107.100
  libavresample   3.  7.  0 /  3.  7.  0
  libswscale      4.  8.100 /  4.  8.100
  libswresample   2.  9.100 /  2.  9.100
  libpostproc    54.  7.100 / 54.  7.100
Input #0, h264, from 'out.h264':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: h264 (Constrained Baseline), yuv420p(tv, bt470bg/reserved/reserved, progressive), 1920x1080, 19 fps, 19 tbr, 1200k tbn, 38 tbc

We try on JP4.4.1(r32.4.4).