All Projects → carpediem-av → rtsp2html5

carpediem-av / rtsp2html5

Licence: other
A small and simple PHP-script to convert RTSP-stream from IP-cameras to HTML5-video (with switch to MJPEG on failure)

Programming Languages

PHP
23972 projects - #3 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to rtsp2html5

Live Stream Face Detection
Live Streaming and Face Detection with Flask in Browser
Stars: ✭ 47 (+213.33%)
Mutual labels:  rtsp, live-streaming, video-streaming
Rtsp Stream
Out of box solution for RTSP - HLS live stream transcoding. Makes RTSP easy to play in browsers.
Stars: ✭ 349 (+2226.67%)
Mutual labels:  rtsp, live-streaming, video-streaming
WebRTC
Home Assistant custom component for viewing IP cameras RTSP stream in real time using WebRTC and MSE technology
Stars: ✭ 538 (+3486.67%)
Mutual labels:  rtsp, ip-camera
Jpegrtspcamera
Sample RTSP server streaming MJPEG video from PC camera
Stars: ✭ 25 (+66.67%)
Mutual labels:  rtsp, video-streaming
Jmuxer
jMuxer - a simple javascript mp4 muxer that works in both browser and node environment.
Stars: ✭ 222 (+1380%)
Mutual labels:  rtsp, video-streaming
Srs
SRS is a simple, high efficiency and realtime video server, supports RTMP, WebRTC, HLS, HTTP-FLV, SRT and GB28181.
Stars: ✭ 16,734 (+111460%)
Mutual labels:  live-streaming, video-streaming
Shaka Player Embedded
Shaka Player in a C++ Framework
Stars: ✭ 153 (+920%)
Mutual labels:  live-streaming, video-streaming
Media Stream Library Js
JavaScript library to handle media streams on the command line (Node.js) and in the browser.
Stars: ✭ 192 (+1180%)
Mutual labels:  rtsp, video-streaming
Fluid Player
Fluid Player - an open source VAST compliant HTML5 video player
Stars: ✭ 359 (+2293.33%)
Mutual labels:  html5-video, video-streaming
bigscreen-player
Simplified media playback for bigscreen devices
Stars: ✭ 62 (+313.33%)
Mutual labels:  live-streaming, video-streaming
vscode-extension
Link your code and commits to a video recording and explain your code with video.
Stars: ✭ 67 (+346.67%)
Mutual labels:  live-streaming, video-streaming
streamZ
A simple video streaming application made with Dart, JavaScript, HTML, CSS & ❤️
Stars: ✭ 28 (+86.67%)
Mutual labels:  html5-video, video-streaming
Rx Player
DASH/Smooth HTML5 Video Player
Stars: ✭ 600 (+3900%)
Mutual labels:  live-streaming, video-streaming
Shaka Player
JavaScript player library / DASH & HLS client / MSE-EME player
Stars: ✭ 5,386 (+35806.67%)
Mutual labels:  live-streaming, video-streaming
Vidgear
A High-performance cross-platform Video Processing Python framework powerpacked with unique trailblazing features 🔥
Stars: ✭ 2,048 (+13553.33%)
Mutual labels:  live-streaming, video-streaming
react-native-vlc-media-player
React native media player for video streaming and playing. Supports RTSP, RTMP and other protocols supported by VLC player
Stars: ✭ 221 (+1373.33%)
Mutual labels:  rtsp, video-streaming
camera-live-streaming
Camera Live Streaming with Flask and Open-CV
Stars: ✭ 69 (+360%)
Mutual labels:  rtsp, live-streaming
rrtsp client
Rust high level RTSP client
Stars: ✭ 12 (-20%)
Mutual labels:  rtsp, ip-camera
retina
High-level RTSP multimedia streaming library, in Rust
Stars: ✭ 80 (+433.33%)
Mutual labels:  rtsp, ip-camera
opentok-react-native
React Native live video streaming demo app using Open-Tok
Stars: ✭ 36 (+140%)
Mutual labels:  video-streaming

rtsp2html5

A small and simple PHP-script to convert RTSP-stream from IP-cameras to HTML5-video (with switch to MJPEG on failure) This project uses library "ifvisible.js", developed by Serkan Yerşen, MIT license.

Installation and usage:

  1. Make new instance of Linux server (for example Debian) or use existing.
  2. Install Apache, PHP 7.0+ and FFMpeg.
  3. Get an SSL certificate for your server and install it (optional but highly recommended).
  4. Сopy files of my script to root www directory of Apache.
  5. Open "camera.php" in text editor and specify your security key (minimum 12 random chars; A-Z, a-z and 0-9 are allowed) in the "$key" variable. Specify in the "$redirectToIfBackground" variable where to redirect from the background tabs (i.e. url).
  6. Generate links using the "linkgen_en.html" tool (open it in a browser). Place links on the pages of your broadcasting site.

RTSP links can be found in the camera documentation. You can also do this through the third-party utility named "Onvif Device Manager". If your browser cannot play the video, then disable H.265 and H.264+ in the camera settings. Browsers only support H.264 (January 2022).


Установка и использование скрипта:

  1. Берете сервер, например, с Debian, ставите Apache+PHP7 и FFMpeg;
  2. Получаете SSL-сертификат для своего сервера (необязательно, но строго рекомендуется);
  3. Копируете файлы моего скрипта в любую доступную по www папку;
  4. Открываете camera.php и указываете свой ключ (придумываете; допустима латиница и цифры) в переменной $key, а в $redirectToIfBackground указываете, куда переадресовывать из фоновых вкладок;
  5. Создаете ссылки на камеры с помощью прилагаемого файла "linkgen_ru.html" (открыв его в браузере). Размещаете полученные ссылки на страницах своего сайта трансляций.

Если есть затруднения с поиском RTSP-ссылок на вашу камеру, то можно использовать программу Onvif Device Manager. Она покажет ссылку снизу под видео, которое открывается кликом по пункту меню «Живое видео».

Если вы планируете сайт с камерами сделать на MODX Revolution, то используйте приложенный плагин, упрощающий работу по размещению ссылок. Инструкция по установке плагинов есть в документации к этой CMS. После установки плагина откройте его на редактирование и в начале файла подставьте свои значения в $key и $camera_server_url (иными словами — замените текст, выделенный заглавными буквами, своим ключом и адресом сервера).

После его установки, в тексте ваших страниц ссылки на камеры теперь можно указывать в таком виде:

{camera*НАЗВАНИЕ*RTSP-ССЫЛКА*RTSP-ССЫЛКА НА ВТОРОЙ ПОТОК}

Название и RTSP-ссылки подставляете свои. Если нет ссылки на второй поток, то дублируете ссылку основного потока.

По поводу безопасности. В принципе, если сервис будет непубличным, для чего и задумывался скрипт, то всё нормально. В противном случае, любой кто «подсмотрит» ссылку на camera.php, может вытащить исходную RTSP-ссылку, пароль на камеру (он прописывается в RTSP-ссылке), и сам секретный ключ $key. Пароль на камеру дает доступ к её админке, если вы пренебрегли созданием отдельной учетной записи на этой камере специально для RTSP. Секретный же ключ даст возможность через ваш сервер «крутить» сторонние камеры. Поэтому, данный скрипт только для частного доступа. Я мог бы реализовать шифрование параметров, но… при размещении в публичный доступ ввиду отсутствия кэширования видеоряда интернет-канал быстро «забьется», как и ресурсы на сервере.

Внимание - убедитесь, что в камере выставлен формат кодирования видео H.264! Более новый H.265 не поддерживается большинством браузеров (на январь 2022 года). Также следует выключить опцию H.264+ в настройках камеры.

Подробности в статье https://habr.com/ru/post/545888/

А вот здесь есть еще классные программы моего авторства: http://carpediem.0fees.us/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].