6

I'm trying to stream my local webcam using FFMPEG. For test purposes, I'm doing this locally and try to open the stream using VLC (3.0.8, Windows 10). This is how I stream from FFMPEG:

ffmpeg -f dshow -i video="Microsoft Camera Front" -preset fast -s 1280x720
       -vcodec libx264 -tune ssim -b 500k -f mpegts udp://127.0.0.1:1234

I can play the stream seamlessly using

ffplay udp://127.0.0.1:1234

However, I cannot get this working using VLC. I click "Open network stream" and tried different formats, like udp://127.0.0.1:1234 or udp://@:127.0.0.1:1234 or udp://@:1234. Using the latter, it manages to open the stream, but it does not show any video. However, from the codec information window, it even seems to detect the correct codec (Codec: H264 - MPEG-4 AVC (part 10) (h264). From the statistics window, I notice that it receives data with a bit rate varing between 40kb/s and 100kb/s, which seems plausible given that I strem with ~560kbit/s.

So it seems to just not show the video. The same happens on another PC with Windows 10. Any ideas what's going wrong? Thank you in advance for any hints!

3
  • Start playback before ffmpeg and check.
    – Gyan
    Commented Mar 23, 2020 at 13:00
  • Same result (unfortunately)..
    – ma0ho
    Commented Mar 23, 2020 at 14:13
  • 3
    If you have found a solution please post it. Commented Mar 21, 2021 at 12:35

2 Answers 2

4

Add a packet size on both server (ffmpeg) and client (vlc) sides;

in ffmpeg:

>ffmpeg -re -i "path/to/my/video.mp4" -vcodec libx264 -f mpegts udp://127.0.0.1:1234?pkt_size=1316

in vlc:

>udp://127.0.0.1:1234?pkt_size=1316
1
  • Is this still valid?
    – kyrlon
    Commented Jul 8 at 19:58
1

in VLC need the symbol "@" to this work

udp://@127.0.0.1:1234?pkt_size=1316

1
  • 2
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Dec 23, 2022 at 2:57

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .