New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export to Fusion Text+ #14
Comments
Hey there! Thanks for the feedback! 1. Text+
Adding the transcript segments as Text+ in the timeline might be possible, but only if the Resolve API allows the creation of Fusion Clips and then importing them into the timeline The way I would approach it would be to
As you can probably tell this involves a lot of work, but feel free to tackle it if you feel brave and I'll try to help on the way. :-D 2. Subtitles length
This is done using AI/Whisper because a bit of semantics/context is required so that the subtitles make sense when you create them, otherwise you'd have phrases split in a way that's not readable by the viewer. I think the SRT function is somewhere in the utils.py file. I've seen some discussions on the topic of subtitle length on their Github page: https://github.com/openai/whisper/discussions?discussions_q=subtitles+length EDIT: This is partially available in the latest updates - see #42 Cheers! |
Thanks for the quick and detailed response. I've already made some progress in regards of inserting Text+ elements directly into the timline. (using the same [resolve, project, mediaPool, projectManager, currentBin, currentTimeline] = initialize_resolve()
textobj = currentTimeline.InsertFusionTitleIntoTimeline("Text+")
toolList = textobj.GetFusionCompByIndex(1).GetToolList()
toolList[1].StyledText = "something"
toolList[1].Font, toolList[1].Style = "Bell MT", "Bold" This creates a text+ object with the default length, text is set to "something" and as you can see, other properties are also exposed and configurable. Since the Title is always placed at the current playhead/timecode, im searching for a way to move the titles to the correct timecodes, as well as setting their duration. (to avoid always moving the playhead/timecode around) |
That's cool! You can move the playhead using
In principle, something like this could work (writing from my head):
|
Sadly there seems to be no way of setting a duration right now. The default duration of 5 seconds is sometimes enough (maybe if the line length could be adjusted? - the proposed edits in the openai-whispher didn't worked for me). One option would be to find the original Text+.settings file and set there 60seconds or similar. That works in theory, because the next insertion would just cut of the end of the previous text. But I didn't manage to find it and also creating a custom text preset, seems to refuse to work, since the Api only allows internal Presets as far as I could test. Your proposed code works like a charm (except the Apart from editing the source Text+ file I think its pretty much impossible with the current Api. (In terms of Easy of use). |
These are difficult to manipulate since the Whisper models are using their training data to decide the length of each segment, and you'd probably need to go deep into the neural net to make it happen. I'm pretty sure you can achieve that by fine-tuning the models, but before we get to that functionality in the tool, there are a lot more priorities to fix.
Maybe exporting the Text+ comp and modifying it or using a custom Fusion comp template, then importing it in the timeline is a better way. I think the FusionScript API is more flexible then the Resolve API and would allow you to add nodes, configure them etc.
Simply convert the timecode to string when calling the function |
I would love it if you could implement Text+ as an option next to .srt insert. For me .srt is just a middle step to complete my projects as i only use the .srt for timecoding Text+ manually, which is a real timehog. Blackmagic should really overhaul the subtitle stylisation, you can't even put an outside stroke onto the text, the only option for stroke is inner stroke, which looks ugly af |
@yokhalel I think it would be a cool feature to have, but it does take a lot of work and we need to finish some other stuff before... Off topic, but maybe useful for your workflow - if you select your entire transcript using CMD/CTRL+A, and then do CMD/CTRL+Shift+C, you will copy all your transcript segments to clipboard together with their timecodes, which you can then paste wherever you need them. You could probably use this to generate the Text+ comp faster and easier. |
@octimot thank you for your response. Can you elaborate a bit more on how to genererate these Text+ comps with the copied transcript and timecode? |
@yokhalel Sorry for the late reply. I don't really have a process in mind right now, but... A Fusion Text+ element looks like this if you copy it from Fusion and paste it into a text editor:
As you see, the attribute
With a bit of thinkering, you could use the timecode to add all the needed keyframes in the Text+ element, but this requires a bit of coding skills (or just manually entering them after you convert the timecode to keyframes). tl;drI know this is not a proper solution and would love to code this one day, but we have a list of stuff that want to get done sooner and maybe it helps you somehow until then... Maybe @Dschogo is also interested in working this out? |
Starting from version 0.18.3, you can export the transcription lines into a Fusion Text node.
You can also import the .comp file directly into Fusion, but it will probably remove all your existing nodes from the comp. Feel free to re-open this issue in case something doesn't work as expected. Cheers! |
Hey! The You need to enter the timecode data (start timecode - probably 01:00:00:00 if you're using Resolve; and framerate according to your timeline), otherwise the tool cannot know how to arrange the frames in the Fusion node. Cheers! |
@octimot where do i put in the timecode and framerate? |
A window should pop-up after you press the If you transcribed a Resolve timeline, you shouldn't have to do it, because the transcription.json file should already have it stored. Did you find the menu button? |
Indeed i transcribed a Resolve timeline. Yes i was already using the right button, unfortunatly the only window, which pops up is to choose file location. When i press save, nothing happens and the folder stays empty |
This is weird! This probably means that the Resolve API didn't send the timecode or framerate in the right format... What is the timeline start timecode and framerate? Also, if you don't have anything sensitive in the transcription, would you mind attaching the IT01 1683822582.wav.transcription.json file and the IT01 1683822582.wav.json files - assuming this is the transcription that doesn't want to export - just to see whether Resolve passed the timecode data or not. |
Timeline code is 01:00:00:00 and Framerate is 30 fps. |
It's a bug, thanks for reporting! If the first segment starts at frame 0 the tool doesn't assign a proper timecode to that segment for export. I'll code a fix and push it asap! To prevent this from happening until I push the fix in the standalone, just make sure the first segment in your transcription doesn't start at frame 0. If it does, select that segment in the tool, then go to Integrations->Align segment start to playhead (or key :), move the playhead in resolve to frame 1 of the timeline and press ok in the tool. Here's the exported comp file: Just open in notepad/text edit, copy all and paste it into Fusion, then connect the merge node. Let me know if it works! |
Yes this did the trick, thank you! Just two more Questions:
|
Cool! The fix is already up on the private repo, if you want to use the github version! We need a bit of time to wrap it into a new standalone...
Unfortunately, not from the tool without a lot of coding. I think there might be a way via Fusion scripting, but I can't help you much there...
First, I recommend using an Adjustment Layer instead of a Fusion Composition - just right click on the Adjustment Layer and open that in Fusion. This way, you can hear the sound from the timeline in the Fusion page. Another option directly from the tool: before export, you can use the Align segment start (or end) to playhead function in the Integrations menu. You can also edit the .comp file - if you look closesly, all the transcript segments are next to their keyframe value:
Above, BTW, I noticed that you have some gaps in your transcription. You should consider using the Prevent Gaps Shorter Than value when you transcribe, and maybe set it to 0.3 or something similar. This way, if you have transcript segments that are very close to each other, the previous one will extend to reach the next one so that you don't have a few frames without text on the final video. |
Hey,
first of all awesome work, and huge thanks for making this Open Source. I got two questions:
Is it possible to export/import the transcript as text+ objects? (creating via the api)
Why? Text+ has way more features to stylize text (only for burn in ofc)
How? My idea would be, to create a new video track (to avoid overwriting existing stuff), and create all text+ objects there
I've skimmed over the code, but couldn't really find where to set/rewrite a bit code to set the length of each "line"/segment. Will there be an option in the future for this or a similar function?
I'll try to dig a bit deeper and maybe find a solution, but maybe its already in the works, which would be awesome
The text was updated successfully, but these errors were encountered: