Hello everyone.
I have two different structures. I will explain in below.
First Structure
Application loop:
- Get image from camera.
- Do image processing.
- Write frame into V4L2 device as RGBA format.
GStreamer Pipeline
āv4l2src device=/dev/video1 ! video/x-raw,format=BGRx ! nvvidconv ! nvv4l2h264enc maxperf-enable=1 bitrate=8000000 ! h264parse ! rtph264pay name=pay0 pt=96 config-interval=1 )ā
This pipeline converts BGRA to YUV, then encode h264, then parse, then stream as rtsp.
This structure works without no problem.
Second Structure
Application loop:
- Get image from camera.
- Do image processing.
- Convert BGRA frame to YUV frame. (works correctly)
- Write YUV frame into NVBuffer. (works correctly)
- Encode buffered data as H264 with NvVideoEncoder class. (works correctly)
- Write encoded bytestream into V4L2 device.
GStreamer Pipeline
āv4l2src device=/dev/video1 ! h264parse ! rtph264pay name=pay0 pt=96 config-interval=1 )ā
This pipeline takes bytestream, parse, then stream as rtsp.
This structure does not work. When I try to get rtsp stream with cvlc, I get error about h264 decoding.
In addition, when I write bytestream into a file instead of V4L2 device, I can play h264 file without any problem in vlc.
What may cause this problem? Thank you.