Hi,
a new question
When i'm working with item in project panel, i need to know if the item is an images sequence or a single image ...
i try to list item to check link and work with it, i need to know which entry are a sequence entry ...
I've try several solution but i can find the good one :
item.duration : give me positive return with image sequence and video file ...
item.mainSource.isStill : give me only the possibility to extract single image but in this case i can't filter video file
... I hope i'm clear in my explanation
can i retrieve the file type for a video or image (codec, compression, ... or something like) that without use the extension ?
Tks for your help
Mr
check footage item as sequence
Moderator: Paul Tuersley
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
Did you find a solution for this?
The way I ended up doing it in my pt_OpenSesame script was to try importing it again. item.mainSource.file gives you the first file in a sequence if it's an image sequence, so if you import it again and it's a still (and you already know it isn't a still in your project) then it must be a sequence.
I think I tried other solutions such as testing for sequence range numbering in the name as shown in the project (i.e. just item.name) but this can't be guaranteed as the user may have renamed the footage in the project.
Paul
The way I ended up doing it in my pt_OpenSesame script was to try importing it again. item.mainSource.file gives you the first file in a sequence if it's an image sequence, so if you import it again and it's a still (and you already know it isn't a still in your project) then it must be a sequence.
Code: Select all
var importFile = new File(theItem.mainSource.file);
var importOptions = new ImportOptions(importFile);
var theImport = app.project.importFile(importOptions);
if (theImport.mainSource.isStill) alert("it's a still");
else alert("it's a movie");
theImport.remove();
Paul
-
- Posts: 704
- Joined: June 5th, 2004, 7:59 am
- Location: London, UK
You could check for [0001-00xx] type sequence naming in the project item although the user could have renamed it. You could check the extension against a known list of still/seq file formats.
Paul
Paul
-
- Posts: 30
- Joined: January 12th, 2012, 1:36 am
- Location: Ireland
- Contact:
Can you just perform more specific tests?
if((items instanceof FootageItem) && (items.mainSource instanceof FileSource)
&& (items.mainSource.isStill == 0) && (items.hasVideo == true)&&(items.footageMissing == true)){//do stuff...}
if((items instanceof FootageItem) && (items.mainSource instanceof FileSource)
&& (items.mainSource.isStill == 0) && (items.hasVideo == true)&&(items.footageMissing == true)){//do stuff...}