Automatically placing texts on each frame from a file.

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

amdavid

  • Posts: 38
  • Joined: Tue Feb 05, 2019 9:27 am
  • Real Name: Anton David

Automatically placing texts on each frame from a file.

PostWed May 22, 2024 12:54 pm

Hello
I have some texts that need to be placed in each frame of the video. I will have the text and position in a text-based file (CSV, JSON, or text). This cannot be done manually because the videos are far too long. At the moment, I am creating PNGs for each frame and overlaying them on top of the video. There are two problems with this: it takes time for Python scripts to create PNGs for each frame, and my hard disk fills up very quickly if I have to edit more than one event at a time. Can someone tell me if there is a way to push the desired texts to each frame directly? I am not shy about getting my hands dirty – I am happy to write scripts.

Thank you
Offline
User avatar

Dan Anon

  • Posts: 21
  • Joined: Thu Mar 28, 2024 12:17 am
  • Real Name: Dan D'Eon

Re: Automatically placing texts on each frame from a file.

PostWed May 22, 2024 7:07 pm

Hmmm. how curious. Can you tell us more about this project/workflow?

amdavid wrote: ...the videos are far too long.


How long are they?

amdavid wrote: ...I am creating PNGs for each frame.


Wait. *Each* frame? For a "far too long" video I can believe it's taking time and that your HD is full.

From the outside looking in, I wonder if your approach isn't taking longer than if you were simply building gfx and inserting them by hand.

Please share more project details.
Dan
Resolve 18.6.6
Sonoma 14.4.1
Mac Studio M2 Max 64GB

BetterLifeTV.tv
Offline

amdavid

  • Posts: 38
  • Joined: Tue Feb 05, 2019 9:27 am
  • Real Name: Anton David

Re: Automatically placing texts on each frame from a file.

PostWed May 22, 2024 9:46 pm

@dan
Hi
Basically, these videos are action rides from multiple GoPro cameras. I will have information on the altitude, GPS location, and speed etc.. for each second. In order to smooth out the display, values will be calculated for the frames. In other words, values will change throughout the frames, not just every second.

I can't edit the video before placing the values; otherwise, the values won't sync. I need all the overlays on the video before I chop it up; hence, the total overlay PNGs are large. I can live with the disk space but the time it takes to create the PNGs is unacceptable, even with multiple threads kicked off to create the assets. I need the overlays for the whole 2 or 3 hours of video footage, even if I am only aiming to create a 10-minute output.


This is one of the videos:

All the overlays are PNGs

So I looking for some sort of solution/script that can read the values from text file and place the text in each frame.

Thank you.
Offline
User avatar

Igor Riđanović

  • Posts: 1621
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: Automatically placing texts on each frame from a file.

PostWed May 22, 2024 9:56 pm

Yes, use Fusion comps for text overlay and automate the generation using the text strings from your data.

This many Fusion comps could present a challenge for Resolve. Maybe there could be a RAM issue, maybe a DB issue. But you could test this out by manually pasting however many thousands of Fusion comps you'd need on a timeline. It should only take a minute or two. I don't think it would matter that all the Fusion comps are the same for the purpose of the test.
www.metafide.com - DaVinci Resolve™ Apps
Offline
User avatar

Dan Anon

  • Posts: 21
  • Joined: Thu Mar 28, 2024 12:17 am
  • Real Name: Dan D'Eon

Re: Automatically placing texts on each frame from a file.

PostWed May 22, 2024 10:30 pm

@amdavid:

Ok. That is - uh - wow. My mind is now boggled as to dealing with all the data and turning it into useable "live" gfx. TIL indeed.

I shall pull up a chair and simply be quiet, as I can offer no help. Thanks for sharing, and nice work!

Dan
Resolve 18.6.6
Sonoma 14.4.1
Mac Studio M2 Max 64GB

BetterLifeTV.tv
Offline
User avatar

visualfeast

  • Posts: 653
  • Joined: Sat May 19, 2018 6:51 pm
  • Real Name: BEN JORDAN

Re: Automatically placing texts on each frame from a file.

PostThu May 23, 2024 1:44 am

I’ve only done graphics similar to that via After Effects. I’d do the frame extrapolation of data in a spreadsheet, then feed cells to AE (not sure how in Fusion, but maybe this would help: viewtopic.php?f=22&t=188205).

Some AE examples:
https://medium.com/ridedata/how-to-make ... fbe3962f69

https://creativecow.net/forums/thread/a ... -txt-file/

And then a way to do it via external software/plugins:
https://goprotelemetryextractor.com/


Sent from my iPad using Tapatalk
•14700K/96G/4080SuperFE/24TB RAID/PA278CGV(x2)/U2415(x1)/StreamDeckXL+15
•5950x/64G/3080ti/80TB RAID/Intensity Pro 4K/U2415(x2)/Shogun 7/HPE LTO6/StreamDeck15
•ZBook 17 G3/64G/Quadro M5000M
•Inspiron 16+/32G/RTX3060
Studio v18.6.6/Win10 Pro 22H2
Offline

amdavid

  • Posts: 38
  • Joined: Tue Feb 05, 2019 9:27 am
  • Real Name: Anton David

Re: Automatically placing texts on each frame from a file.

PostThu May 23, 2024 6:22 am

@Dan, No worries, thanks for checking this out.

@Igor, Thank you, yes I was hoping I would see something on Fusion comp but I couldn't figure something out. Do you know any documentation or an example of how to do that?

@Ben, Thanks for the link. My entire setup is Linux-based, so I'm not going to explore AE. I like to keep everything within Resolve. At the moment, I have written some Python scripts to produce all the graphics I need automatically, but I would like to streamline this process within Resolve to eliminate the additional work done by the Python scripts. I'm sure Fusion can do a similar job as AE, but I don't know how.

Thanks
Offline
User avatar

Igor Riđanović

  • Posts: 1621
  • Joined: Thu Jul 02, 2015 5:11 am
  • Location: Los Angeles, Calif.

Re: Automatically placing texts on each frame from a file.

PostFri May 24, 2024 12:33 am

The only official documentation is the README in the developer folder and Fusion 8 Scripting Guide. There is also a good amount of user generated material at Steak Under Water and you will find a GitHub repo here and there.
www.metafide.com - DaVinci Resolve™ Apps
Offline

amdavid

  • Posts: 38
  • Joined: Tue Feb 05, 2019 9:27 am
  • Real Name: Anton David

Re: Automatically placing texts on each frame from a file.

PostFri May 24, 2024 7:38 am

Hi All
Thank you all. For the time being, I am going to stick with the PNG approach as I am short on time to run any new experiments. However, I made a change that reduced the PNG creation time to minutes instead of hours. Basically, I generated all the numbers up to the maximum possible number that I may need, e.g., 0 to 9999 and 0.00 to 9999.99, and then created a soft link for the PNG sequence. That way, I don't have to create a PNG for each frame but instead, create a soft link pointing to the required PNG. This reduced the time and disk space usage by more than 95%. I am happy with that performance, but I have to live with PNG creations outside of Resolve.
As for the map, creating an SVG file and using spline entries worked wonders. I didn't create PNGs for the map animation in the example shown below.

Here is an example of that approach. I know the map animation is a little boring, but since I made changes to the navigation arrow and the orientation.



Again thank you very much for all of your time. If I come across a Resolve based solution, I'll update this thread.

Have a wonderful weekend.

Return to DaVinci Resolve

Who is online

Users browsing this forum: panos_mts, shebbe and 194 guests