User avatar
HermannSW
Posts: 1507
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Streaming 261Mbps or 464Mbps out over ethernet?

Thu Aug 08, 2019 4:57 pm

I just answered question on hacker news on whether streaming out high framerate Raspberry camera video over 10G ethernet would be possible:
https://news.ycombinator.com/item?id=20645958

Even new Pi4 has only Gigabit ethernet, and Pi3B has Gigabit over USB2.0 which is 300Mbps.
In my answer I calculated the bytes per second for capturing 640xH raw Bayer frames at maximal framerate as 261Mbps for v1 camera.
Now I did the same calculation for v2 camera as 464Mbps.

What is clear is that v2 camera cannot be streamed out over ethernet for Pi3B.

Questions:
Can 261Mbps plus network overhead be streamed out of Pi3B with its 300Mbps?
Can 464Mbps plus network overhead of v2 camera be streamed out over Pi4 Gigabit ethernet?
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

epoch1970
Posts: 3710
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: Streaming 261Mbps or 464Mbps out over ethernet?

Fri Aug 09, 2019 10:34 am

No idea what the network overhead of a camera could be.
Does this help?
https://www.raspberrypi.org/forums/view ... 9&t=245785
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
HermannSW
Posts: 1507
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Streaming 261Mbps or 464Mbps out over ethernet?

Fri Aug 09, 2019 8:07 pm

epoch1970 wrote:
Fri Aug 09, 2019 10:34 am
Does this help?
https://www.raspberrypi.org/forums/view ... 9&t=245785
Yes, even the lower 880Mbps value seems sufficient.
epoch1970 wrote:
Fri Aug 09, 2019 10:34 am
No idea what the network overhead of a camera could be.
There is no overhead needed (besides ethernet/TCP/IP), just the raw frame data.

Somebody with a Pi4 and camera can test with streaming raspividyuv (that is 12bit/pixel instead of 10bit/pixel for raw Bayer data):
https://news.ycombinator.com/item?id=20652784

On Pi4:

Code: Select all

raspividyuv -md 7 -w 640 -h 480 -t 0 -fps 90 -o - | nc someIp somePort
On someIp server:

Code: Select all

nc -l somePort > foobar 
If that works without network bumps, that would be sufficient:
316Mbps stream of data for v1 camera (732Mbps for v2 camera when recording with "-fps 180")
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1507
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Streaming 261Mbps or 464Mbps out over ethernet?

Sat Aug 10, 2019 9:32 pm

I learned that iperf shows that even PI3B+ ethernet can do 318Mbps:
https://news.ycombinator.com/item?id=20658147

I wanted to test raspividyuv traffic between PI3B and laptop.
Unfortunately there is only one ethernet cable in vacation house.

So I measured between PI3B with ethernet cable and PI2B with 300Mbps USB Wifi dongle.
For measurement I had to add "-w 1" to sender netcat command, otherwise the connection would hang endlessly.
I added "-pts tst.pts" to raspividyuv command, and reduced framerate to 75fps in order to go back to 261Mbps.
What I measured was crap, analysis of tst.pts with ptsanalyze showed frameskips all over the place.

Next I tried to run the test locally, and reroute traffic from PI3B to PI3B via default gateway.
It took quite some time to find solution for that here:
https://unix.stackexchange.com/a/128428

Unfortunately the script did not work, I had to replace one of its commands with slightly different and add another command.
I did add determination of ip from passed interface and gw to the scipt local2gw:
https://gist.github.com/Hermann-SW/5641 ... 83b2900cfa

After ssh into PI3B (192.168.87.115) after reboot I do "sudo ./local2gw eth0" and send traffic to 192.168.87.115.
Running ipconfig afterwards shows that all traffic went through eth0, and 0 packets were sent/received on loopback interface.

Because still seeing junk, I reduced traffic to 142Mbps by changing raspividyuv options (-md 1 -fps 6).
Still seeing a lot of framelosses with ptsanalyze.

So I will have to wait for a 2nd ethernet cable to do the measurements between PI3B and something else, both connected via Gigabit ethernet.

I just installed ethtool and it confirms that the router only allows for "Speed: 100Mb/s".

Either I will do the measurements in 9 days when back home, or perhaps somebody else does them before.

P.S:
You can find ptsanalyze in my userland fork tool directory:
https://github.com/Hermann-SW/userland/ ... ptsanalyze
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Return to “Networking and servers”