nvh264enc: Adds SPS/PPS only to the 1st keyframe
Describe your issue
nvh264enc encoder (and nvh265enc also, as I know) adds SPS/PPS header only to the first keyframe.
Expected Behavior
I want to play stream from a random point. Not only from the start.
Observed Behavior
VLC output:
[00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS [00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS [00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS [00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS [00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS [00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS [00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS [00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS [00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS [00007fcfb0b6aeb0] h264 packetizer warning: waiting for SPS/PPS
Setup
- Operating System on a local machine: Ubuntu Server 20
- Operating System on a remote machine: Ubuntu Desktop 20
- Device: Computer
- GStreamer Version: 1.20.1
- Command line: gst_nvenc_h264_spts.sh
gst-launch-1.0 -v
alsasrc device=hw:CARD=C4K,DEV=0 ! queue ! opusenc bitrate=128000 ! opusparse ! queue ! mux.
v4l2src device=/dev/video$2 ! queue !
videoscale ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 !
nvh264enc aud=false bitrate=5000 gop-size=5 rc-mode=cbr rc-lookahead=5 i-adapt=true zerolatency=true ! queue ! h264parse !
mpegtsmux alignment=7 name=mux latency=200000 bitrate=6000000 ! udpsink host=$1 port=5054
Steps to reproduce the bug
- open terminal on a local machine
- type
gst_nvenc_h264_spts.sh
and select video device index - type
v4l2-ctl -d /dev/video0 --list-formats-ext
where device index instead of zero (0) - type
arecord -L
and select alsa audio record device - select useful parameters and change the script
- type
gst_nvenc_h264_spts.sh 192.168.1.34 2
where remote machine IP instead of 192.168.1.34 and device index instead of 2 - open terminal on a remote system
- type
vlc -v udp://@:5054
How reproducible is the bug?
Always. If You keep the sequence. If run player first it will see the first keyframe and will play video.