butterw
18th July 2010, 13:32
I need to save specific frames from a video with corresponding hardcoded text.
The text to hardcode contains the framenumber and a specific text (which could be contained in a subtitle file).
I'm not unsure whether avisynth is the right tool to do this ?
Here's what I've come up with:
# This first script basically does what I want, but takes too long time to finish as the video could be several hours long:
AVISource("e:\WEB_0009b.avi", pixel_type="RGB24")
Subtitle( " #000025\n" + " V25 xxxx", lsp=10, first_frame=25, last_frame=25)
Imagewriter("e:\", 25, 25, type="jpg")
Subtitle( " #045000\n" + " V45000 acfdlll", lsp=10, first_frame=45000, last_frame=45000)
Imagewriter("e:\", 45000, 45000, type="jpg")
# To cut down the time required to run the script, it would make sense to select only the frames of interest:
AVISource("E:WEB_0009b.avi", pixel_type="RGB24")
Trim(25,-1) + Trim(45000,-1)
Imagewriter("E:\", type="jpg")
I may have far more than 2 frames to save, so I'm looking for an automated solution. I was thinking of using Python to generate the required avs script.
Any Suggestions ?
The text to hardcode contains the framenumber and a specific text (which could be contained in a subtitle file).
I'm not unsure whether avisynth is the right tool to do this ?
Here's what I've come up with:
# This first script basically does what I want, but takes too long time to finish as the video could be several hours long:
AVISource("e:\WEB_0009b.avi", pixel_type="RGB24")
Subtitle( " #000025\n" + " V25 xxxx", lsp=10, first_frame=25, last_frame=25)
Imagewriter("e:\", 25, 25, type="jpg")
Subtitle( " #045000\n" + " V45000 acfdlll", lsp=10, first_frame=45000, last_frame=45000)
Imagewriter("e:\", 45000, 45000, type="jpg")
# To cut down the time required to run the script, it would make sense to select only the frames of interest:
AVISource("E:WEB_0009b.avi", pixel_type="RGB24")
Trim(25,-1) + Trim(45000,-1)
Imagewriter("E:\", type="jpg")
I may have far more than 2 frames to save, so I'm looking for an automated solution. I was thinking of using Python to generate the required avs script.
Any Suggestions ?