Export short clip via api?

jonrub11

n3wb
Joined
Dec 13, 2018
Messages
18
Reaction score
0
Location
Sweden
Hi,

Is it possible to export a short videoclip of an event via api? I am thinking of a video like the one I can get when using the email notification that is 10 seconds long.

Thanks in advance!
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,672
Reaction score
14,016
Location
USA
Yes. See the Blue Iris help file > Administration > JSON interface. Scroll to the "export" command, currently on about page 222.

It isn't something you can simply do with one request. First you need to log in, then get a clip list to obtain a clip ID (if you don't already have one). Then begin the export. Then poll for status until the export completes. Only then can you download the exported file.
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,672
Reaction score
14,016
Location
USA
That would be for if you wanted to skip some time at the beginning of the clip. For example if you only cared about the video after the first 30 seconds, you would put a value of 30000 there. To start the export at the beginning of the clip, just set 0.
 

jonrub11

n3wb
Joined
Dec 13, 2018
Messages
18
Reaction score
0
Location
Sweden
Thank you very much for your help. I am using continuous recording and when I try to export the file below I get a video that is 15 minutes long.
'{"cmd":"export","session":"48534f5555c571490414490f7bb107e4","path":"@36733140.bvr","startms":"0","msec":"10000"}'

I just want 10 seconds around the alert so there is something I am doing wrong.
 
Last edited:

jonrub11

n3wb
Joined
Dec 13, 2018
Messages
18
Reaction score
0
Location
Sweden
Solved it by removing "" around the startms-value and msec-value. Like this: '{"cmd":"export","session":"48534f5555c571490414490f7bb107e4","path":"@36733140.bvr","startms":0,"msec":10000}'
 

jonrub11

n3wb
Joined
Dec 13, 2018
Messages
18
Reaction score
0
Location
Sweden
@bp2008 Any idea of how to make the file smaller? I have tried to edit a profile in Convert/Export and set "profile":2 but the file size is still the same.
 

jonrub11

n3wb
Joined
Dec 13, 2018
Messages
18
Reaction score
0
Location
Sweden
Gaah, thank you @bp2008!
Last step is poll for status. Do you any exemple? I have not managed to get it working yet.
 

jonrub11

n3wb
Joined
Dec 13, 2018
Messages
18
Reaction score
0
Location
Sweden
I tried to look at the code but I am not good enough to see how to get status for a single event.
I have tried with this {"cmd":"export","session":"$sessionvariable",path:"pathvariable"} but it doesn't work.

I don't understand this in the manual "Send only a path with a previously obtained path to obtain status on a single item. Send only the export command without a path to receive an array of items in the export queue.".
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,672
Reaction score
14,016
Location
USA
I think when you begin the export, the response from that will include a path variable which you can use to query for status updates.
 
Top