Coder Social home page Coder Social logo

vzakharchenko / rtsp-samsung-tv Goto Github PK

View Code? Open in Web Editor NEW
94.0 7.0 20.0 11.09 MB

Display RTSP streams from IP Cameras on Samsung Smart TV (Tizen TV)

License: Apache License 2.0

HTML 11.32% JavaScript 48.81% CSS 37.09% Dockerfile 1.65% Shell 1.13%
rtsp samsung-tv samsung-smart-tv rtsp-stream rtsp-player tizen tizen-tv tizen-studio remote-control control

rtsp-samsung-tv's Introduction

rtsp-samsung-tv

Description

Display RTSP streams from IP Cameras on Samsung smart TV (Tizen TV)

npm version rtsp-samsung-tv CI rtsp-samsung-tv Docker amd64 arm64 armv7

Features

ipport.png, camera1.png, camera4.png

Server Installation

wget -qO-  https://deb.nodesource.com/setup_14.x | bash
sudo apt-get install ffmpeg
npm i pm2 -g
sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u ${currentUser} --hp ${HOME}
sudo npm i rtsp-samsung-tv -g
sudo pm2 start `npm root -g`/rtsp-samsung-tv/server.js
sudo pm2 save

open http:\\<SERVER_IP>:3004 (Default Login: admin, Default Password: admin) and add a new Camera and click Save

Run Inside docker container

docker run -d --name=rtsp-samsung-tv  -p 3004:3004 -p 9999-10004:9999-10004  --restart=always vassio/rtsp-samsung-tv:latest

Configuration on Host:

echo "{}" >/opt/channels.json
docker run -d --name=rtsp-samsung-tv  -p 3004:3004 -p 9999-10004:9999-10004  -v /opt/channels.json:/opt/config/channels.json --restart=always vassio/rtsp-samsung-tv:latest

Keycloak Protection

echo "{}" >/opt/channels.json
docker run -d --name=rtsp-samsung-tv  -p 3004:3004 -p 9999-10004:9999-10004  -v /opt/channels.json:/opt/config/channels.json -v  `pwd`/keycloak.json:/opt/config/keycloak.json --restart=always vassio/rtsp-samsung-tv:latest

Install Samsung TV Application(Tizen Application)

  1. install java jdk
  2. install Tizen SDK on your PC https://developer.tizen.org/development/tizen-studio/download
  3. download application source git clone https://github.com/vzakharchenko/rtsp-samsung-tv.git
  4. in "Tizen Studio Package manager" install "Tizen SDK Tools"
  5. "Extension SDK" install "extras"
  6. open "Tizen Studio"
  7. File -> Open Project From File System
  8. open rtsp-samsung-tv/CameraDevice
  9. Enable Development mode on your TV
  10. open Device manager
  11. click "Scan device"
  12. set Connection to "On"
  13. right click on your connection and select "Permit install"
  1. in Tizen studio select project and run it on TV.Channel
  2. setup server ip and port on TV.

Admin UI

Url: http:\\<SERVER_IP>:3004

  • Default Login: admin
  • Password: admin

where:

  • File path to config file.
  • Default Transport Default RTSP Transport. Applicable to all cameras
  • Default RTSP FFmpeg parameters Parameters before "-i". Applicable to all cameras
  • Default Encode FFmpeg parameters Parameters before "-i". Applicable to all cameras
ffmpeg <Default RTSP FFmpeg parameters> -i rtsp://stream <Default Encode FFmpeg parameters>

Camera Specific Columns:

  • Status now on TV.
  • Camera channel number.
  • Camera Mode "1 Camera" : one camera on screen, "4 Cameras" : 4 cameras on one screen.
  • rtsp Streams rtsp streams.
  • Transport Camera RTSP Transport.
  • RTSP FFmpeg parameters Parameters before "-i". Applicable to all cameras
  • Encode FFmpeg parameters Parameters after "-i". Applicable to all cameras
ffmpeg <RTSP FFmpeg parameters> -i rtsp://stream <Encode FFmpeg parameters>

add 1 Camera: camera1.png

Add 4 cameras on one screen: camera4.png

delete Camera

Protect Admin UI using Default Authentication

Default user: admin/admin

Protect Admin UI using keycloak SSO (Optional)

  1. download keycloak.json from the keycloak admin ui.
  2. save keycloak.json to ./config/keycloak.json or /opt/config

example of keycloak.json

{
  "realm": "RTSP",
  "auth-server-url": "https://localhost:8090/auth",
  "ssl-required": "external",
  "resource": "testClient",
  "credentials": {
    "secret": "secret"
  },
  "confidential-port": 0
}

Raspberry Pi Hw acceleration on ffmpeg (Raspbian Lite Image)

  1. build ffmpeg with mmal feature
sudo apt-get install libomxil-bellagio-dev
sudo apt-get install libomxil-bellagio-bin
git clone https://github.com/FFmpeg/FFmpeg
cd FFmpeg
git checkout origin/release/3.2
sudo ./configure --arch=armel --target-os=linux --enable-gpl --enable-mmal  --enable-omx --enable-omx-rpi --enable-nonfree
sudo make -j4
sudo make install
  1. increase the GPU memory?
  • sudo raspi-config
  • 7 Advanced Options
  • A3 Memory Split
  • set value 256 or more

Voice Control

1. Press VOICE button
2. Say command

List of commands: "Channel Up" (or the same on your language) "Channel Down" (or the same on your language) "1","2","3","4" ... "999"

Remote Control

Generate Samsung Certificate

  1. Open "Certificate Manager"
  2. Add a new Samsung Certificate
  3. Select DeviceType "TV"
  4. Click Next
  5. Type any name and password
  6. Click Ok
  • ⚠ If the samsung account login page does not appear then please reboot your computer.
  1. Login to Samsung Account
  2. Next
  3. Add Individual DUID
  4. Finish

Individual DUID

On TV select "Settings"->"Support"->"About TV"-> Information About Smart Hub-> Unique Device Id

rtsp-samsung-tv's People

Contributors

dependabot[bot] avatar vzakharchenko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

rtsp-samsung-tv's Issues

On Demand Viewing

Hi,

I don't want rtsp-samsung-tv to make a connection to my rtsp-server until I connect to the rtsp-samsung-tv from the tv client as my rtsp-server is designed for on demand viewing itself.

I am trying to achieve this by making a post request to change the currentChannel which makes the server connect to the camera only when activated.

How do I post using curl (or similar) to /:3004/admin/status/save to change the channel and reload, do I need to include credentials to make this kind of post request?

ffmpeg background cpu usage

Сервак на RPI4 крутится.
Все ок но есть один момент, после выхода из аппа на телеке ffmpeg пропадает на мгновение из top (pid киляется)
но потом рестартится и крутится в холостую нагружая проц, у меня пассивное охлаждение и проц начинает троттлить.
В любом случае висящий ffmpeg не ок. Я не силен в js но lazy старт и корректный стоп мастхэв
На скрине видно глюк
Знімок екрана 2021-10-29 о 18 47 48

Help me this point: Server Host and Server Port

I have install your program on my Samsung tv successful. But I have problem step 15 (setup server ip and port on TV). I don't understand this point. I have try input my ip address my tv,ip pc, ip camera and input port 554 but it still can't process. I hope that you will can help me this point what that I should fill this point?(server host and server port) please help explant me.thanks best and regard.

Low Quality of stream

Hey, thanks for fast fixing a previous issue. I was able to succesfully start the server configure cameras and watch the stream.

But quality of stream was very poor. What params should be added to ffmpeg to improve video quality?

I have HikVision cameras which have 2 streams. The primary stream is 720p h.265 which I tried to restream.

I also didn't find a way to change stream resolution using Admin UI. I saw a parameter in UI but have no luck changing it.

Minor Issues

Many thanks for writing this up!

Just some additional info that people might want:

Server Installation
sudo apt-get install ffmpeg
wget -qO- https://getpm2.com/install.sh | bash

sudo apt install npm
npm install pm2 -g

sudo env PATH=$PATH:/usr/bin pm2 startup systemd -u ${currentUser} --hp ${HOME}
sudo npm i rtsp-samsung-tv -g
sudo pm2 start npm root -g/rtsp-samsung-tv/server.js
sudo pm2 save

Install Samsung TV Application(Tizen Application)
Step 5: Restart PC (found this helped in step 6, Samsung Account in Generate Samsung Certificate as the login window waasn't showing.)

[SUGGESTION] "zero-copy" for better latencies

Hi there, 1st of all thanks for your (voluntary) work !

According to many - if not all - devs, the best approach to reduce latencies is to bypass the video buffering and implement the so-called "zero-copy" 'cause, according to @iEvgeny (the author of best-latencies multi-RTSP player CCTV Viewer):
"the absence of video buffering, which is in every player and introduces a significant delay up to several tens of seconds.
In addition, the new implementation uses the Zero-copy rendering method whenever possible."

...maybe the @alexeyvasilyev's rtsp-client-android lib could be - more easily ? - "ported" on Tizen too...

Last but not least, in order to push the "IP video-streams' players" evolution, we've collected/doxed some interesting projects (yours too) in our HyMPS project (under a dedicated page) and recently opened a discussion about "near-zero latency multiple (IP) video-streams playing" to stimulate the discussion/knowledge-share on the topic between developers/maintainers.
Check it out.

Hope that inspires !

Error when running using Docker

Hey, i'm trying to run the server using command from docs:

docker run -d --name=rtsp-samsung-tv -p 3004:3004 --restart=always vassio/rtsp-samsung-tv:latest

But getting an error inside the container from PM2:

[PM2] PM2 Successfully daemonized
[PM2][ERROR] Script not found: /usr/lib/node_modules/rtsp-samsung-tv/server.js

I've inspected the Dockerfile and found that sources is copied into /opt/rtsp-samsung-tv/ but in entrypoint.sh you are trying to run it from global node_modules folder which is /usr/lib/node_modules in my case.

Am i missing something or there an error in configuration?

tizen samsung television, server and port

could you add some information about step 15 ) setup server ip and port on TV.
should I use an specific IP (from ipcam, from pc server who install the app, from tv's one or just a new ip for emulate a server) should I add something else for making it work? thanks

feel free to delete it, it's not a bug at the end, but if you can contact me ([email protected]) and give me some info about it, will be very appreciated.

homeassistant

Can you tell me how to put your server on home assistant???

Port Error

Hi there, I'm trying to get the server running in a docker but have a port error when creating the container. There is a service running on port 10000 already, "systemd---miniserv.pl". I am running Portainer also. When I remap the ports can access the web page but can't get any streams going. Any ideas how I can get this going? Cheers

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.