amiaopensource / amiaopensource/ffmprovisr

Inserting timecode into video/ Outputting filename with timecode as filename.

Open
#461 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
581
Forks
74
PR merge metrics
No merged PRs in 30d

Description

Hi, I recently tried to export one image every ten seconds of a video, outputting files named image-00:00:10:00.jpg image-00:00:20:00.jpg , image-00:00:30:00.jpg , etc. Your formula explains how to export an image from a video, or to create a burnt in timecode on your image. But the problem is: a) when you want every 10-second capture to have the timecode inserted into the name of the filename itself and b) when you do not want to create a burnt in timecode FOR ALL IMAGES being output, but just for the ones exported every X seconds. In my case I want to have any of those solutions, that is, having filenames labeled as timecode position or having images with the timestamp inserted into the image itself. The best solution I came up with is the following:
$ ffmpeg -i myvideo.mp4 -r 0.1 -vf "drawtext=fontfile=/usr/share/fonts/TTF/Vera.ttf:fontsize=35:timecode='00\:00\:00\:00':r=25: x=(w-tw)/2:y=h-(2*lh):fontcolor=white:box=1:boxcolor=0x00000000@1" image-%03d.png

I noticed it is quite precise, but you have to adjust the frame rate for EACH VIDEO inside the filter argument. And I haven't found a solution for, instead of printing the timecode into the image, just labeling the filename with it. I just wanted to share this scenario, in case someone encounters the same issue in the future, and in case someone can help me with the second option, that is, labeling a file just with a timecode, without it being stamped inside.

This is very useful when you have hundreds of tapes digitized "in toto", and want to make a quick index of them, without using contact sheets and using a program like Xnview to browse the albums and zoom in into a more quality picture.

Best regards, and thanks for publishing these great guides!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.