Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nihelmasell opened this issue Jun 27, 2022 · 4 comments

Comments

@nihelmasell
Copy link

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!

@retokromer
Copy link
Member

@nihelmasell Thank you for posting.
@ablwr Should this be moved to discussions?

@nihelmasell
Copy link
Author

@nihelmasell Thank you for posting.
@ablwr Should this be moved to discussions?

Sorry, Professor Kromer. I didn't know where to post.

@ablwr
Copy link
Member

ablwr commented Jun 27, 2022

I think we decided to not use discussions -- we should probably remove it from the list, too. This is a great place to ask this question! I don't have the time to jump into it right now but perhaps someone else will!

@retokromer
Copy link
Member

I see you have closed #451 now, which got me confused. Sorry for the noise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants