Advertisement
Guest User

preview-thumbnail

a guest
Apr 18th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. Dear Friends,
  2.  
  3. Currently, I am looking for command to create Webvtt for my video by using FFFMPEG.
  4. 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)
  5. Example:
  6. WEBVTT
  7.  
  8. 00:00.000 --> 00:10.000
  9. /thumbnails/thumbnail1.jpg
  10.  
  11. 00:10.001 --> 00:20.000
  12. /thumbnails/thumbnail2.jpg
  13.  
  14. 00:20.001 --> 00:30.000
  15. /thumbnails/thumbnail3.jpg
  16.  
  17. What I did so far:
  18.  
  19. I get duration for video (Cause: requirement required 100 sections for each video)
  20. #Get duration of mp4 file need to generate thumbnail
  21. duration="$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $video)"
  22. Then, I creating thumbnail with duration above:
  23. #Create folder to store thumbnail if not exist.
  24. mkdir -p $BASEDIR/$filename
  25.  
  26. #Create thumbnail with size 200:100
  27. 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
  28.  
  29. Now, I was successful to create thumbnail as I wish, but for creating Webvtt, I still looking the document and googling with no sign.
  30.  
  31. Please someone help to point me the correct way or suggestion.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement