Savant icon indicating copy to clipboard operation
Savant copied to clipboard

Substitution patterns for image and video files sink

Open Y-T-G opened this issue 1 year ago • 3 comments

Closes #609

Y-T-G avatar Jan 11 '24 09:01 Y-T-G

If the DIR_LOCATION has %src_filename, the Video Files Sink creates only the directory only for the first filename from each source.

Image Files Sink has the same issue.

tomskikh avatar Jan 12 '24 08:01 tomskikh

@tomskikh

Do you mean something like this:

            src_location = get_tag_location(frame)
            if Patterns.SOURCE_ID in self.location or Patterns.SRC_FILENAME in self.location:
                if Patterns.SOURCE_ID in self.location:
                    base_location = get_location(self.location, frame.source_id, src_location)
                else:
                    self.logger.error(f"{Patterns.SOURCE_ID} is required when {Patterns.SRC_FILENAME} is present.")        
                    return Gst.FlowReturn.ERROR
            else:
                base_location = os.path.join(self.location, frame.source_id)

Y-T-G avatar Jan 12 '24 10:01 Y-T-G

@Y-T-G No. Check DIR_LOCATION at the start of the sink: for image files sink in the method main, for video files sink in the script video_files.sh or in the method VideoFilesSink.do_set_property.

tomskikh avatar Jan 15 '24 05:01 tomskikh

Will be fixed in #867 Closed.

bwsw avatar Sep 24 '24 14:09 bwsw