I want to write a script that will automatically convert a mkv file between PAL and NTST codecs. As this involves changing the speed and pitch of the video to match framerates, I need to offset all related timestamps as well. I've already mostly figured out how to do that for chapter files, but not yet for the timestamps in MPEG files or subtitle files (dvdsub/PGA).
Now I know plenty of software already exists out there that can do this, but that's not what I'm asking for. I want to know how to edit videos myself, so that I may automate the process. Whether, through a shell program like ffmpeg, or by writing my own c program to do it.
My assumption on how I can do this involves first, exporting the timestamps in the form of plain text, second, search for and edit vales on the text, and third, import the text file back into the mkv container.
My problem thus far has been that any time I search for information on how to edit these things, I get results for editing software that does it for you, instead of tutorials on how to do it yourself. Any advice?
+ Reply to Thread
Results 1 to 2 of 2
-
-
Generally speaking, ffmpeg is the only viable choice if you want loseless transformations in a scripting way.
Split your problem into parts and maybe ask here specific questions like "change framerate from 50 to 60"...
Or if you have very complicated pipeline, maybe write python script, where you can bind ffmpeg or use video framework like OpenCV (https://docs.opencv.org/3.4/da/df6/tutorial_py_table_of_contents_setup.html , aimed for computer vision, but you can do standard operations on frames just in few lines)
Scripting tools are behaving perfectly fine in Linux environment, thats the place where most of them are created, so if you are Windows user, invest few minutes and install WSL (Windows Subsystem for Linux) where you can script and have Windows with graphical tools and players at the same moment
HTH
Similar Threads
-
--
By Anonymous84 in forum Video ConversionReplies: 2Last Post: 17th Apr 2022, 16:33 -
.mkv files - edit subs
By puternut in forum SubtitleReplies: 4Last Post: 17th Mar 2022, 17:21 -
Simple editing/cutting software for .mkv files?
By rotchild in forum Newbie / General discussionsReplies: 5Last Post: 21st Jan 2022, 02:20 -
.sup files missing lines when OCRing or editing directly
By sullivan003 in forum SubtitleReplies: 0Last Post: 18th Apr 2020, 04:18 -
Edit / Add Codec ID in MKV files
By Lokotito in forum EditingReplies: 4Last Post: 28th Jan 2020, 14:48