[vlc-devel] Play HTTP Live Streaming with VLC Player.

Hongyi Zhao hongyi.zhao at gmail.com
Wed Feb 3 14:40:59 UTC 2021


Hi,

On Ubuntu 20.04,I build the docker image based my project located at
<https://github.com/hongyi-zhao/docker-nginx-rtmp>. I then tried
streaming the camera using HLS, as described below.


Publish the stream:

$ docker run -it -p 1935:1935 -p 8000:80 --rm nginx-rtmp
$ ffmpeg -f pulse -i default -f v4l2 -r 30 -s 1920x1080 -i /dev/video0
-c:v libx264 -preset veryfast -b:v 3000k -maxrate 3000k -bufsize 3000k
-vf "scale=1280:-1,format=yuv420p" -g 60 -c:a aac -b:a 128k -ar 44100
-force_key_frames "expr:gte(t,n_forced*4)"  -f flv
"rtmp://localhost:1935/stream/surveillance"

As for watching the stream, I tried ffplay and vlc, and the former can
successfully play the stream, but the latter failed. The used commands
are shown below:

$ ffplay http://localhost:8000/live/surveillance.m3u8
$ cvlc http://localhost:8000/live/surveillance.m3u8
VLC media player 3.0.9.2 Vetinari (revision 3.0.9.2-0-gd4c1aefe4d)
[000056468a0b0e80] dummy interface: using the dummy interface module...

The vlc stuck there for ever.

Any hints for solving the problem?
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao at gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China


More information about the vlc-devel mailing list