Jump to content

Security Cams Channel Plugin


Cheesegeezer

Recommended Posts

jspanitz
13 minutes ago, Cheesegeezer said:

structure of emby requires this from a metadata provider to populate an image

got it - i am curious how the IPTV provider does it - I have a reolink camera configured there and it is able to pull a static image from the camera. IPTV provider was also not able to pull it from my Dahua cams, which is what drove me to ask.

image.png.a77fd81e26b91be785a482b101aa241a.png

 

Link to comment
Share on other sites

Cheesegeezer
1 hour ago, jspanitz said:

 

I don’t think i said that but understand you deleted the quote and populated it lol 😂 

I’m very new to channel development, i still have lots to learn. My plan will be once the feed is first streamed i can capture a jpeg 1,2 seconds into the feed. My other stance is… if left ugly, it would force the user to put something pretty in there. I guess it uses a metadata provider to sneak a few images to populate. Your camera may require a full stream to generate that authentication and hence why it doesn’t happen.

 I have no idea but just thoughts nipping thru ma wee brain 😉

  • Thanks 1
Link to comment
Share on other sites

datanet

I've had my IP cameras setup in a library that consists of camera_name.strm files.  The files contain the same exact url that is required for your plugin.  Using your plugin, Emby won't stream the cameras.  It seems when comparing the two methods, they present very similarly to ffmpeg.  However, it appears there are some parsing issues with your plugin that keep it from working (at least in my case).

Here is the relevant ffmpeg log info using your plugin which errors out and won't play...

http://192.xxx.xxx.3:8096/emby/videos/4463730/live.m3u8?DeviceId=22dba0664dab168b&MediaSourceId=3bf971bf3751457798eaf78872505fa0&PlaySessionId=7b3e445b385d4b8ca9a504d2b0c7a0b2&api_key=my_secret_api_key&VideoCodec=h264,mpeg2video,hevc,h265&VideoBitrate=1000000000&MaxHeight=2176&CopyTimestamps=true&SegmentContainer=ts&MinSegments=2&AllowInterlacedVideoStreamCopy=True&BreakOnNonKeyFrames=True&SubtitleStreamIndexes=-1&ManifestSubtitles=vtt&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&h264-deinterlace=true&mpeg2video-deinterlace=true&hevc-profile=Main,Main10&aac_latm-audiochannels=8&mp4a_latm-audiochannels=8&ac3-audiochannels=8&eac3-audiochannels=6&aac-audiochannels=8&mp3-audiochannels=8&TranscodeReasons=ContainerNotSupported

{"Protocol":"File","Id":"3bf971bf3751457798eaf78872505fa0","Path":"scrubbed_user:scrubbed_pw@192.xxx.xxx.201:554/cam/realmonitor?channel=1&subtype=0","Type":"Default","Container":"","Size":0,"Name":"realmonitor?channel=1&subtype=0","IsRemote":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":false,"MediaStreams":[],"Formats":[],"RequiredHttpHeaders":{},"ReadAtNativeFramerate":false}


Here is the ffmpeg log for when i play the IP camera using the .strm files...

http://192.xxx.xxx.3:8096/emby/videos/2435246/live.m3u8?DeviceId=22dba0664dab168b&MediaSourceId=e74f4825f00ddaedcfe20e3dad08b1e5&PlaySessionId=fb6c97f633984e91ac5007588bea1acf&api_key=my_secret_api_key&VideoCodec=h264,mpeg2video,hevc,h265&AudioCodec=aac_latm,mp4a_latm,ac3,eac3,aac,mp3&VideoBitrate=999872000&AudioBitrate=128000&MaxHeight=2176&AudioStreamIndex=1&CopyTimestamps=true&SegmentContainer=ts&MinSegments=2&AllowInterlacedVideoStreamCopy=True&BreakOnNonKeyFrames=True&SubtitleStreamIndexes=-1&ManifestSubtitles=vtt&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&h264-deinterlace=true&mpeg2video-deinterlace=true&hevc-profile=Main,Main10&aac_latm-audiochannels=8&mp4a_latm-audiochannels=8&ac3-audiochannels=8&eac3-audiochannels=6&aac-audiochannels=8&mp3-audiochannels=8&TranscodeReasons=ContainerNotSupported

{"Protocol":"Rtsp","Id":"e74f4825f00ddaedcfe20e3dad08b1e5","Path":"rtsp://scrubbed_user:scrubbed_pw@192.xxx.xxx.201:554/cam/realmonitor?channel=1&subtype=0","Type":"Default","Container":"rtsp","Size":0,"Name":"Front Door","IsRemote":true,"SupportsTranscoding":true,"SupportsDirectStream":false,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":false,"MediaStreams":[{"Codec":"h264","ColorTransfer":"bt709","ColorPrimaries":"bt709","ColorSpace":"bt709","TimeBase":"1/90000","VideoRange":"SDR","DisplayTitle":"720p H264","NalLengthSize":"0","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":720,"Width":1280,"AverageFrameRate":15,"RealFrameRate":100,"Profile":"High","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj420p","Level":31,"IsAnamorphic":false,"AttachmentSize":0},{"Codec":"pcm_mulaw","TimeBase":"1/16000","DisplayTitle":"Und PCM_MULAW mono","IsInterlaced":false,"ChannelLayout":"mono","BitRate":128000,"BitDepth":8,"Channels":1,"SampleRate":16000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0}],"Formats":[],"Bitrate":128000,"RequiredHttpHeaders":{},"ReadAtNativeFramerate":false}

I'll let you look through the differences, but the most significant difference that jumps out at me is the omission of the rtsp:// in the url input for ffmpeg.

Link to comment
Share on other sites

Cheesegeezer
1 minute ago, datanet said:

I've had my IP cameras setup in a library that consists of camera_name.strm files.  The files contain the same exact url that is required for your plugin.  Using your plugin, Emby won't stream the cameras.  It seems when comparing the two methods, they present very similarly to ffmpeg.  However, it appears there are some parsing issues with your plugin that keep it from working (at least in my case).

Here is the relevant ffmpeg log info using your plugin which errors out and won't play...

http://192.xxx.xxx.3:8096/emby/videos/4463730/live.m3u8?DeviceId=22dba0664dab168b&MediaSourceId=3bf971bf3751457798eaf78872505fa0&PlaySessionId=7b3e445b385d4b8ca9a504d2b0c7a0b2&api_key=my_secret_api_key&VideoCodec=h264,mpeg2video,hevc,h265&VideoBitrate=1000000000&MaxHeight=2176&CopyTimestamps=true&SegmentContainer=ts&MinSegments=2&AllowInterlacedVideoStreamCopy=True&BreakOnNonKeyFrames=True&SubtitleStreamIndexes=-1&ManifestSubtitles=vtt&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&h264-deinterlace=true&mpeg2video-deinterlace=true&hevc-profile=Main,Main10&aac_latm-audiochannels=8&mp4a_latm-audiochannels=8&ac3-audiochannels=8&eac3-audiochannels=6&aac-audiochannels=8&mp3-audiochannels=8&TranscodeReasons=ContainerNotSupported

{"Protocol":"File","Id":"3bf971bf3751457798eaf78872505fa0","Path":"scrubbed_user:scrubbed_pw@192.xxx.xxx.201:554/cam/realmonitor?channel=1&subtype=0","Type":"Default","Container":"","Size":0,"Name":"realmonitor?channel=1&subtype=0","IsRemote":false,"SupportsTranscoding":true,"SupportsDirectStream":true,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":false,"MediaStreams":[],"Formats":[],"RequiredHttpHeaders":{},"ReadAtNativeFramerate":false}


Here is the ffmpeg log for when i play the IP camera using the .strm files...

http://192.xxx.xxx.3:8096/emby/videos/2435246/live.m3u8?DeviceId=22dba0664dab168b&MediaSourceId=e74f4825f00ddaedcfe20e3dad08b1e5&PlaySessionId=fb6c97f633984e91ac5007588bea1acf&api_key=my_secret_api_key&VideoCodec=h264,mpeg2video,hevc,h265&AudioCodec=aac_latm,mp4a_latm,ac3,eac3,aac,mp3&VideoBitrate=999872000&AudioBitrate=128000&MaxHeight=2176&AudioStreamIndex=1&CopyTimestamps=true&SegmentContainer=ts&MinSegments=2&AllowInterlacedVideoStreamCopy=True&BreakOnNonKeyFrames=True&SubtitleStreamIndexes=-1&ManifestSubtitles=vtt&h264-profile=high,main,baseline,constrainedbaseline&h264-level=51&h264-deinterlace=true&mpeg2video-deinterlace=true&hevc-profile=Main,Main10&aac_latm-audiochannels=8&mp4a_latm-audiochannels=8&ac3-audiochannels=8&eac3-audiochannels=6&aac-audiochannels=8&mp3-audiochannels=8&TranscodeReasons=ContainerNotSupported

{"Protocol":"Rtsp","Id":"e74f4825f00ddaedcfe20e3dad08b1e5","Path":"rtsp://scrubbed_user:scrubbed_pw@192.xxx.xxx.201:554/cam/realmonitor?channel=1&subtype=0","Type":"Default","Container":"rtsp","Size":0,"Name":"Front Door","IsRemote":true,"SupportsTranscoding":true,"SupportsDirectStream":false,"SupportsDirectPlay":true,"IsInfiniteStream":false,"RequiresOpening":false,"RequiresClosing":false,"RequiresLooping":false,"SupportsProbing":false,"MediaStreams":[{"Codec":"h264","ColorTransfer":"bt709","ColorPrimaries":"bt709","ColorSpace":"bt709","TimeBase":"1/90000","VideoRange":"SDR","DisplayTitle":"720p H264","NalLengthSize":"0","IsInterlaced":false,"BitDepth":8,"RefFrames":1,"IsDefault":false,"IsForced":false,"Height":720,"Width":1280,"AverageFrameRate":15,"RealFrameRate":100,"Profile":"High","Type":"Video","AspectRatio":"16:9","Index":0,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","PixelFormat":"yuvj420p","Level":31,"IsAnamorphic":false,"AttachmentSize":0},{"Codec":"pcm_mulaw","TimeBase":"1/16000","DisplayTitle":"Und PCM_MULAW mono","IsInterlaced":false,"ChannelLayout":"mono","BitRate":128000,"BitDepth":8,"Channels":1,"SampleRate":16000,"IsDefault":false,"IsForced":false,"Type":"Audio","Index":1,"IsExternal":false,"IsTextSubtitleStream":false,"SupportsExternalStream":false,"Protocol":"File","AttachmentSize":0}],"Formats":[],"Bitrate":128000,"RequiredHttpHeaders":{},"ReadAtNativeFramerate":false}

I'll let you look through the differences, but the most significant difference that jumps out at me is the omission of the rtsp:// in the url input for ffmpeg.

I need to look more into this and thanks for the info… as stated many times, I’m new to channel plugins and learning a lot, so feedback only will make me stronger as a 3rd party dev.

I don’t understand why you require a strm file, I can’t remember if it’s in the protocol list. But I don’t think so from top of my head.  I think this could be an additional option because all the strm file is…. Gives you a location for the real media, stream or container file. 
 

hope that helps but i am keen to get this working to get this implemented if your willing to help 👍👍

Link to comment
Share on other sites

datanet

The strm file was one of Luke's supported ways of supporting IP cameras in a Library.  Just create a mixed library type and throw a bunch of strm files for each IP camera and they play.  So that is how I've been doing it.  I stumbled upon your plugin and figured I'd give it a try.  I couldn't get it to work with my Amcrest cameras using various urls.  I then started looking through the log files and noticed that underneath it all, the two methods are passed to ffmpeg very similarly.  So I included the ffmpeg command from my logs that worked using the strm file method in comparison to what your plugin was building for the ffmpeg command which wouldn't work in hopes that it might provide some clues as to what/how the info used from your plugin should be parsed to ffmpeg.

Link to comment
Share on other sites

Cheesegeezer
14 minutes ago, datanet said:

The strm file was one of Luke's supported ways of supporting IP cameras in a Library.  Just create a mixed library type and throw a bunch of strm files for each IP camera and they play.  So that is how I've been doing it.  I stumbled upon your plugin and figured I'd give it a try.  I couldn't get it to work with my Amcrest cameras using various urls.  I then started looking through the log files and noticed that underneath it all, the two methods are passed to ffmpeg very similarly.  So I included the ffmpeg command from my logs that worked using the strm file method in comparison to what your plugin was building for the ffmpeg command which wouldn't work in hopes that it might provide some clues as to what/how the info used from your plugin should be parsed to ffmpeg.

See reply above please 👍

Link to comment
Share on other sites

Cheesegeezer
11 minutes ago, datanet said:

I had read the reply...I was just trying to clarify about the strm file method that I had been using.

Which I got from here...

https://emby.media/community/index.php?/topic/44708-security-cameras-plug-in/page/8/#comment-523663

 

Yup I understand, but why not a direct feed? Why strm. Strm files are placeholders for media. Bear in mind the key is Security. I’m up for letting strm files in the protocol but not just willy nilly.it ensures the user is on that network and authenticated. I don’t see a reason to include them unless its for malicious reasons 

EDIT: its a local network to view these cameras, or a dial into your remote, you need to open your router IP’s or ditch the idea.

more I think the less i wanna do this. 

Edited by Cheesegeezer
Link to comment
Share on other sites

datanet

I think you're misunderstanding what I'm saying.  I'm not suggesting to support strm files.  I was only comparing how your plugin is taking essentially the same information that is contained in the strm file...the camera url and parsing that information to ffmpeg for viewing.  After I reviewed my logs to see if I could determine why your plugin was not working for me, I then noticed how similar the two methods were as far as how the info was parsed to ffmpeg for viewing the camera.  That's why I had pointed out that the biggest difference in my logs as to why your plugin wasn't working for me was that the input path for ffmpeg didnt include the rtsp:// in the ffmpeg command from your plugin.

Link to comment
Share on other sites

fcarmonanatta

I am looking to buy a dashcam that can be compatible with this plugin.  Anything to recommend that you think might work?

Because apart from being wifi, it should be possible to access through the browser I understand

Link to comment
Share on other sites

Cheesegeezer
2 hours ago, fcarmonanatta said:

I am looking to buy a dashcam that can be compatible with this plugin.  Anything to recommend that you think might work?

Because apart from being wifi, it should be possible to access through the browser I understand

Yeah so you may find that some cameras only work with a certain app. A lot of Chinese camera do this and you can’t access them via a browser. So search for http cameras and read questions and comments also to confirm 

Edited by Cheesegeezer
Link to comment
Share on other sites

jaycedk
2 hours ago, fcarmonanatta said:

I am looking to buy a dashcam that can be compatible with this plugin.  Anything to recommend that you think might work?

Because apart from being wifi, it should be possible to access through the browser I understand

Is your intension to mount the dashcam in you car ?

If so you would need a mobil router in you car, if the dashcam do not have a sim slot.

Further more you would need a static ip, for the sim card, from your cell company.

Edited by jaycedk
Link to comment
Share on other sites

  • 2 months later...
rjow2021

Like this plug in. 

Is there a way to hide Media Info? 

It does display the username and password for the cam in the url. 

Link to comment
Share on other sites

  • 3 weeks later...
hoopsoft

Just found this plugin, seems to work pretty well.  It won't really pull up the stream on my 8mb cameras but pretty sure that is an issue with ffmpeg, it pulls the sub stream just fine.  

If I could make a request or two, the option to edit the camera once created, and under media info one in the camera screen before clicking play.  It shows the connect string which often times will have the password, maybe have the option to hide it or manually enter something so that won't be shown?

Thanks again.

Link to comment
Share on other sites

  • 6 months later...
JuJuJurassic

Thank you for writing this plugin, it works perfectly the first time, you can't ask more than that 🙂

Unfortunately, I had to remove this plugin and many more while debugging a problem with my server. I've re-added it, but it's not creating the m3u8 file for some reason. 

I've tried deleting the original folder, creating a new folder with a different name, re-running the internet channels scheduled task, and rebooting the server, but with no luck. It's remembering the original camera and its details, so I suspect it's retrieving some data that tells it the file is created so it doesn't create a new one.

I have edited the embtserver.txt to emby.<URL>.com from the full address.

Can you offer me some advice, please

Thanks

embyserver (6).txt

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...