How to display CCTV camera in dashboard (RTSP)

BTW nice area where you live!!! I'm quite jealous....

The error "decoding for stream 0 failed" doesn't give us much detail, except from the fact that the decoding module fails (which might indicate bad input data).

We have added -rtsp_transport tcp because TCP makes sure that all your network packets arrive, while UDP doesn't retransmit packets that are lost. And when packets get lost, the lost data could e.g. result in various decoding problems.

But from this Stackoverflow discussion it becomes clear that:

  • Your packet loss might increase at higher bitrates. Your network card might be dropping packets, when e.g. ffmpeg takes too long to decode the video. I think you can check (on linux) with the ifconfig command whether there is packet loss?
  • Then they propose to increase the size of the receiver buffer (e.g. ffmpeg recv_buffer_size=2000000), but don't understand that very well since it is an UDP buffer...

You could try to set the log level to "debug" (instead of verbose) to get more information, more specific the extra logging just before or after the error. Think you can also set the log level to "trace" to even show yet more detailed information ...

hi
i pasted your flow and changed with mr rstp adreed but i get error "rc - 2" in decode node
can you help me?

Hi @anto86na,
Welcome to the forum!
Next time please add some more information about what you have tried already, because now it is rather impossible for us to determine the root cause ...

  • Which hardware and operating system are your running on?
  • Have you installed ffmpeg succesfully?
  • Can you access ffmpeg from anywhere on the command line (e.g. check it by ffmpeg -version)?
  • Have you tried to change the loglevel, as describe above (to get more information)
  • ...

Bart

Hi, using it on windows PC I dont have any problem, even using it on a Raspberry with Debian Stretch. Few days ago I tryed this solution with Debian Buster but ffmpeg goes over 115% of CPU usage. Did you experience the same?

What sort of Pi? I would have expected it to be ok on a Pi 4.

It's a Pi 3 B+

Maybe just not enough processor power. What size is the image from the camera? If you can reduce that (many have multiple streams you can choose from) that will dramatically reduce the processor required.

Yes, I did it. What is strange is that the same flow, on Stretch uses 10-15%, on buster over 100%

That doesn't sound right, is it the same hardware?

Hi Colin, yes the hardware is the same, but looking better at the cameras setting they weren't exactly the same. With a little change I manage it. Thanks a lot for the support