I want to crop the material now. I checked with ffplay and this works:
ffmpeg -i WESTERBORK_2019_Resto(with_dupes_without_pretitles ).mp4 -filter:v "crop=693:520:134:10" -c:a copy Westerbork_cropped.mp4
how can I combine ths command with the framecount burn in?
ffmpeg -i Westerbork_cropped.mp4 -vf decimate=cycle=3,drawtext=fontfile=Arial.ttf:fonts ize=25:fontcolor=white:text=''%{frame_num}:borderc olor=black:borderw=2=20:y=20 Westerbork_cropped_framerate.mp4
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 31 to 39 of 39
Thread
-
-
Add the crop and a comma between the -vf and decimate:
Code:-vf crop=693:520:134:10,decimate=cycle=3,drawtext...
-
Thanks!
And one more question about the framecount. I have another case, where I want to burn in a framecount with certain delay. There's a pretitle that shouldn't count, but doesn't have to be removed. Can I substract the exceeding number of frames?
ffmpeg -i Westerbork_cropped.mp4 -vf drawtext=fontfile=Arial.ttf:fontsize=25:fontcolor= white:text=''%{frame_num-120}:bordercolor=black:borderw=2=20:y=20 Westerbork_cropped_framerate.mp4 -
You'd think that would work but it doesn't. You can use "text='%{frame_num}': start_number=120" to start with frame number 120 instead of 0. But it doesn't accept a negative number. I don't have a solution for you.
-
Here's a way you can brute force it with a batch file. Basically, encode the first part without frame numbers, the second part with frame numbers, concatenate the two intermediate files to a third, remux to mp4, then delete the intermediate files:
Code:ffmpeg -y -i input.mp4 -to 00:00:04.8 part1.ts ffmpeg -y -ss 00:00:04.8 -i input.mp4 -vf drawtext=fontfile=C\\:/Windows/fonts/arial.ttf:fontcolor=white:text='%%{frame_num}':bordercolor=black:borderw=2:x=20:y=20 part2.ts copy/b part1.ts+part2.ts all.ts ffmpeg -y -i all.ts -c copy output.mp4 del part1.ts del part2.ts del all.ts
-
you can use filter_complex graph
split the input - one with intro [a] , one with main [b] , and -vf trim the clips to desired range, where -vf drawtext framenumbering is applied to [b], then -vf concat for the output node
https://ffmpeg.org/ffmpeg-filters.html#trim
(note the end_frame arg is exclusive, not inclusive in ffmpeg -vf trim)
https://ffmpeg.org/ffmpeg-filters.html#toc-concat
ffmpeg is a bit tricky, in that everything runs on timestamps, so whenever you trim you need to insert a setpts filter
In this 600 frame, 25fps example, 0-99 (inclusive) is the intro , 100-599 (inclusive) is the main part that has drawtext applied (frame 100 would start with "zero")
Code:ffmpeg -i input.mp4 -filter_complex "split[a][b]; [a]trim=start_frame=0:end_frame=100,setpts=N/(25*TB)[a2]; [b]trim=start_frame=100:end_frame=600,setpts=N/(25*TB), drawtext=fontfile='C\:\\Windows\\Fonts\\Arial.ttf':fontsize=25:fontcolor= white:text=''%{frame_num}:black:borderw=2:x=20:y=20[b2]; [a2][b2]concat[out]" -map [out] -c:v libx264 -crf 20 -an output.mp4
-
-
a cool! Actually I don't need the intro anyway. I guess it would it be much easier to simply cut off the intro and then burn the framerate into th rest?
-
Yes. One line of my "brute force" batch file does exactly that, by time, not frame number. 120 frames at 25 fps is 4.8 seconds (120 / 25):
Code:ffmpeg -ss 00:00:04.8 -i input.mp4 -vf drawtext=fontfile=C\\:/Windows/fonts/arial.ttf:fontcolor=white:text='%%{frame_num}':bordercolor=black:borderw=2:x=20:y=20 output.mp4
Similar Threads
-
Have you superscripts numbers using aegisub?
By Patapin in forum SubtitleReplies: 7Last Post: 8th Nov 2019, 03:30 -
JVC serial numbers?
By jtech1 in forum Newbie / General discussionsReplies: 0Last Post: 30th Dec 2018, 17:13 -
Why frame numbers in VirtualDub and Avisynth different?
By Megafox in forum Newbie / General discussionsReplies: 5Last Post: 15th Sep 2018, 11:56 -
Help me figure out the crop numbers
By blue24 in forum Newbie / General discussionsReplies: 1Last Post: 17th Mar 2018, 13:15 -
Display Optional Frame Numbers?
By jfharper in forum EditingReplies: 3Last Post: 8th Feb 2017, 23:38