├── Dockerfile ├── README.md └── copy_thumbs.sh /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM jrottenberg/ffmpeg 2 | LABEL maintainer="Rupak Ganguly " 3 | 4 | RUN apt-get update && \ 5 | apt-get install python-dev python-pip -y && \ 6 | apt-get clean 7 | 8 | RUN pip install awscli 9 | 10 | WORKDIR /tmp/workdir 11 | 12 | COPY copy_thumbs.sh /tmp/workdir 13 | 14 | ENTRYPOINT ffmpeg -i ${INPUT_VIDEO_FILE_URL} -ss ${POSITION_TIME_DURATION} -vframes 1 -vcodec png -an -y ${OUTPUT_THUMBS_FILE_NAME} && ./copy_thumbs.sh 15 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # docker-ffmpeg-thumb 2 | 3 | Derived from the base [jrottenberg/ffmpeg](https://hub.docker.com/r/jrottenberg/ffmpeg/) docker image, this image encapsulates the creation of a thumbnail image from a video file. 4 | 5 | ## Build image 6 | 7 | ``` 8 | docker build -t rupakg/docker-ffmpeg-thumb . 9 | ``` 10 | 11 | ## Run 12 | 13 | ``` 14 | docker run -v /local/path:/tmp/workdir \ 15 | -e INPUT_VIDEO_FILE_URL='your-video-file-url' \ 16 | -e POSITION_TIME_DURATION='position-of-frame-in-video' \ 17 | -e OUTPUT_VIDEO_FILE_NAME='output.png' \ 18 | rupakg/docker-ffmpeg-thumb 19 | 20 | ``` 21 | After running the above command, the thumbnail image `output.png` will be created in the mounted `/local/path`. 22 | -------------------------------------------------------------------------------- /copy_thumbs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "Copying ${OUTPUT_THUMBS_FILE_NAME} to S3 at ${OUTPUT_S3_PATH}/${OUTPUT_THUMBS_FILE_NAME} ..." 4 | aws s3 cp ./${OUTPUT_THUMBS_FILE_NAME} s3://${OUTPUT_S3_PATH}/${OUTPUT_THUMBS_FILE_NAME} --region ${AWS_REGION} 5 | --------------------------------------------------------------------------------