Debugging video jerking problem
Wolfgang Grandegger
wg at grandegger.com
Fri Dec 7 17:25:29 UTC 2018
Hello,
Am 07.12.2018 um 14:43 schrieb Nicolas Dufresne:
>
>
> Le ven. 7 déc. 2018 05 h 11, Wolfgang Grandegger <wg at grandegger.com
> <mailto:wg at grandegger.com>> a écrit :
>
> Hello,
>
> hmm, the long story: My camera records AVCHD video with 1920x1080 pixel
> and 50 frames/sec. Then I convert it to an 50 FPS AVI raw video using:
>
> $ ffmpeg -i input.mts -vcodec rawvideo -y output-50fps.avi
>
> To get the same video running at 60 FPS I do:
>
> $ ffmpeg -i input.mts -filter:v "setpts=0.83333333*PTS" \
> -r 60 -vcodec rawvideo -y output-60fps.avi
>
> I assume that this video uses the same raw frames just with different
> time stamps. What do I miss?
>
>
> Understand that this could also be the threshold your receiving socket
> can carry with its current setting. It cost nothing to try and increase
> it, see buffer-size on udp-sink and sysctl net.core.rmem_max setting of
> your Linux kernel (if Linux is your host OS).
I already doubled both values. It does not help.
I did debug the sink with with "GST_DEBUG=basesink:6". If I look to the
timestamps of the lines:
0:00:03.215045610 basesink gstbasesink.c:2921:gst_base_sink_is_too_late:<vaapisink0> object was scheduled in time
And calculate the time difference to the previous line in ms I get:
16.631028
33.438903
233.507839
16.668671
...
16.941117
33.009663
183.428079
16.470837
This is the jerking I see, I guess. With 50 FPS, it's always 20ms.
What I do also realize at 60 FPS is that not all frames are recorded
but just 42.96 fps:
# ffprobe /tmp/rec0.mp4
encoder : VA-API H264 encoder
Duration: 00:00:43.20, start: 0.000000, bitrate: 33813 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 [SAR 1:1 DAR 16:9], 33809 kb/s, 42.96 fps, 60 tbr, 10k tbn, 20k tbc (default)
Metadata:
creation_time : 2018-12-07T17:18:53.000000Z
handler_name : VideoHandler
[h264 @ 0x62dae0] time_scale/num_units_in_tick invalid or unsupported (0/1)
It looks like there is a resource limit somewhere :(.
Wolfgang.
More information about the gstreamer-devel
mailing list