ZoneMinder / zmNinja

High performance, cross platform ionic app for Home/Commerical Security Surveillance using ZoneMinder
http://zmninja.zoneminder.com
Other
1.01k stars 268 forks source link

H265 not working in event view #950

Closed jeroenst closed 4 years ago

jeroenst commented 4 years ago

The version of zmNinja you are reporting:

1.4.007 (android) 

The version and OS of ZoneMinder you are using:

1.34.15 linux mint 19.3

Platform zmNinja is running on

Samsung Galaxy Note 9 

Did you build the package from source code yourself? N

Describe the bug When I use h265 cameras, live view works fine, but playback of events fail. I only hear audio but don't see any video.

Debug logs

Jun 1, 2020 12:19:06 AM DEBUG Video state=stop
Jun 1, 2020 12:19:06 AM DEBUG not going to next event, gapless is off
Jun 1, 2020 12:19:06 AM INFO Playback of event 14577 is finished
Jun 1, 2020 12:19:06 AM DEBUG Video state=pause
Jun 1, 2020 12:18:55 AM DEBUG Video state=play
Jun 1, 2020 12:18:55 AM DEBUG Setting play at rate:1 as video can be played
Jun 1, 2020 12:18:55 AM DEBUG obfuscate: original:9054 obfuscated:2325 scheme:lzs
Jun 1, 2020 12:18:55 AM DEBUG This video can be played
Jun 1, 2020 12:18:52 AM DEBUG Player-Total length:0
Jun 1, 2020 12:18:52 AM DEBUG API-Total length:9.32
Jun 1, 2020 12:18:52 AM DEBUG Setting cue points..
Jun 1, 2020 12:18:52 AM DEBUG On Play Ready invoked
Jun 1, 2020 12:18:51 AM INFO >>>Starting checkAllEvents interval...
Jun 1, 2020 12:18:50 AM DEBUG neighbors of 14577are pre=14576 next=
Jun 1, 2020 12:18:50 AM DEBUG resize/orient: 360(w) * 668(h)
Jun 1, 2020 12:18:50 AM DEBUG Video url passed to player is: https://secret

Screenshots

Additional context

When playing events in zm webpage I have to use mjpeg instead of mp4

When I download the video in zmninja and open it with vlc the video works fine.

A fast temporary workaround would be to have a setting to use mjpeg instead of mp4.

welcome[bot] commented 4 years ago

👋 Thanks for opening your first issue here! If you're reporting a 🐞 bug, please make sure you follow the issue template or I may not respond.

pliablepixels commented 4 years ago

Open up a chrome browser on your mobile device, go to ZM console and try playing the same video. Does it play? If not, zmNinja won't play either.

Your idea of mjpeg is worth investigation. What is the URL when you play using mpeg?

jeroenst commented 4 years ago

It doesn't play. Chrome browser doesn't support h265, only safari supports it...

The url is: /zm/cgi-bin/nph-zms?mode=jpeg&frame=1&scale=0&rate=100&maxfps=30&replay=none&source=event&event=14582&connkey=316603&rand=1590996970&auth=######################

pliablepixels commented 4 years ago

Okay, so that is the old style playback. Good idea. How about I add a per monitor setting in the monitors screen that force plays the video in mpeg format even if its mp4? Then you can change on a per monitor basis. I assume thumbnails show correctly, only playback is the issue.

jeroenst commented 4 years ago

Per monitor basis would be perfect. I also have h264 camera's and h265 camera's so that would fit like a charm, thanx

pliablepixels commented 4 years ago

I have a desktop version for you to test first - can you let me know which OS you can try?

jeroenst commented 4 years ago

I'm using Ubuntu 20.04 on my laptop and Android 10 on my Galaxy Note 9.

pliablepixels commented 4 years ago

https://drive.google.com/file/d/15-p_xu55mXYmNspHwbUws3Kc42t3MpM8/view?usp=sharing Go to Monitor->Click on configuration->force MJPEG

then try it out

jeroenst commented 4 years ago

Ok, I did test it and I can confirm it works, thank you!

In the mean time I configured all cameras as H264 so for me the issue is now fixed. Hopefully H265 will be implemented to android webview and chrome in the future.

pliablepixels commented 4 years ago

Sounds good. I’ll make this part of the next release in a few weeks. I assume you are not waiting for it urgently as you have switched to 264?

jeroenst commented 4 years ago

Yes, no urgency at the moment. Thanx for your support!

withanhdammit commented 4 years ago

I have the same issue. iOS 13.5.1 (iPhone X), Windows 10 1809, MacOS Catalina 10.15.5 Would be happy to test if you'd like.

My ZM is on Debian 10 Buster, v1.34.15

jeroenst commented 4 years ago

I have the same issue. iOS 13.5.1 (iPhone X), Windows 10 1809, MacOS Catalina 10.15.5 Would be happy to test if you'd like.

My ZM is on Debian 10 Buster, v1.34.15

The best use case is to use h264. H265 is not supported by many browsers and due to licensing it is probably not going to be supported also. That's why Facebook and YouTube don't use h265 but VP9 which is license free.

But with the mjpeg option you can view your h265 recordings but no sound on that case. Altough you can download the video and play it in a h265 supporting video player with sound.

It would be nice if zmninja could use a h265 library on top of the browser functionality to show h265, but that is a major change.

pliablepixels commented 4 years ago

@withanhdammit The feature I added to mitigate this is to stream those cameras via MJPEG. ZM supports this functionality. There is no way to play H265 if the platform browser doesn't support it. I'll make a release soon.

pliablepixels commented 4 years ago

Closing this as #951 addresses this via ZM side MJPEG transcoding

rajil commented 3 years ago

I am recording video using this method. The camera supports both H264 and H265 streams. If i use H264 the video plays fine in zmninja, however with H265 the video is blank only the audio comes through. H265 consumes only half the storage which is very useful for 24x7 recording.

My device is Samsung Note9 and is able to play the HEVC mp4 file natively. Is there any way we can use the native capabilities of the device?

pliablepixels commented 3 years ago

See https://github.com/pliablepixels/zmNinja/issues/1023