petergeneric / unifi-protect-remux

Tool to help remux .ubv files from Ubiquiti's Unifi Protect system so they can be turned into standard .mp4 files
GNU Affero General Public License v3.0
277 stars 21 forks source link

panic: runtime error: slice bounds out of range [:-1] #7

Closed TokugawaHeavyIndustries closed 3 years ago

TokugawaHeavyIndustries commented 3 years ago

This error was generated on x86 ver 3.0.0, with x86 version of ubnt_ubvinfo

2020/10/10 16:05:41 Analysing  /remux/ubv.ubv
2020/10/10 16:05:41 First Frame timestamp 2020-04-09 17:28:15.016 +0000 UTC
2020/10/10 16:05:41 Second Frame timestamp 2020-04-09 17:28:15.096 +0000 UTC
2020/10/10 16:05:41 First Frame timestamp 2020-04-09 17:29:18.309 +0000 UTC
2020/10/10 16:05:41 Second Frame timestamp 2020-04-09 17:29:18.389 +0000 UTC
2020/10/10 16:06:18

Analysis complete!
2020/10/10 16:06:18 First Partition:
2020/10/10 16:06:18     Tracks: 1
2020/10/10 16:06:18     Frames: 17
2020/10/10 16:06:18     Start Timecode: 2020-04-09T17:28:15Z
2020/10/10 16:06:18

Extracting 2 partitions
panic: runtime error: slice bounds out of range [:-1]

goroutine 1 [running]:
main.RemuxCLI(0xc0000ae030, 0x1, 0x1, 0x100, 0x0, 0x1, 0x4ffb74, 0x2)
        /opt/graal/unifi-protect-remux/remux.go:105 +0x1036
main.main()
        /opt/graal/unifi-protect-remux/remux.go:61 +0x2e5
petergeneric commented 3 years ago

Hi,

This is because I'm assuming the filename of the input .ubv will be unchanged from when Protect writes it, could you try again with the original filename (or at least with a name like "sample_file.ubv").

Targeting later today for a new version that doesn't make this assumption.

P.S. your Dockerfile is excellent!

petergeneric commented 3 years ago

Fix released: https://github.com/petergeneric/unifi-protect-remux/releases/tag/3.0.1

TokugawaHeavyIndustries commented 3 years ago

Hey you're quick, thanks for the fast bugfix! Didn't think about renames being the issue.