2
I have FFMpeg streaming video via UDP to my desktop. I ran a wireshark analysis, and the data is reaching my desktop, you can see one of the packets below.
However, when I look for a network stream on VLC, It doesn't seem to recognize the stream. My command looks like so: udp://@192.168.2.172:[port]
where 192.168.2.172 is the IP address of my desktop PC, and 192.168.2.160 is the address of the ffmpeg streaming client. It's a simple H264 stream with a blank audio channel, so I'm not sure why VLC doesn't pick it up. I'm using this command to stream: raspivid -o - -t 0 -vf -hf -fps 30 -b 45000000 | ffmpeg -re -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -f h264 -i - -vcodec copy -acodec aac -ab 128k -g 60 -strict experimental -f h264 udp://192.168.2.172:[port]
Here is a breakdown of what exactly it's doing:
raspivid -Take video from raspberry pi camera
-o - -Output to command line
-t 0 -Record indefinitely
-vf -hf -Flip the image twice
-fps 30 -b 45000000 |-Alter the bit rate and pipe the output to the next command.
ffmpeg
-re -Simulate input device
-ar 44100 -create an audio stream...
-ac 2 -with 2 channels...
-acodec pcm_s16le -as a signed 16 bis little endian..
-f s16le -force it to be so
-i /dev/zero -Take the audio from /dev/zero
-f h264 -force the input to be formatted as h264 (ie from raspivid)
-i - -input from the command line
-vcodec copy -copies the h264 codec for minimal processing power needed.
-g 60 -make a keyframe every 60 frames
-strict experimental-adds the audio channel
udp://192.168.2.172:[port] -streams to my desktop PC at port
One thing that I thought could be the culprit is port binding, but checking the port binding via process hacker 2 says that VLC is listening on UDP and UDP8 for [port], shown in the screenshot below.
What are possible causes that VLC will not play a stream, even if the traffic is reaching the pc on the correct port AND vlc is listening on said port?
Update: VLC now recognizes the stream, but does not play anything, staying at 0:00, and not giving me the option to play. The searching for stream indicator, however, is not active.
1got the same problem, if you found the solution, please let me know – Cybex – 2020-01-21T13:52:31.810
1@Cybex sadly, I have found no solution, I ended up using UV4L and a HTTP cam stream. – tuskiomi – 2020-01-23T02:44:11.960
http cam streamer, may I ask the name? – Cybex – 2020-01-23T05:46:41.897
1@Cybex It is called UV4L – tuskiomi – 2020-01-23T05:47:19.270