This is really an optimization question - I have been able to stream h264 from a raspberry pi 5 to a linux system and capture the streams and save them to .mp4 files.
But I intend to run the video capture and sending on a battery powered Pi Zero 2 W and want to use the least amount of power to maximize battery life and still providing good video quality.
I've explored many different configuration settings but am getting lost in all the options.
This is what I run on the pi:
rpicam-vid -t 30s --framerate 30 --hdr --inline --listen -o tcp://0.0.0.0:5000
I retrieve this video from the more powerful Ubuntu server with:
ffmpeg -r 30 -i tcp://ralph:5000 -vcodec copy video_out103.mp4
It generally works but I receive lots of errors on the server side like this:
[mp4 @ 0x5f9aab5d0800] pts has no valuee= 975.4kbits/s speed=1.19x Last message repeated 15 times [mp4 @ 0x5f9aab5d0800] pts has no valuee=1035.3kbits/s speed=1.19x Last message repeated 15 times [mp4 @ 0x5f9aab5d0800] pts has no valuee=1014.8kbits/s speed=1.18x Last message repeated 9 times [mp4 @ 0x5f9aab5d0800] pts has no valuee=1001.1kbits/s speed=1.17x Last message repeated 7 times [mp4 @ 0x5f9aab5d0800] pts has no value Last message repeated 1 times [out#0/mp4 @ 0x5f9aab5ad5c0] video:3546kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.120360% size= 3550kB time=00:00:27.50 bitrate=1057.5kbits/s speed=1.18x
Any suggestions on how to correct these errors?
Also any suggestions on how to make the video capture side more efficient? Should I use a different codec? (yuv instead of h264?) Would using UDP decrease overhead? Can I improve video quality with the mode or hdr options? What does denoise do?
With all the options available with these tools I think it's unlikely that I have a well thought out approach to capture and streaming. I'm hoping that people who are more familiar with this space might be able to provide some suggestions.
Thank you!
-tom