bp2008 / ui3

A powerful, modern HTML5 web interface for Blue Iris.
GNU Lesser General Public License v3.0
128 stars 18 forks source link

[bug] Download clip button either downloads the wrong thing or shows the wrong filesize. #147

Closed lightmaster closed 1 year ago

lightmaster commented 1 year ago

In the Alert Clips right-click menu, there is an option to Download (2.41M). This is on a 21-second AI-triggered clip. The button says it's "2.41M", implying that it would download (presumably convert/export the 21-second clip) a 2.41MB file. Instead, it starts downloading the hour-long clip, which is a 355MB BVR file, that that alert took place within (ie: 7pm - 8pm Driveway clip).

Is this Download button supposed to download the raw BVR file? In which case the file size it shows is bugged. Or is it supposed to download just the alert clip itself? In which case the file it's choosing to download is bugged.

Also, if I select Convert/export, don't change the start or stop time and use the default export settings, it creates a 20.40MB 4K HEVC mp4, so I think the filesize shown is bugged regardless of what is supposed to be downloaded by the Download button.

Screenshot_20230605_234039_Chrome

bp2008 commented 1 year ago

The "Download" button predates the ability for Blue Iris to do remote exports. It simply downloads the file containing the clip or alert. Alerts are technically just like bookmarks to a time range in a clip, and in a default BI configuration one clip will contain many alerts.

The file size comes from metadata delivered by Blue Iris. I am surprised you get file sizes in the alert list in the first place, because I do not (I only get file sizes in the clip list). See how my alert list context menu doesn't have a file size next to the Download button?

image

Can you inspect the network request where the json command was "alertlist" and see what the response objects look like? I'm curious why yours is behaving differently.

Also, if I select Convert/export, don't change the start or stop time and use the default export settings, it creates a 20.40MB 4K HEVC mp4, so I think the filesize shown is bugged regardless of what is supposed to be downloaded by the Download button.

Yeah I have no idea why that would be so far off from whatever Blue Iris predicted, unless you allowed the export to re-encode the video (which by default would usually increase the file size substantially).

lightmaster commented 1 year ago

Can you inspect the network request where the json command was "alertlist" and see what the response objects look like? I'm curious why yours is behaving differently.

https://pastebin.com/R7SUS9ir

lightmaster commented 1 year ago

If I switch from Alerts to Stored, and right click the 1hr clips, I get expected file sizes around 500-600MB (I save substream for 24/7 footage, main stream only for AI-triggered events)

bp2008 commented 1 year ago

Hmm. You know what, I bet you've configured your cameras to save "Hi-res JPEG files" or something. Is that the case?

image

I have one camera where I have that enabled for testing purposes, and I noticed I do get file sizes on the alert objects from that camera. Mine are about 200-250 KB though (2mp camera) compared to your approximately 2500 to 5000 KB which I find to be quite a difference. Are you maybe having BI export your alerts to MP4 files instead, or are the jpg files actually that big? (right click a clip, open properties, it should expose the high-res thumbnail in a more accessible way so you can save it to disk and see how big it is).

lightmaster commented 1 year ago

I do have High Res JPEG files set, I believe a guide at one point said to do that for AI. It's been so long now I don't remember.

These are 4K, so somewhere around 4x bigger than a 2M (1080p) camera? If I download the JPG (from properties) for an Alert that says "Download 3.71M", the resulting JPG is actually 2.3MB, which matches the filesize of the JPG saved to my Alerts folder.

bp2008 commented 1 year ago

Well by that logic, I still have no idea where Blue Iris is getting the size number, so I don't have a clue how to present it better.

lightmaster commented 1 year ago

I figured it out, the Alert JPG + AI .DAT is exactly 3.71MB.

lightmaster commented 1 year ago

I'd be very surprised if someone is downloading the full raw bvr file on UI3, and there's already a really easy way to export and download the clip itself with "convert/export" preselecting the timeframe for the alert. Would it make sense to change the download button to instead download the clip's jpg instead?

bp2008 commented 1 year ago

Wow, one alert has over 1 MB of AI metadata?

For most people it probably would make sense to delete or change the download button. For others it would not. Since Blue Iris is so configurable, many people don't combine their clips, therefore each alert is a separate clip. That is what I do. This makes the ability to download the original file more useful. Likewise some record directly to MP4 despite its inferior features, simply because it is compatible with 3rd-party apps with no export required. That is where the direct download option really shines and I wouldn't want to rug-pull anyone who depends on it.

lightmaster commented 1 year ago

Wow, one alert has over 1 MB of AI metadata?

Very annoying camera. Cars pulling in driveway at night will light up the front of the garage setting off motion detection. Have to have the number of images sent to AI long enough that a car will be able to enter the frame and be detected. Tried going with less images sent to AI, but that ended up with sometimes a car entering the frame before the motion event timed out and after the final image was sent to AI, so car was never AI-confirmed.

For most people it probably would make sense to delete or change the download button. For others it would not.

Perhaps a setting to configure what the download button downloads then? Doesn't change for people who already use it, and could be changed or disabled for others. Main concern was that that filesize I was seeing suggests the download would be a couple MB, but then it downloads several hundred MBs. Someone with a limited data plan on their phone could accidently go over it without realizing they were gonna download a very large file.

bp2008 commented 1 year ago

UI3-246 has changed the label of this button to "Download clip" instead of just "Download" so that it is more clear what the intended behavior is. For alerts with a high-res jpeg, the alert properties panel now has a link to download the jpeg.

lightmaster commented 1 year ago

Think that covers it then. Not seeing the oddly small download size on the context menu, and from the properties window, you can clearly download the alert jpg as well as export the event from the clip.