Skip to content

Commit

Permalink
[fix] change thumbnail point is half point of video duration.
Browse files Browse the repository at this point in the history
  • Loading branch information
popper2710 committed May 12, 2020
1 parent 0738ae8 commit 7835ff7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 5 additions & 2 deletions app/create-vod-hls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,10 @@ echo -e "Executing command:\nffmpeg ${misc_params} -i ${source} ${cmd}"
ffmpeg ${misc_params} -i ${source} ${cmd}

# create master playlist file
echo -e "${master_playlist}" > ${target}/playlist.m3u8
ffmpeg -i ${source} -ss 30 -vframes 1 -f image2 -s 1920x1080 ${target}/thumb.jpg
echo -e "${master_playlist}" > "${target}"/playlist.m3u8

# create thumbnail
thumbnail_time=$(echo "$(ffprobe -v error -select_streams v:0 -show_entries stream=duration -of default=noprint_wrappers=1:nokey=1 ${source}) / 2" | bc || echo "")
ffmpeg -i "${source}" -ss "${thumbnail_time}" -vframes 1 -f image2 -s 1920x1080 "${target}"/thumb.jpg

echo "Done - encoded HLS is at ${target}/"
1 change: 0 additions & 1 deletion db/data/.gitignore

This file was deleted.

0 comments on commit 7835ff7

Please sign in to comment.