[FFmpeg-user] [ffmpeg-user] Auto generate Webvtt

Tri Quang Nguyen triqn at gcs-vn.com
Wed Apr 18 05:30:16 EEST 2018


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<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:


  1.  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)"

  1.  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.

Thanks and Best Regards,
Tri Nguyen


 This e-mail is intended solely for the person or entity to which it is addressed and may contain
 confidential and/or privileged information. Any review, dissemination, copying, printing or other 
 use of this e-mail by persons or entities other than the addressee is prohibited. If you have received
 this e-mail in error, please contact the sender immediately and delete the material from any computer. (HCVN0116) 


More information about the ffmpeg-user mailing list