bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
10.69k stars 1.39k forks source link

docker image has no tzdata so files are saved with incorect timestamps #3390

Closed dariuskt closed 1 month ago

dariuskt commented 1 month ago

Which version are you using?

docker image latest-ffmpeg v1.8.2

Which operating system are you using?

Describe the issue

files saved in UTC while should be saved in provided timezone

Describe how to replicate the issue

  1. setting filenames to contain time

    recordPath: ./recordings/%path/%Y-%m-%d_%H-%M-%S-%f
  2. starting container with timezone set:

    environment:
      TZ: "Europe/Vilnius"
  3. observe filename time is in UTC

Did you attach the server logs?

no

Did you attach a network dump?

no

Solution

installing tzdata inside container fixes the problem for this run

apk update
apk add tzdata

hope image will contain tzdata by default so timezones will work out of the box

aler9 commented 1 month ago

Hello, just mount /etc/timezone and /etc/localtime from the host:

docker run --rm -it -v /etc/timezone:/etc/timezone:ro /etc/localtime:/etc/localtime:ro bluenviron/mediamtx

we cannot add tzdata or any other packet to the base image since it's not based on any Operative System, while the -ffmpeg image is based on Alpine and the -rpi image is based on Raspbian.