How do we save h264 udp stream from raspberry pi to raw .h264 file?
Tried saving raspivid directly to raw video and it works. But after streaming to the computer the .h264 doesn't show anything when played with VLC.
Raspberry pi script:
raspivid -t 0 -w 800 -h 600 -fps 16 -g 5 -b 1000000 -vf -o - | gst-launch-1.0 --gst-debug=3 fdsrc ! h264parse ! rtph264pay ! udpsink host=<<IP>> port=5000
On the receiving side:
gst-launch-1.0 -e -v udpsrc port=5000 ! application/x-rtp, clock-rate=90000, encoding-name=H264, payload=96 ! rtpjitterbuffer ! rtph264depay ! filesink location=test.h264
Can this be done?
If you are getting raw h264 (avc format) it might not be playable as a file. You can either force it to be converted to byte-stream which can be saved directly to file or use a container with the avc.
You can also force byte-stream format on the sender: