Hikvision -> youtube

Joined
Oct 11, 2017
Messages
1
Reaction score
0
Hello,

i have 8mpx DS-2CD2085FWD-I camera and i want stream 4K video direct from camera to youtube live....
its possible with any special firmware ? Where i can get it? :)
 

toysareforboys

Young grasshopper
Joined
Dec 16, 2017
Messages
45
Reaction score
22
You can do it with a computer (or something like a raspberry pi, etc.).

I use ffmpeg (free) or if you have a REALLY fast computer/video card you can do it with OBS (also free) :)

I don't have a hikvision camera on hand to try but this works for my Cantonk IPDH20H800-4K ip camera!

First, find out the link you can use to open the camera with VLC player, i.e. rtsp://admin:admin@192.168.0.65:554/0

Using this code (Windows 10, ffmpeg 3.4.1 64bit static) to fix choppy 4k streaming to youtube:

Code:
ffmpeg -rtsp_transport tcp -allowed_media_types video -i "rtsp://admin:admin@192.168.0.65:554/0" -c copy -f h264 - | ffmpeg -f h264 -r 30 -i - -f lavfi -i anullsrc -b:a 2k -c:a aac -c:v copy -f flv "rtmp://a.rtmp.youtube.com/live2/YOUR_STREAM_KEY_HERE"
Youtube live: Brooklin Grass Park Live Stream - YouTube (switches to 1080p at night but during the day is 4k)

-Jamie M.
 

OICU2

BIT Beta Team
Joined
Jan 12, 2016
Messages
831
Reaction score
1,366
Location
USofA
How long does your ffmpeg stream last? Will it run for days on end with no issue? Do you use the command line or have some type of scheduler to run it?

You can do it with a computer (or something like a raspberry pi, etc.).

I use ffmpeg (free) or if you have a REALLY fast computer/video card you can do it with OBS (also free) :)

I don't have a hikvision camera on hand to try but this works for my Cantonk IPDH20H800-4K ip camera!

First, find out the link you can use to open the camera with VLC player, i.e. rtsp://admin:admin@192.168.0.65:554/0

Using this code (Windows 10, ffmpeg 3.4.1 64bit static) to fix choppy 4k streaming to youtube:

Code:
ffmpeg -rtsp_transport tcp -allowed_media_types video -i "rtsp://admin:admin@192.168.0.65:554/0" -c copy -f h264 - | ffmpeg -f h264 -r 30 -i - -f lavfi -i anullsrc -b:a 2k -c:a aac -c:v copy -f flv "rtmp://a.rtmp.youtube.com/live2/YOUR_STREAM_KEY_HERE"
Youtube live: Brooklin Grass Park Live Stream - YouTube (switches to 1080p at night but during the day is 4k)

-Jamie M.
 

toysareforboys

Young grasshopper
Joined
Dec 16, 2017
Messages
45
Reaction score
22
How long does your ffmpeg stream last? Will it run for days on end with no issue? Do you use the command line or have some type of scheduler to run it?
It runs for almost exactly 8 hours, then ffmpeg starts to do nothing, the youtube live stream goes down, but it's using up 100% of one of the CPU cores.

To "fix" it I have in task scheduler a task set to run every 7.5 hours: "taskkill /F /IM ffmpeg.exe"

Then for the batch file I use to run ffmpeg:

Code:
@echo off
:start
ffmpeg -rtsp_transport tcp -allowed_media_types video -i "rtsp:/admin:admin@192.168.0.65:554/0" -c copy -f h264 - | ffmpeg -f h264 -r 30 -i - -f lavfi -i anullsrc -b:a 2k -c:a aac -c:v copy -f flv "rtmp:/a.rtmp.youtube.com/live2/xxxxxxx"
goto start
So when taskkill kills ffmpeg it restarts super quick. I don't even see youtube drop a single frame when it restarts, not sure how that's possible though.

-Jamie M.
 
Top