Export to SRT from Subtitles in Nested Timeline

Get answers to your questions about color grading, editing and finishing with DaVinci Resolve.
  • Author
  • Message
Offline

RagnarRox

  • Posts: 9
  • Joined: Fri Sep 24, 2021 5:03 pm
  • Real Name: Ragnar Ulricson

Export to SRT from Subtitles in Nested Timeline

PostFri Sep 24, 2021 5:16 pm

Hey everyone,

so my question here is a bit specific. I'm currently learning the ins-and-outs of Resolve (worked with Premiere for a decade) and am trying to re-create a pretty nifty workflow I had regarding captioning.

Basically, I work with an external captioner who works on captioning a voice-over track before I begin with the editing process.

The way that works is: I import voice track and create a timeline from it. This timeline is exported as a video (so he can work on a caption in Subtitle Edit and export it as SRT).

While he's working on the captions I import the voice over timeline - nested - into the main timeline, where I sometimes cut things apart, move them around etc.

Once the captioner is finished he delivers the SRT, which I import into the (nested) voice over timeline. It's perfectly synced - and since the main timeline includes the voice over nested timeline, every edit I made to it will still have the captions synced.

So far so good, this works -- when I playback the main video, the captions from inside the voice over nested timeline are properly shown in the preview window.


Here's my problem: When I export the video (the main timeline) and select "Export Subtitle as separate file -> SRT", it doesn't write an SRT file at all, because it turns out that Resolve will only export the subtitle track of the very timeline you're exporting, but no subtitle information that's contained in nested timelines.

I hope this was clearly laid out, apologies if it got a little muddled, please feel free to ask further questions if things should be unclear.

So my questions are:
a) Is there a way to have Resolve export an SRT taking information from within nested sequences? (My gut tells me no)
b) If that is not possible, does anybody have a good suggestion for a captioning-workflow that would allow an external captioner to work on the pure voice track - while still keeping it synced within the video edit, despite moving and cutting things around in the process?


Thanks for any thoughts/assistance in advance!


Edit: I am working with Resolve 17.3.1 Build 5 - and the explicit goal is to have an external file. It works if I "burn in" the captions, but that's not feasible for me.
Offline
User avatar

TheBloke

  • Posts: 1905
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Location: UK
  • Real Name: Tom Jobbins

Re: Export to SRT from Subtitles in Nested Timeline

PostFri Sep 24, 2021 5:41 pm

a) No, it's just not supported at the moment.

b) Select your nested timeline, right-click and Decompose In Place. That should dump all the tracks from within the nested timeline onto the current timeline. Now deliver that and hopefully the SRT should export. I say hopefully as I've never tested this workflow, but in theory it should work fine.

If you only ever need to export once with the SRT then you could do the Decompose as the final step once the project is finished.

If you need to export multiple times with SRT throughout the project, you would need to take a backup of the timeline (via the Duplicate Timeline feature), do the Decompose + Deliver in the Duplicate, then delete/archive the duplicate and carry on working in the main timeline.

Not ideal, but hopefully it will only add a couple of minutes' work to each export.
Resolve Studio 17.4.3 and Fusion Studio 17.4.3 on macOS 11.6.1

Hackintosh:: X299, Intel i9-10980XE, 128GB DDR4, AMD 6900XT 16GB
Monitors: 1 x 3840x2160 & 3 x 1920x1200
Disk: 2TB NVMe + 4TB RAID0 NVMe; NAS: 36TB RAID6
BMD Speed Editor
Offline

RagnarRox

  • Posts: 9
  • Joined: Fri Sep 24, 2021 5:03 pm
  • Real Name: Ragnar Ulricson

Re: Export to SRT from Subtitles in Nested Timeline

PostFri Sep 24, 2021 5:52 pm

Ah thanks a lot for the quick suggestion.

I tried it out because I had hoped that a feature like "Decompose" would exist, it would work nearly perfect for what I'm doing; just keep it in place while editing and before the final render, simply decompose the audio track with subtitles, but alas.

Decompose does not include the subtitles in the nested timeline.
(It also, for some strange reason downsamples the audio to 1-channel mono after decomposing, which is definitely something that can be easily fixed).

But yeah; decompose decomposes everything but the subtitles.:roll:
Offline
User avatar

TheBloke

  • Posts: 1905
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Location: UK
  • Real Name: Tom Jobbins

Re: Export to SRT from Subtitles in Nested Timeline

PostFri Sep 24, 2021 8:14 pm

Ahh yeah, that's dumb.

In that case I guess the only way is to open the nested timeline, select all, copy, then paste into a new/temporary timeline. That at least does seem to copy the subtitle tracks.

But if there's lots of cuts of that nested timeline, that's going to be pretty bad.
Resolve Studio 17.4.3 and Fusion Studio 17.4.3 on macOS 11.6.1

Hackintosh:: X299, Intel i9-10980XE, 128GB DDR4, AMD 6900XT 16GB
Monitors: 1 x 3840x2160 & 3 x 1920x1200
Disk: 2TB NVMe + 4TB RAID0 NVMe; NAS: 36TB RAID6
BMD Speed Editor
Offline

TCP786

  • Posts: 456
  • Joined: Thu Sep 16, 2021 7:05 am
  • Real Name: Cody Predum

Re: Export to SRT from Subtitles in Nested Timeline

PostSat Sep 25, 2021 12:43 am

Unfortunately I don't have any info that can help you with this issue, but I had to chime in just to say that that's a brilliant subtitling workflow. On the other hand, considering that subtitles are actual tracks in a timeline, I would say this counts as a bug, rather than a lack of a feature, and should be logged as such. Or maybe at least add it to the requested features thread.

Also, regardless of the fact that this is too good of a workflow idea for it to not be supported, there are many people who rely on subtitles just as much as others rely on audio, so I'd say this is actually a pretty bad issue. Honestly in my opinion, this is just as bad of a bug as if audio tracks didn't decompose from a nested timeline. (Not even to mention that subtitles are actually required for deliverables in many circumstances.)
Offline

RagnarRox

  • Posts: 9
  • Joined: Fri Sep 24, 2021 5:03 pm
  • Real Name: Ragnar Ulricson

Re: Export to SRT from Subtitles in Nested Timeline

PostSat Sep 25, 2021 8:06 am

TCP786 wrote:but I had to chime in just to say that that's a brilliant subtitling workflow.


Why thank you! :oops:
And I agree, the workflow is really amazing, because it allows me to have subtitles virtually ready the moment the actual video is cut. With very little tweaking near the end. Compared to having to rush the subtitling after the production is finished.

But yeah, as you said - subtitles are just another track, so this should technically work. (And it *does* work for burned in captions, which is what makes this even weirder)

On the other hand, although subtitles are just another track, they are a different type of track than audio and video tracks, so I understand how they're handled differently internally.
I can also see the problems with potentially overlapping subtitles from within nested sequences, but a) as I said, it works for burned in captions and b) it would simply work with priority (i.e. the top child has highest priority over every nest-level and bam!)


Premiere *used to have* that functionality until the most recent major update which replaced their whole captioning system with a shiny new one but that now also doesn't support nested captions anymore, which was my very last straw to finally migrate to Resolve (after many many increasing frustrations over the past years)

Kind of sad to me that it looks like I will have to abandon my parallel captioning workflow. But I'll try to find a solution. If I find one, I'll share it here.


--> I'd love to add it to the Requested Features thread, but I wasn't able to find it. Kindly asking if someone who knows could direct me to it? :)
Offline

RagnarRox

  • Posts: 9
  • Joined: Fri Sep 24, 2021 5:03 pm
  • Real Name: Ragnar Ulricson

Re: Export to SRT from Subtitles in Nested Timeline

PostSun Sep 26, 2021 8:39 am

Okay, a little update for anyone who's interested in how I *solved* this.

Firstly, I was not able to reproduce the workflow *within* Resolve.
But I realized that there is an option to export a timeline to XML.

So my hackerman-solution was to write a small app, very quick and dirty, tailored to my specific needs, where I can paste the original voice over track's captions in SRT format (as delivered by my captioner) and the XML formatted timeline and then the app parses both and generates a new SRT caption file that places the captions in the right places for my edited timeline.

Currently this is held together with duct tape and prayers, meaning I have to adhere to using exclusively the first audio track of the timeline for the voice over and put nothing else in there but it *works* and it allows me to keep working with my very efficient external captioner workflow. So that's great!

If I find some spare time, I am thinking of looking into Resolve's scripting API to see if I can maybe develop a plugin that generates an SRT file from captions within nested timelines. If anyone can recommend good resources for that, I'd be very grateful! (will do my own research though)

Thanks for anyone who offered help.

TL;DR: In 17.3.1, I was not able to export captions within nested timelines into an external SRT file ; solved it by developing an external program that creates the SRT file from the original SRT and an XML-export of the main timeline.
Offline
User avatar

TheBloke

  • Posts: 1905
  • Joined: Sat Nov 02, 2019 11:49 pm
  • Location: UK
  • Real Name: Tom Jobbins

Re: Export to SRT from Subtitles in Nested Timeline

PostSun Sep 26, 2021 9:05 am

Great, well done.

The scripting API documentation is included with Resolve. You can get a link to its location on disk via Help -> Documentation -> Developer. There are also some community projects to help - there should be a pinned thread in this forum with better formatted API docs, and Roger Magnusson has a great script called Class Browser which can be run from within Resolve to browse through the available classes and methods. That's available via the Reactor plugin manager (which is primarily for Fusion tools and scripts), or by searching this forum.

There are very few API calls that relate to subtitles - "subtitle" is only mentioned three times in the README.txt, related to the following, self-explanatory, API calls:
- GetTrackCount(...)
- GetTrackName(...)
- SetTrackName(...)

There are API calls for exporting XML (and EDL and other formats), and for adding renders to the queue and running them. I would expect - but have not checked - that this would enable doing an SRT export via the Render Queue. At the very least you should be able to save a Preset that includes the desired SRT export options, then via API trigger a render using that preset.

There's a method called ImportTimelineFromFile() which I guess imports XML or EDL. I don't know if that would include any subtitle support. I'd guess not, but it could be tested.

At the least I'd think you should be able to make a script that automates the process of exporting XML and/or SRT. I'm not sure if you could do much more than that at the moment, but maybe there's some further hacks possible.
Resolve Studio 17.4.3 and Fusion Studio 17.4.3 on macOS 11.6.1

Hackintosh:: X299, Intel i9-10980XE, 128GB DDR4, AMD 6900XT 16GB
Monitors: 1 x 3840x2160 & 3 x 1920x1200
Disk: 2TB NVMe + 4TB RAID0 NVMe; NAS: 36TB RAID6
BMD Speed Editor
Offline

RagnarRox

  • Posts: 9
  • Joined: Fri Sep 24, 2021 5:03 pm
  • Real Name: Ragnar Ulricson

Re: Export to SRT from Subtitles in Nested Timeline

PostSun Sep 26, 2021 8:40 pm

Thanks a ton!
I will look into that once I got some spare time. I'd love to make a somewhat reliable little plugin. And parsing is really always no problem. XML or SRT are all very manageable. That's just syntax!

Really appreciate the help :)
Offline

TCP786

  • Posts: 456
  • Joined: Thu Sep 16, 2021 7:05 am
  • Real Name: Cody Predum

Re: Export to SRT from Subtitles in Nested Timeline

PostMon Sep 27, 2021 5:37 am

Very cool Ragnar! If you get your program to a point where you think it'd be worth sharing I'd love to see it (if you want to share it). That's quite a jump start on a potential feature request. Haha.

Speaking of feature requests, it's not a thread, it's a whole sub-forum: viewforum.php?f=33
Offline

RagnarRox

  • Posts: 9
  • Joined: Fri Sep 24, 2021 5:03 pm
  • Real Name: Ragnar Ulricson

Re: Export to SRT from Subtitles in Nested Timeline

PostFri Oct 08, 2021 4:52 pm

Thank you! I'd super love to share it.
I just finished the first full-length video project and put it to the test and had to hammer out some kinks, but it works. Probably gonna refine it in some future projects because at the moment it looks and feels very clunky and sewn together with a hot needle.
Gonna add the feature request in the forum asap!

Return to DaVinci Resolve

Who is online

Users browsing this forum: Ask Jeeves [Bot], Bing [Bot], ghost355, Google [Bot], Johannes Hoffmann, panos_mts and 210 guests