savonet / liquidsoap

Liquidsoap is a statically typed scripting general-purpose language with dedicated operators and backend for all thing media, streaming, file generation, automation, HTTP backend and more.
http://liquidsoap.info
GNU General Public License v2.0
1.4k stars 130 forks source link

`track` and `year` metadata tags are set to `0` if absent in `mp3` file #1901

Closed vitoyucepi closed 3 years ago

vitoyucepi commented 3 years ago

Describe the bug If track and year metadata tags are not set in mp3 file, then in metadata they will present as 0.

To Reproduce

  1. Create some mp3 files with ffmpeg without metadata headers.
      ffmpeg \
            -i "input.mp3" \
            -map 0:a \
            -c:a copy \
            -map_metadata -1 \
            "output.mp3"
  2. Get metadata by

      def updateMetadata(newMetadata)
            print(newMetadata)
      end
    
      source.on_track(updateMetadata)

Expected behavior If metadata tags are empty in source file, then they should not present in metadata list.

Version details

Install method Deb package from liquidsoap releases at github

Common issues N/A

toots commented 3 years ago

Thanks for reporting this one. I can't reproduce here. File created like you. Here's my script:

log.level.set(4)

s = single("/tmp/output.mp3")

s.on_metadata(print)

output.dummy(s)

Could you send the final output of your configure run where it lists all the bindings that are enabled? Or else the first line of the logs, where it should also say the same?

Thanks!

vitoyucepi commented 3 years ago

I used artifact from this pipeline https://github.com/savonet/liquidsoap/runs/3612704083

Music generation script ```sh ffmpeg -f lavfi -i "sine=frequency=1000:duration=5" output.mp3 ```
Ffmpeg log ``` ffmpeg version n4.4 Copyright (c) 2000-2021 the FFmpeg developers built with gcc 11.1.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3 libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 Input #0, lavfi, from 'sine=frequency=1000:duration=5': Duration: N/A, start: 0.000000, bitrate: 705 kb/s Stream #0:0: Audio: pcm_s16le, 44100 Hz, mono, s16, 705 kb/s File 'output.mp3' already exists. Overwrite? [y/N] y Stream mapping: Stream #0:0 -> #0:0 (pcm_s16le (native) -> mp3 (libmp3lame)) Press [q] to stop, [?] for help Output #0, mp3, to 'output.mp3': Metadata: TSSE : Lavf58.76.100 Stream #0:0: Audio: mp3, 44100 Hz, mono, s16p Metadata: encoder : Lavc58.134.100 libmp3lame [Parsed_sine_0 @ 0x55ddfc38e8c0] EOF timestamp not reliable size= 40kB time=00:00:04.99 bitrate= 65.0kbits/s speed= 141x video:0kB audio:39kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.562815% ```
Ffprobe log ``` ffprobe version n4.4 Copyright (c) 2007-2021 the FFmpeg developers built with gcc 11.1.0 (GCC) configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-shared --enable-version3 libavutil 56. 70.100 / 56. 70.100 libavcodec 58.134.100 / 58.134.100 libavformat 58. 76.100 / 58. 76.100 libavdevice 58. 13.100 / 58. 13.100 libavfilter 7.110.100 / 7.110.100 libswscale 5. 9.100 / 5. 9.100 libswresample 3. 9.100 / 3. 9.100 libpostproc 55. 9.100 / 55. 9.100 Input #0, mp3, from 'output.mp3': Metadata: encoder : Lavf58.76.100 Duration: 00:00:05.04, start: 0.025057, bitrate: 64 kb/s Stream #0:0: Audio: mp3, 44100 Hz, mono, fltp, 64 kb/s ```
Main.liq ``` settings.log.stdout.set(true) log.level.set(4) s = single("/var/liquidsoap/output.mp3") s.on_metadata(print) output.dummy(s) ```
Liquidsoap log ``` 2021/09/16 13:58:21 >>> LOG START 2021/09/16 13:58:20 [main:3] Liquidsoap 2.0.0 2021/09/16 13:58:20 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] posix-time2=2.0.0 pcre=7.4.6 sedlex=2.3 menhirLib=20210419 curl=0.9.1 dtools=0.4.4 duppy=0.9.2 cry=0.6.5 mm=0.7.2 xmlplaylist=0.1.5 lastfm=0.3.3 ogg=0.7.0 ogg.decoder=0.7.0 vorbis=0.8.0 vorbis.decoder=0.8.0 opus=0.2.0 opus.decoder=0.2.0 speex=0.4.0 speex.decoder=0.4.0 mad=0.5.1 flac=0.3.0 flac.ogg=0.3.0 flac.decoder=0.3.0 dynlink=[distributed with Ocaml] lame=0.3.4 shine=0.2.2 frei0r=0.1.2 fdkaac=0.3.2 theora=0.4.0 theora.decoder=0.4.0 ffmpeg-avutil=1.0.1 ffmpeg-avcodec=1.0.1 ffmpeg-avdevice=1.0.1 ffmpeg-av=1.0.1 ffmpeg-avfilter=1.0.1 ffmpeg-swresample=1.0.1 ffmpeg-swscale=1.0.1 bjack=0.1.6 alsa=0.3.0 ao=0.2.3 samplerate=0.1.6 taglib=0.3.7 ssl=0.5.9 magic=0.7.3 camomile=1.0.2 inotify=2.3 yojson=1.7.0 faad=0.5.0 soundtouch=0.1.9 portaudio=0.2.2 pulseaudio=0.1.4 ladspa=0.2.0 dssi=0.1.3 tsdl=v0.9.8 tsdl_ttf=0 tsdl_image=0 camlimages=4.2.6 cohttp-lwt-unix=2.5.5 prometheus-app=1.1 srt.constants=0.2.0 srt.types=0.2.0 srt.stubs=0.2.0 srt.stubs.locked=0.2.0 srt=0.2.0 lo=0.2.0 gd=1.0a5 2021/09/16 13:58:20 [clock:3] Using native (high-precision) implementation for latency control 2021/09/16 13:58:21 [frame:4] frame.audio.channels set to: 2 2021/09/16 13:58:21 [frame:4] frame.video.default set to: false 2021/09/16 13:58:21 [frame:4] frame.midi.channels set to: 0 2021/09/16 13:58:21 [frame:4] frame.video.width set to: 1280 2021/09/16 13:58:21 [frame:4] frame.video.height set to: 720 2021/09/16 13:58:21 [frame:4] frame.audio.samplerate set to: 44100 2021/09/16 13:58:21 [frame:4] frame.video.framerate set to: 25 2021/09/16 13:58:21 [frame:4] frame.audio.samplerate set to: 44100 2021/09/16 13:58:21 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main. 2021/09/16 13:58:21 [frame:3] Video frame size set to: 1280x720 2021/09/16 13:58:21 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples. 2021/09/16 13:58:21 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks. 2021/09/16 13:58:21 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks. 2021/09/16 13:58:21 [sandbox:3] Sandboxing disabled 2021/09/16 13:58:21 [video.converter:3] Using preferred video converter: ffmpeg. 2021/09/16 13:58:21 [audio.converter:3] Using samplerate converter: ffmpeg. 2021/09/16 13:58:21 [clock:4] Currently 1 clocks allocated. 2021/09/16 13:58:21 [clock.main:4] Starting 1 sources... 2021/09/16 13:58:21 [source:4] Source output.dummy_0 gets up with content kind: {audio=any,video=any,midi=any}. 2021/09/16 13:58:21 [dummy:4] Content type is {audio=pcm(stereo),video=none,midi=none}. 2021/09/16 13:58:21 [source:4] Source single_0 gets up with content kind: {audio=any,video=any,midi=any}. 2021/09/16 13:58:21 [single_0:3] /var/liquidsoap/output.mp3 is static, resolving once for all... 2021/09/16 13:58:21 [decoder.ogg:4] Unsupported file extension for "/var/liquidsoap/output.mp3"! 2021/09/16 13:58:21 [decoder.ogg:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg! 2021/09/16 13:58:21 [decoder.mp4:4] Unsupported file extension for "/var/liquidsoap/output.mp3"! 2021/09/16 13:58:21 [decoder.mp4:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg! 2021/09/16 13:58:21 [decoder.aac:4] Unsupported file extension for "/var/liquidsoap/output.mp3"! 2021/09/16 13:58:21 [decoder.aac:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg! 2021/09/16 13:58:21 [decoder.flac:4] Unsupported file extension for "/var/liquidsoap/output.mp3"! 2021/09/16 13:58:21 [decoder.flac:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg! 2021/09/16 13:58:21 [decoder.aiff:4] Unsupported file extension for "/var/liquidsoap/output.mp3"! 2021/09/16 13:58:21 [decoder.aiff:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg! 2021/09/16 13:58:21 [decoder.wav:4] Unsupported file extension for "/var/liquidsoap/output.mp3"! 2021/09/16 13:58:21 [decoder.wav:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg! 2021/09/16 13:58:21 [decoder:4] Available decoders: FFMPEG (priority: 10), MAD (priority: 1) 2021/09/16 13:58:21 [decoder.ffmpeg:4] ffmpeg recognizes /var/liquidsoap/output.mp3 as: audio: {codec: mp3, 24000Hz, 1 channel(s)} and content-type: {audio=pcm(mono),video=none,midi=none}. 2021/09/16 13:58:21 [decoder:4] Selected decoder FFMPEG for file "/var/liquidsoap/output.mp3" with expected kind {audio=pcm(stereo),video=none,midi=none} and detected content {audio=pcm(mono),video=none,midi=none} 2021/09/16 13:58:21 [metadata.flac:4] Unsupported file extension for "/var/liquidsoap/output.mp3"! 2021/09/16 13:58:21 [metadata.flac:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg! 2021/09/16 13:58:21 [metadata.mp4:4] Unsupported file extension for "/var/liquidsoap/output.mp3"! 2021/09/16 13:58:21 [metadata.mp4:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg! 2021/09/16 13:58:21 [decoder.ogg:4] Unsupported file extension for "/var/liquidsoap/output.mp3"! 2021/09/16 13:58:21 [decoder.ogg:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg! 2021/09/16 13:58:21 [single_0:4] Content type is {audio=pcm(stereo),video=none,midi=none}. 2021/09/16 13:58:21 [single_0:3] Prepared "/var/liquidsoap/output.mp3" (RID 0). 2021/09/16 13:58:21 [threads:4] Created thread "clock_main" (1 total). 2021/09/16 13:58:21 [clock:4] Main phase starts. 2021/09/16 13:58:21 [clock.main:3] Streaming loop starts in auto-sync mode 2021/09/16 13:58:21 [threads:4] Created thread "generic queue #1" (1 total). 2021/09/16 13:58:21 [clock.main:3] Delegating synchronisation to CPU clock 2021/09/16 13:58:21 [threads:4] Created thread "generic queue #2" (2 total). 2021/09/16 13:58:21 [threads:4] Created thread "non-blocking queue #1" (3 total). 2021/09/16 13:58:21 [threads:4] Created thread "non-blocking queue #2" (4 total). [mp3float @ 0x7f675c008540] Could not update timestamps for skipped samples. [("track", "0"), ("on_air_timestamp", "1631800701.00"), ("kind", "{audio=pcm(stereo),video=none,midi=none}"), ("year", "0"), ("decoder", "FFMPEG"), ("filename", "/var/liquidsoap/output.mp3"), ("temporary", "false"), ("tsse", "Lavf58.76.100"), ("initial_uri", "/var/liquidsoap/output.mp3"), ("encoder", "Lavf58.76.100"), ("status", "playing"), ("on_air", "2021/09/16 13:58:21"), ("rid", "0")] ^C2021/09/16 13:58:22 [main:3] Shutdown started! 2021/09/16 13:58:22 [main:3] Waiting for main threads to terminate... 2021/09/16 13:58:22 [threads:4] Waiting for thread clock_main to shutdown 2021/09/16 13:58:22 [single_0:4] Finished with "/var/liquidsoap/output.mp3". 2021/09/16 13:58:22 [clock.main:3] Streaming loop stopped. 2021/09/16 13:58:22 [threads:4] Thread "clock_main" terminated (0 remaining). 2021/09/16 13:58:22 [main:3] Main threads terminated. 2021/09/16 13:58:22 [threads:3] Shutting down scheduler... 2021/09/16 13:58:22 [threads:4] Thread "generic queue #2" terminated (3 remaining). 2021/09/16 13:58:22 [threads:4] Thread "non-blocking queue #1" terminated (2 remaining). 2021/09/16 13:58:22 [threads:4] Thread "non-blocking queue #2" terminated (1 remaining). 2021/09/16 13:58:22 [threads:3] Scheduler shut down. 2021/09/16 13:58:22 [threads:4] Thread "generic queue #1" terminated (0 remaining). 2021/09/16 13:58:22 [main:3] Cleaning downloaded files... 2021/09/16 13:58:22 [main:3] Freeing memory... ```
toots commented 3 years ago

Thanks for these details. I stil cannot reproduce with the same optional dependencies. Could be the underlying versions.

Could you try the following:

Thanks!

vitoyucepi commented 3 years ago
["FFMPEG", "FLAC", "MP4", "OGG", "TAGLIB", "ID3V2"]

It was taglib

["TAGLIB"]
2021/09/17 18:12:00 >>> LOG START
2021/09/17 18:12:00 [main:3] Liquidsoap 2.0.0
2021/09/17 18:12:00 [main:3] Using: bytes=[distributed with OCaml 4.02 or above] posix-time2=2.0.0 pcre=7.4.6 sedlex=2.3 menhirLib=20210419 curl=0.9.1 dtools=0.4.4 duppy=0.9.2 cry=0.6.5 mm=0.7.2 xmlplaylist=0.1.5 lastfm=0.3.3 ogg=0.7.0 ogg.decoder=0.7.0 vorbis=0.8.0 vorbis.decoder=0.8.0 opus=0.2.0 opus.decoder=0.2.0 speex=0.4.0 speex.decoder=0.4.0 mad=0.5.1 flac=0.3.0 flac.ogg=0.3.0 flac.decoder=0.3.0 dynlink=[distributed with Ocaml] lame=0.3.4 shine=0.2.2 frei0r=0.1.2 fdkaac=0.3.2 theora=0.4.0 theora.decoder=0.4.0 ffmpeg-avutil=1.0.1 ffmpeg-avcodec=1.0.1 ffmpeg-avdevice=1.0.1 ffmpeg-av=1.0.1 ffmpeg-avfilter=1.0.1 ffmpeg-swresample=1.0.1 ffmpeg-swscale=1.0.1 bjack=0.1.6 alsa=0.3.0 ao=0.2.3 samplerate=0.1.6 taglib=0.3.7 ssl=0.5.9 magic=0.7.3 camomile=1.0.2 inotify=2.3 yojson=1.7.0 faad=0.5.0 soundtouch=0.1.9 portaudio=0.2.2 pulseaudio=0.1.4 ladspa=0.2.0 dssi=0.1.3 tsdl=v0.9.8 tsdl_ttf=0 tsdl_image=0 camlimages=4.2.6 cohttp-lwt-unix=2.5.5 prometheus-app=1.1 srt.constants=0.2.0 srt.types=0.2.0 srt.stubs=0.2.0 srt.stubs.locked=0.2.0 srt=0.2.0 lo=0.2.0 gd=1.0a5
2021/09/17 18:12:00 [clock:3] Using native (high-precision) implementation for latency control
2021/09/17 18:12:00 [frame:4] frame.audio.channels set to: 2
2021/09/17 18:12:00 [frame:4] frame.video.default set to: false
2021/09/17 18:12:00 [frame:4] frame.midi.channels set to: 0
2021/09/17 18:12:00 [frame:4] frame.video.width set to: 1280
2021/09/17 18:12:00 [frame:4] frame.video.height set to: 720
2021/09/17 18:12:00 [frame:4] frame.audio.samplerate set to: 44100
2021/09/17 18:12:00 [frame:4] frame.video.framerate set to: 25
2021/09/17 18:12:00 [frame:4] frame.audio.samplerate set to: 44100
2021/09/17 18:12:00 [frame:3] Using 44100Hz audio, 25Hz video, 44100Hz main.
2021/09/17 18:12:00 [frame:3] Video frame size set to: 1280x720
2021/09/17 18:12:00 [frame:3] Frame size must be a multiple of 1764 ticks = 1764 audio samples = 1 video samples.
2021/09/17 18:12:00 [frame:3] Targeting 'frame.duration': 0.04s = 1764 audio samples = 1764 ticks.
2021/09/17 18:12:00 [frame:3] Frames last 0.04s = 1764 audio samples = 1 video samples = 1764 ticks.
2021/09/17 18:12:00 [sandbox:3] Sandboxing disabled
2021/09/17 18:12:00 [video.converter:3] Using preferred video converter: ffmpeg.
2021/09/17 18:12:00 [audio.converter:3] Using samplerate converter: ffmpeg.
2021/09/17 18:12:00 [clock:4] Currently 1 clocks allocated.
2021/09/17 18:12:00 [clock.main:4] Starting 1 sources...
2021/09/17 18:12:00 [source:4] Source output.dummy_0 gets up with content kind: {audio=any,video=any,midi=any}.
2021/09/17 18:12:00 [dummy:4] Content type is {audio=pcm(stereo),video=none,midi=none}.
2021/09/17 18:12:00 [source:4] Source single_0 gets up with content kind: {audio=any,video=any,midi=any}.
2021/09/17 18:12:00 [single_0:3] /var/liquidsoap/output.mp3 is static, resolving once for all...
2021/09/17 18:12:00 [decoder.ogg:4] Unsupported file extension for "/var/liquidsoap/output.mp3"!
2021/09/17 18:12:00 [decoder.ogg:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg!
2021/09/17 18:12:00 [decoder.mp4:4] Unsupported file extension for "/var/liquidsoap/output.mp3"!
2021/09/17 18:12:00 [decoder.mp4:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg!
2021/09/17 18:12:00 [decoder.aac:4] Unsupported file extension for "/var/liquidsoap/output.mp3"!
2021/09/17 18:12:00 [decoder.aac:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg!
2021/09/17 18:12:00 [decoder.flac:4] Unsupported file extension for "/var/liquidsoap/output.mp3"!
2021/09/17 18:12:00 [decoder.flac:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg!
2021/09/17 18:12:00 [decoder.aiff:4] Unsupported file extension for "/var/liquidsoap/output.mp3"!
2021/09/17 18:12:00 [decoder.aiff:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg!
2021/09/17 18:12:00 [decoder.wav:4] Unsupported file extension for "/var/liquidsoap/output.mp3"!
2021/09/17 18:12:00 [decoder.wav:4] Unsupported MIME type for "/var/liquidsoap/output.mp3": audio/mpeg!
2021/09/17 18:12:00 [decoder:4] Available decoders: FFMPEG (priority: 10), MAD (priority: 1)
2021/09/17 18:12:00 [decoder.ffmpeg:4] ffmpeg recognizes /var/liquidsoap/output.mp3 as: audio: {codec: mp3, 44100Hz, 1 channel(s)} and content-type: {audio=pcm(mono),video=none,midi=none}.
2021/09/17 18:12:00 [decoder:4] Selected decoder FFMPEG for file "/var/liquidsoap/output.mp3" with expected kind {audio=pcm(stereo),video=none,midi=none} and detected content {audio=pcm(mono),video=none,midi=none}
2021/09/17 18:12:00 [single_0:4] Content type is {audio=pcm(stereo),video=none,midi=none}.
2021/09/17 18:12:00 [single_0:3] Prepared "/var/liquidsoap/output.mp3" (RID 0).
2021/09/17 18:12:00 [threads:4] Created thread "clock_main" (1 total).
2021/09/17 18:12:00 [clock:4] Main phase starts.
2021/09/17 18:12:00 [threads:4] Created thread "generic queue #1" (1 total).
2021/09/17 18:12:00 [threads:4] Created thread "generic queue #2" (2 total).
2021/09/17 18:12:00 [threads:4] Created thread "non-blocking queue #1" (3 total).
2021/09/17 18:12:00 [threads:4] Created thread "non-blocking queue #2" (4 total).
2021/09/17 18:12:00 [clock.main:3] Streaming loop starts in auto-sync mode
2021/09/17 18:12:00 [clock.main:3] Delegating synchronisation to CPU clock
[mp3float @ 0x7f7a1c008540] Could not update timestamps for skipped samples.
[("track", "0"), ("on_air_timestamp", "1631902320.00"), ("kind", "{audio=pcm(stereo),video=none,midi=none}"), ("year", "0"), ("decoder", "FFMPEG"), ("filename", "/var/liquidsoap/output.mp3"), ("temporary", "false"), ("initial_uri", "/var/liquidsoap/output.mp3"), ("status", "playing"), ("on_air", "2021/09/17 18:12:00"), ("rid", "0")]
^C2021/09/17 18:12:01 [main:3] Shutdown started!
2021/09/17 18:12:01 [main:3] Waiting for main threads to terminate...
2021/09/17 18:12:01 [threads:4] Waiting for thread clock_main to shutdown
2021/09/17 18:12:01 [single_0:4] Finished with "/var/liquidsoap/output.mp3".
2021/09/17 18:12:01 [clock.main:3] Streaming loop stopped.
2021/09/17 18:12:01 [threads:4] Thread "clock_main" terminated (0 remaining).
2021/09/17 18:12:01 [main:3] Main threads terminated.
2021/09/17 18:12:01 [threads:3] Shutting down scheduler...
2021/09/17 18:12:01 [threads:4] Thread "generic queue #1" terminated (3 remaining).
2021/09/17 18:12:01 [threads:4] Thread "generic queue #2" terminated (2 remaining).
2021/09/17 18:12:01 [threads:4] Thread "non-blocking queue #1" terminated (1 remaining).
2021/09/17 18:12:01 [threads:4] Thread "non-blocking queue #2" terminated (0 remaining).
2021/09/17 18:12:01 [threads:3] Scheduler shut down.
2021/09/17 18:12:01 [main:3] Cleaning downloaded files...
2021/09/17 18:12:01 [main:3] Freeing memory...

Here's my dockerfile

FROM ubuntu:20.04@sha256:9d6a8699fb5c9c39cf08a0871bd6219f0400981c570894cd8cbea30d3424a31f

ENV TZ=UTC

# renovate: datasource=repology depName=ubuntu_20_04/curl versioning=loose
ENV CURL_VERSION=7.68.0-1ubuntu2.7
# renovate: datasource=repology depName=ubuntu_20_04/ca-certificates versioning=loose
ENV CA_CERTIFICATES_VERSION=20210119~20.04.1
# renovate: datasource=repology depName=ubuntu_20_04/gosu versioning=loose
ENV GOSU_VERSION=1.10-1ubuntu0.20.04.1

ENV LIQUIDSOAP_DEB="liquidsoap-v2.0.0_2.0.0-ubuntu-focal-1_amd64.deb"

COPY "$LIQUIDSOAP_DEB" "/$LIQUIDSOAP_DEB"

RUN set -eux; \
      apt-get update -y; \
      DEBIAN_FRONTEND=noninteractive \
      apt-get install -y --no-install-recommends \
        ca-certificates="${CA_CERTIFICATES_VERSION}" \
        curl="${CURL_VERSION}" \
        gosu="${GOSU_VERSION}" \
      ; \
      DEBIAN_FRONTEND=noninteractive \
      apt-get install -y --no-install-recommends \
        "/${LIQUIDSOAP_DEB}" \
      ; \
      apt-get autoremove --purge -y; \
      apt-get clean -y; \
      rm -rf \
        /var/lib/apt \
        /var/lib/cache \
        /var/lib/log \
        "/${LIQUIDSOAP_DEB:?}" \
      ;

COPY rootfs /

ENTRYPOINT [ "entrypoint" ]
CMD [ "liquidsoap", "/var/liquidsoap/default.liq" ]

Maybe related to https://taglib.org/api/classTagLib_1_1ID3v2_1_1Tag.html#ae62d0b79a4d706c4650836ed52dac2eb

toots commented 3 years ago

Thanks for your help with this. This should be fixed in both main and v2.0.0 now.

vitoyucepi commented 3 years ago

Are you sure that this should be fixed like this? Maybe something goes wrong here? https://github.com/savonet/ocaml-taglib/blob/abc7aef47aee4a45ff7cbfbaa7b745e0147bd160/src/taglib_stubs.cc#L336

toots commented 3 years ago

We are collecting most tags through the generic Taglib.File.properties. I think your values came from there, which was not filtered for 0, so now we are doing an explicit fetch for those. However, the check for zero value is indeed redundant.

Have you been able to test/confirm the fix?

vitoyucepi commented 3 years ago

Liquidsoap 2.0.0-rc1+git@ce2632f9

[("track", "0"), ("on_air_timestamp", "1632068606.00"), ("kind", "{audio=pcm(stereo),video=none,midi=none}"), ("year", "0"), ("decoder", "FFMPEG"), ("filename", "/var/liquidsoap/output.mp3"), ("temporary", "false"), ("initial_uri", "/var/liquidsoap/output.mp3"), ("status", "playing"), ("on_air", "2021/09/19 16:23:26"), ("rid", "0")]
toots commented 3 years ago

This is weird. We can call the tag decoders directly:

./liquidsoap 'print(file.metadata.taglib("/tmp/output.mp3"))'
[("label", "foobarlol"), ("encoding", "Lavf58.76.100"), ("publisher", "foobarlol"), ("tracknumber", "1")]

Could you try that? Thanks!

vitoyucepi commented 3 years ago

The same with https://github.com/savonet/liquidsoap/actions/runs/1251016098

Config

print(file.metadata.taglib("/var/liquidsoap/output.mp3"))

log.level.set(4)

s = single("/var/liquidsoap/output.mp3")

output.dummy(s)

Log

[("track", "0"), ("year", "0")]
2021/09/19 16:37:29 >>> LOG START
2021/09/19 16:37:28 [main:3] Liquidsoap 2.0.0
toots commented 3 years ago

That's odd. What's your version of taglib?

vitoyucepi commented 3 years ago

The build is based on ubuntu:20.04. So taglib version is 1.11.1+dfsg.1-0.3ubuntu2.

The same with debian:10 and debian:11.

vitoyucepi commented 3 years ago

I've prepared custom container images with artifacts from fa073db.

  1. ubuntu:20.04
  2. debian:11
toots commented 3 years ago

Yeah, I was able to reproduce on ubuntu. I have the same version on OSX here and it does not behave the same way.. Should be fixed now in both main and v2.0.0