Docker-Mini-CCTV-NVR/Dockerfile_recorder

12 lines
862 B
Plaintext
Raw Permalink Normal View History

FROM alpine:latest
RUN apk update && apk upgrade && apk add --no-cache ffmpeg
WORKDIR /data
# For .mkv files
CMD ffmpeg -hide_banner -loglevel warning -threads 6 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i "$NP_CCTV_URL" -f segment -segment_time 10 -reset_timestamps 1 -segment_format matroska -strftime 1 -c:v copy -tag:v hvcl -bsf:v hevc_mp4toannexb -c:a aac ./%Y-%m-%d_%H-%M-%S.mkv
# For .mp4 files (Unused)
#CMD ffmpeg -hide_banner -loglevel warning -threads 6 -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -timeout 5000000 -use_wallclock_as_timestamps 1 -i "$NP_CCTV_URL" -f segment -segment_time 10 -reset_timestamps 1 -segment_format mp4 -strftime 1 -c:v copy -tag:v hvcl -bsf:v hevc_mp4toannexb -c:a aac ./%Y-%m-%d_%H-%M-%S.mp4