Problem playing recorded video

Hello,

I’m using Jetson Nano with latest available Jetpack and running the 12_camera_v4l2_cuda sample. I added the patches to use the hardware encoder, like indicated on this topic: Using NvVideoEncoder for USB Camera capture frames streaming.

I added a small change to save every encoded frame to a file with .264 extension.

When I try to playback the test.264 using mplayer, I get the following output:

mplayer /tmp/test.264
MPlayer 1.4 (Debian), built with gcc-11 (C) 2000-2019 MPlayer Team
do_connect: could not connect to socket
connect: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /tmp/flavio.264.
libavformat version 58.76.100 (external)
H264-ES file format detected.
FPS not specified in the header or invalid, use the -fps option.
Failed to open VDPAU backend libvdpau_va_gl.so: cannot open shared object file: No such file or directory
[vdpau] Error when calling vdp_device_create_x11: 1
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 58.134.100 (external)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
Load subtitles in /tmp/
Audio: no sound
Starting playback...
[h264 @ 0x73f8c99db380]No start code is found.
[h264 @ 0x73f8c99db380]Error splitting the input into NAL units.
Error while decoding frame!
[h264 @ 0x73f8c99db380]No start code is found.
[h264 @ 0x73f8c99db380]Error splitting the input into NAL units.
Error while decoding frame!
[h264 @ 0x73f8c99db380]No start code is found.
[h264 @ 0x73f8c99db380]Error splitting the input into NAL units.
Error while decoding frame!
[h264 @ 0x73f8c99db380]non-existing PPS 0 referenced
[h264 @ 0x73f8c99db380]decode_slice_header error
[h264 @ 0x73f8c99db380]no frame!
Error while decoding frame!
[h264 @ 0x73f8c99db380]No start code is found.
[h264 @ 0x73f8c99db380]Error splitting the input into NAL units.
Error while decoding frame!
[h264 @ 0x73f8c99db380]No start code is found.
[h264 @ 0x73f8c99db380]Error splitting the input into NAL units.
Error while decoding frame!
[h264 @ 0x73f8c99db380]No start code is found.
[h264 @ 0x73f8c99db380]Error splitting the input into NAL units.
Error while decoding frame!
[h264 @ 0x73f8c99db380]No start code is found.
[h264 @ 0x73f8c99db380]Error splitting the input into NAL units.
Error while decoding frame!
[h264 @ 0x73f8c99db380]No start code is found.

Looking at the error messages, I saw the advice to * add the -fps* option. When I do that, it works.

My final objective is to integrate the capture with a RTSP server, using Live555 library.

I would like to know if is there anything that could be changed on the code to avoid the need for adding the -fps argument on playback.

I have also used the setFrameRate method of NvVideoEncoder, but no change.

Best regards,

Flavio

Hi,
We would suggest run 01_video_encode to try the options and get a valid stream. And then apply the encoding options to your application. From the description, it looks like –insert-vui may be required.

@DaneLLL ,

It worked. I was able to see the framerate information from the encoder on the streaming server.

I was also able to figure out how to add timestamps on the encoded frame looking at the 01_video_encode example.

Best regards,

Flavio

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.