Push mp4 video to rtsp, and convert it to http live stream, and display it on the front end

Recently, there is a need to play live streams on the video component of the vue page. I originally wanted to use flv.js, but the flv format is required, so I still use native video to play http live streams.

1. Push local mp4 to rtsp

  1. Download and unzip EasyDarwin, double-click EasyDarwin.exe to run it, and you can see two services are enabled on the console, one is the rtsp server and the other is the http service. Visit http://localhost:10008 to enter the EasyDarwin management page, which will be used later. The other is the rtsp service, the default port is 554.
  2. Download FFmpeg and decompress it, open cmd, enter the bin path of FFmpeg, enter the following command to push the stream
.\ffmpeg -re -stream_loop -1 -i ../videos/1.mp4 -vcodec copy -codec copy -f rtsp rtsp://127.0.0.1:554/video
  1. After starting to push the stream, you can see the push stream on the EasyDarwin management page
    insert image description here

2. Use VLC Media Player to convert rtsp to http stream

insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
insert image description here
Do not close this application after the conversion, http://localhost:8888/123which is the converted live stream address, which can be played directly in VLC or in html <video>tags
insert image description here
insert image description here

Supongo que te gusta

Origin blog.csdn.net/SingDanceRapBall/article/details/131297250
Recomendado
Clasificación