I'm looking for a tool (or tools) that will run under linux (debian, specifically) that is capable of overlaying dynamic text to a video via a command given from the command line. This would be in similar to subtitles, but I require more flexibility.
To give you an idea of what I'm after, I'll describe what I currently have set up.
I work for a football club. Each week a game is filmed and we are given avi (divx) files to do with what we like. I've written a handful of scripts which automate cutting/joining of these files at the coach's request (using mencoder). For example say the coach just wanted 3 clips cut from the game video from 1:23 - 2:16, 14:32 - 14:55 etc...
This is all working fine and great and it's really handy.
What I'd like to be able to do now is overlay various text elements onto the video. To start with, I wanted to be able to display a time stamp of the current game time on the video. So the script would be given the current game time from when the clip starts and the current game time when the clip ends. It would then obviously do any calculations necessary and generate the required command(s) needed to overlay the text.
So just to summarise...
Script inputs:
- Multiple start/end times from parent video (to be cut) eg 10:23 - 10:45
- Current game time associated with each of the above video times eg 12:15 - 12:37
Script outputs:
- Commands to cut/join all the clips with a text overlay displaying the current game time.
(If more explanation is required let me know, I hope you understand)
I tried having the script create .srt files and embedding them using mencoder, I couldn't get this to work properly but this is a rather inflexible option as it's not practical to change absolute positioning, text font/color etc. (from what I can gather mencoder has a vertical position option for subtitles with a few arbitrary font options).
I've also tried using ffmpeg and the imlib2.so vhook, but this method only allows static text overlays which makes putting a specific timecode on a video difficult. What I originally did was generated a command that updated every second with a new -ss and -t option for each second. This method wasn't practical as it broke up each clip further into 1 second clips which then have to be joined together again but I guess if I can't find a better way I'll have to stick with it.
Does anyone have any other ideas?
+ Reply to Thread
Results 1 to 4 of 4
-
-
I foresee at least one major problem with your solution - complete freedom of text to be overlaid will most likely result in the need for re-encoding the video.
That said, it is possible to run avisynth under wine, so I believe. Avisynth is ideal for most of what you want to do, up until the output, which will be uncompressed video and will have to be encoded to a more suitable format.Read my blog here.
-
I've used cinelerra for video editting. The learning curve is steep, and it's way more powerful than what you need, but it's a great tool. You might get some more ideas of cool things to do with the video by using it. It's gui based, but there might be a scripting language. I'm not sure.
Let me know if you want a tutorial video, I can send it to you. Actually, I'm not sure I know how to do a clock (changing text). But if you had a video of one, you could overlay it.
bill
Similar Threads
-
Easiest way to convert .sub to .srt? maybe some command line tool?
By clinique in forum SubtitleReplies: 2Last Post: 23rd Feb 2010, 12:42 -
Command line tool to demultiplex video
By lovyagin in forum EditingReplies: 6Last Post: 20th Dec 2009, 12:43 -
Command line tool to take AVI samples
By Dean C in forum EditingReplies: 6Last Post: 9th Sep 2008, 05:55 -
Command Line Tool that will output Re-Encoded Audio
By Maikeru-sama in forum Video ConversionReplies: 11Last Post: 13th Jan 2008, 00:56 -
Command-Line Tool to Join Videos?
By RobDude in forum EditingReplies: 1Last Post: 4th Jul 2007, 12:53