TheAcharya / MarkersExtractor

Extract Markers from Final Cut Pro FCPXML
MIT License
36 stars 2 forks source link

Labels are not overlaid on Animated GIF thumbnail images #83

Closed IAmVigneswaran closed 9 months ago

IAmVigneswaran commented 9 months ago

I have tested with the latest build (0.3.1), the labels are working.

$TOOL_PATH "$FCPXML_PATH" "$OUTPUT_DIR" 
--export-format notion 
--image-format png --label "name" 
--label "type" 
--label "notes" 
--label "position" 
--label-font Menlo-Regular 
--label-font-size 30 
--label-font-color ffff00 
--label-stroke-color 20003366 
--label-stroke-width 3 
--result-file-path $RESULT_JSON 
--log-level debug 
--log $ERROR_LOG

But in the Marker Data, we are not able to apply it.

https://github.com/TheAcharya/MarkerData/issues/18#issuecomment-1837203317

orchetect commented 9 months ago

I just tested this, seems that it's a regression - it has nothing to do with API. Labels embed correctly on PNG images but not animated GIFs.

IAmVigneswaran commented 9 months ago

I just tested this, seems that it's a regression - it has nothing to do with API. Labels embed correctly on PNG images but not animated GIFs.

Interesting.

But on Marker Data,

Screenshot 2024-01-04 at 9 41 11 AM

When I apply them, they are not burned on the images (even on PNG stills).

So something to do with how the code is implemented in Marker Data?

orchetect commented 9 months ago

If it works in MarkersExtractor CLI, it 100% should work for Marker Data. They use the same API. You'll have to check your code over and see if anything has changed.

I have fixed the animated GIF label issue and it's pushed to main branch. Will be in 0.3.2.

milanvarady commented 9 months ago

@orchetect I have added some debug prints to check if the correct settings are indeed passed onto MarkersExtractor. So I have Marker ID, Status and Clip Name selected in MarkerData UI.

Here is the relevant code excerpt:

// Get the settings
guard let settings = try? self.settings.store.markersExtractorSettings(fcpxmlFileUrl: url) else {
    throw ExtractError.settingsReadError
}

// Read image labels           
print("Overlays: \(settings.imageLabels)")
// Output: [MarkersExtractor.ExportField.id, MarkersExtractor.ExportField.status, MarkersExtractor.ExportField.clipName]

// Init extractor with the settings
let extractor = MarkersExtractor(settings)


(…) // some code here

// Extract
try await extractor.extract()

So the following list of ExportField members are passed into the imageLabels option: .id, .status and .clipName. As it should be, right?

orchetect commented 9 months ago

I had a look at the Marker Data codebase. You're passing opacity as 0 ... 1 when it needs to be 0 ... 100.

 --label-opacity <0...100>
                          Label opacity percent (default: 100)