I hope you can help me with this. I am trying to find a simple way to merge videos clips by using a list of file paths of these videos. For example:
Would you have a good solution for me? Thank you!
+ Reply to Thread
Results 1 to 17 of 17
Different resolutions is a problem - you will have issues muxing, playing on various platforms . It will be inconsistent at best . Theoretically it's possible with a transport stream, but some players might still have problems
If you want it to reliably playback everywhere without problems, you need a uniform resolution - this means re-encoding at least some of them, then running the concat demuxer
Different frame rates are not a problem per se - the concat demuxer will produce a VFR (variable frame rate) output
"Easiest" way would be to drop them on a NLE timeline, and let it handle the conversions automatically
"Best" way would be to analyze each one, in the context of the desired output, and customize the transform applied to each clip
Not sure how to import a simple list of file locations in an editor. A XML or EDL is much differently formatted, much more complicated, but includes all the edits along with the clip references
Normally you'd import a folder, or shift select. But if they were in various locations, that would become tedious with all the navigation. How many files are you dealing with ?
When you use a NLE, understand that likely you're going to be re-encoding all of them (quality loss, unless you use a lossless codec but that will massively increase the filesize), and conformed to a single specification (frame rate, resolution) . Sometimes the "auto" transform might be undesireable (sometimes there are better ways to do it, in terms of quality)
You could possibly do it in an avisynth script, but depending on what you files were, how many, what type of video you wanted to end up with, there might be other problems
What types of framerates and resolutions do you have ?
E.g. if you wanted to conform to 1280x720, 30/1 FPS , where the framerate conversion inserted duplicates or deleted frame to achieve the desired framerate - it might look something like this
A = FFmpegSource2("C:\Video Files\Coral.mp4", atrack=-1).Spline36Resize(1280,720).ChangeFPS(30) B = FFmpegSource2("C:\Video Files\Coral1.mp4", atrack=-1).Spline36Resize(1280,720).ChangeFPS(30) C = FFmpegSource2("C:\Video Files\Coral2.mp4", atrack=-1).Spline36Resize(1280,720).ChangeFPS(30) . . . A ++ B ++ C ++....
Then you 'd just encode that script in some program like ffmpeg, or staxrip, or megui, or anything that accepts avs scripts
I thought ffmpeg could do the same. So maybe I need to find an editor that can import the clips with a file paths lists. But which one can do so? I have no idea what is the format of a xml for Resolve. Is it very complex?
Last edited by vmackey; 23rd Jul 2023 at 17:17.
But are the 1000's of clips all in different locations, folders ?
I don't think you can add other commands like -vf scale , fps etc.. to conform them like a NLE timeline for concat protocol or demuxer .
So maybe I need to find an editor that can import the clips with a file paths lists. But which one can do so? I have no idea what is the format of a xml for Resolve. Is it very complex?
I think xml is going to be too complicated for your situation. Just export a .xml from a previous project and open in a text editor to get an idea if this will work for you
I tried to get DavinciResolve XML and look at it, but it is too difficult to construct, but there might be another way:
DavinciResolve project can be constructed thru python API module called DavinciResolveScript.py that comes with Davinci supposedly. The way I understand it, you open DavinciResolve, perhaps empty project and then you run your custom script (that reads your list files) and constructs timeline from your clips. So it can live communicate with current Davinci open project. Or you just open default Davinci project with your custom python script and construct timeline afterwords from that video list. Doing that just by one click, it sounds amazing, but that is based just on watching that video, did not test it myself, I do not have or use Davinci Resolve.
I actually found this thread here about someone coding the very thing we are talking about. https://python-forum.io/thread-32308.html However I am not familiar with python or resolve's API (I'm not a coder), so I am not sure where to begin.
It might take some time, sure, might not go with it I definitely might look into that later (winter projects), to see if it is possible like to export a project by scripting as well, that would be awesome.
Learning python would be a start, it would make things easy. If not knowing python syntax, it might be difficult to understand procedures. The same happens with vapoursynth users (using avisynth before, not knowing python, just guessing syntax, but going back to avisynth right away being overwhelmed by a syntax). Downloading python depends on OS then learning basics. How to create a script in a chosen python editor like idle, which is very easy, it comes with python if using windows or pycharm (more difficult) or other editors. You can use even notepad, but that would be hard with no highlights etc. Idle seams ok when you start.
Guy over here explains it very slowly and basics: https://www.youtube.com/watch?v=2ZtkLXDpNhM
-creating a python script that opens empty davinci resolve,
-another script that imports media to Davinci media storage, basically all media from a directory path
-another script that creates a timeline and adds media to it from media storage
-other script that does the same as above but more easily , where a timeline is just created directly from a media storage clips
this video: https://www.youtube.com/watch?v=HmUubTM57tU automatically opens existing davinci project (just some headers, tiff, lower thirds), adds clips, and applies existing coloring (grading using existing drx file):
-script that loads that existing project and adds new timeline with new clips
-another script that adds some grading - davinci drx file ,whis are a sum of effects, color grading previously exported from some project to either all timelines or all clips of just one timeline
Last edited by _Al_; 24th Jul 2023 at 18:35.
Thanks Al. I will try to check python hoping I won't get too lost learning coding. I'll try to get into it.
Meanwhile, regarding the first solution given (merging with ffmpeg) I have tried to re-process all my files with resolve, and gave to each clip the same resolution and frame rate (1920x1080 - 24fps), but even with this, the output file still has the same lagging issue. Is there another factor that can create these issues with ffmpeg, beside the resolution and frame rate?