0

I have 1 video viral and 30 video for fun. They have different durations.How to overlay "Video Viral" intro end 30 video ( before the video ends 30 seconds )

example image below:

enter image description here

Please give me a solution using ffmpeg and ffprobe in one line cmd

cubick
  • 293
  • 3
  • 13
rinofcan
  • 323
  • 1
  • 3
  • 9
  • *"Please give me a solution using ffmpeg and ffprobe in one line cmd"* Answer depends on your OS/shell/scripting language. – llogan Sep 04 '20 at 19:57
  • I use windows. and run the command line on cmd. Please help me – rinofcan Sep 05 '20 at 07:06
  • I have read comments on this post of you: https://stackoverflow.com/a/49969391/7683471 I think I just need to change the ffmpeg command again – rinofcan Sep 05 '20 at 09:00
  • ```for f in *.mp4; do``` ```cut_duration=30``` `input_duration=$(ffprobe -v error -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 "$f")` `output_duration=$(bc <<< "$input_duration"-"$cut_duration")` `ffmpeg -i %%f -i viral.mp4 -filter_complex "[0:v][1:v]overlay=enable='between(t,%output_duration%,%input_duration%)'" out.mp4` – rinofcan Sep 05 '20 at 09:10
  • >But I can't run it. I copied the code and put it in Code.bat. I put them in the same folder (ffprobe.exe ffmpeg.exe) – rinofcan Sep 05 '20 at 09:16
  • That answer you linked is for Bash which is available on Linux and macOS. I think it works on Windows if you use [WSL](https://learn.microsoft.com/en-us/windows/wsl/install-win10), but I don't have any experience with that. Otherwise, I recommend changing your question to how to do the same thing as the bash answer but in Windows batch. – llogan Sep 08 '20 at 17:13

0 Answers0