Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Dear Friends,
- Currently, I am looking for command to create Webvtt for my video by using FFFMPEG.
- The requirement is creating a webvtt file with preview-thumbnail for using as THEOPlayer (https://support.theoplayer.com/hc/en-us/articles/207460505-Preview-Thumbnails-in-1-X)
- Example:
- WEBVTT
- 00:00.000 --> 00:10.000
- /thumbnails/thumbnail1.jpg
- 00:10.001 --> 00:20.000
- /thumbnails/thumbnail2.jpg
- 00:20.001 --> 00:30.000
- /thumbnails/thumbnail3.jpg
- What I did so far:
- I get duration for video (Cause: requirement required 100 sections for each video)
- #Get duration of mp4 file need to generate thumbnail
- duration="$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $video)"
- Then, I creating thumbnail with duration above:
- #Create folder to store thumbnail if not exist.
- mkdir -p $BASEDIR/$filename
- #Create thumbnail with size 200:100
- ffmpeg -i $video -filter:v scale=200:100:force_original_aspect_ratio=increase,crop=200:100,fps=100/$duration $BASEDIR/$filename/thumbnail%04d.png –benchmark
- Now, I was successful to create thumbnail as I wish, but for creating Webvtt, I still looking the document and googling with no sign.
- Please someone help to point me the correct way or suggestion.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement