Cannot play video stream from FFMPEG to VLC

5,669

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
Share:
5,669

Related videos on Youtube

ma0ho
Author by

ma0ho

Updated on September 18, 2022

Comments

  • ma0ho
    ma0ho over 1 year

    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!

    • Gyan
      Gyan about 4 years
      Start playback before ffmpeg and check.
    • ma0ho
      ma0ho about 4 years
      Same result (unfortunately)..
    • Fadi Abu Raid
      Fadi Abu Raid about 3 years
      If you have found a solution please post it.