Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Record main stream and substream #2652

Closed
ceandraka opened this issue Jan 16, 2022 · 13 comments
Closed

Record main stream and substream #2652

ceandraka opened this issue Jan 16, 2022 · 13 comments
Labels
enhancement New feature or request pinned

Comments

@ceandraka
Copy link

It would be nice if recording could occur on two streams at once. My system has a low res substream (under 480 lines) that can be used for detection, and is also more than suitable for phone checks. The high res stream (main) is a 4k stream, and is great for archival recording or police reports. However, if I set the 4k stream to record, my Android devices cannot play i in the browser (Samsung Internet, Chrome, Opera, Firefox) nor in the HA App. I can download it and it play sin VLC or MXPlayer. Even if it did play, 4k is overkill on the phone.

My current camera setup will not allow me to reduce the main stream to 1080, which may help solve the non-viewable issue.

However, it would be "best" to have an archival record of "clips" in 4k, but be able to select the secondary stream clips for remote review, saving data bandwidth.

A solution form a user perspective would be to record clips in multiple streams, and then be able to select in the app which stream to view. In notifications I can send the link to the correct (Low res) stream.

I have tried changing camera resolutions, but I am using my old NVR as a switch with POE, and the NVR is preventing me form changing resolutions. And such a solution (record 1080i) would still use more bandwidth than necessary for a phone.

Thanks!

@ceandraka ceandraka added the enhancement New feature or request label Jan 16, 2022
@NickM-27
Copy link
Sponsor Collaborator

If I had to guess I'd say not being able to play has nothing to do with the resolution and likely due to the compression that is being used,. For example this note in the docs about H.265: H265 recordings can be viewed in Edge and Safari only. All other browsers require recordings to be encoded with H264.

@ceandraka
Copy link
Author

If I had to guess I'd say not being able to play has nothing to do with the resolution and likely due to the compression that is being used,. For example this note in the docs about H.265: H265 recordings can be viewed in Edge and Safari only. All other browsers require recordings to be encoded with H264.

Thanks for commenting. I suppose this is possible, even though VLC reports H264 AVC. However, this may be just wrapper information that frigate puts on a stream that is really h265? I will see if I can see anything in the camera settings that may shed light. I thought the cameras were 4k, but they are 4MP, 2688x1520. The stream does play in Chrome on the PC.

Nonetheless, regardless of my display issues, it would make sense to store both streams and allow low res stream viewing on mobile devices, high res for archival or viewing on a PC.

@ceandraka
Copy link
Author

The camera has the same settings for main and substream, for the most part. The only encoding option is h264. The main stream has an additional option of h264+, but that is off. Main stream is set to max bitrate 5120kbps, while substream is 512kbps. Resolution selected is 640x360 substream, main is 2688x1520. Otherwise the same. Not seeing h265 as an option.

@ceandraka
Copy link
Author

I did manage to reset one camera. Tried different resolutions. 1080p displays on mobile, anything higher does not. No other camera settings changed between tries.

But, still would like to see two streams record.

@ceandraka
Copy link
Author

As an alternative to recording both streams, how about an option to pass the playback of a clip through ffmpeg and allow re-encoding with all ffmpeg options? This way the notification could have a link to the raw (4MP) clip, and another link that passes through ffmpeg, and re-encodes on the fly to a lower resolution. This would use a little CPU to encode, but only when a low-res replay is selected.

Maybe there is already a way to do this with creative link?

@blakeblackshear
Copy link
Owner

This may make sense for those that don't have a low res stream to record, but for most people it will be much better to just save a secondary stream. Constantly re-encoding will require more CPU than most would want.

@ceandraka
Copy link
Author

I did not intend constant re-encoding. Rather, save the stream (high res as is done now), and re-encode on the fly when a clip is requested for review. Typically 30 second clip. Sorry if I was not clear. So just the API call to assemble a clip for review, either through a notification or by clicking on the event in Frigate view.

@blakeblackshear
Copy link
Owner

That isn't possible today, but could be one day.

@ceandraka
Copy link
Author

OK, thanks for taking a look

@stale
Copy link

stale bot commented Feb 18, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@ghgeiger
Copy link

Following this request as I would like to be able to record both hi & low res streams with frigate. Specifically, I'd like frigate to be able to continue to function as it currently does, but I would also like it to archive unprocessed high res streams on any motion event, so that I could go back and get a better look at my scene. In my case, I wouldn't even care if the recordings were not available via UI, I'd just like to be able to retrieve them from the drive if I need them... Or perhaps just a 'Download' button for the high res recording.

@spacebares
Copy link
Contributor

Or what about record streams with tags? Highres / Lowres.

- path: rtsp:https://highreslink
  tag: highres
  roles:
    - record
- path: rtsp:https://lowreslink
  tag: lowres
  roles:
    - record

and the events browser will have a dropdown box or buttons that allows you to show recordings from a tag? Would be great for mobile, and you still have highres if your willing to wait for the load.

aewfrsh

would be awesome to have

@NickM-27
Copy link
Sponsor Collaborator

the next version of frigate (0.14) supports previews which are a low fps low resolution video that is easily scrubbable and likely solves this issue for most use cases

@NickM-27 NickM-27 closed this as completed Sep 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

No branches or pull requests

5 participants