Moonbase59 / autocue

On-the-fly JSON song cue-in, cue-out, overlay, replaygain calculation for Liquidsoap, AzuraCast and other AutoDJ software.
https://moonbase59.github.io/autocue/
MIT License
28 stars 3 forks source link

auto_cue not respecting manual set values? #27

Closed LordHelmchen666 closed 3 months ago

LordHelmchen666 commented 3 months ago

Not an issue, more a question to understand auto_cue better. I download news file, get the duration with ffprobe and use Azuracast API to set cross_start_next and cue_out with full duration. Screenshot_20240628_135941 But in LS log it seems it don't use this values. Why?

2024/06/28 13:50:40 [autocue.cue_file:3] Metadata added/corrected for "/var/azuracast/stations/eisradio/media/Syndication/lautfm-news.mp3":
2024/06/28 13:50:40 [autocue.cue_file:3] ("duration", "163.76")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_amplify", "-5.39 dB")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_amplify_adjustment", "0.00 dB")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_blank_skipped", "false")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_blankskip", "0.00")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_cross_start_next", "159.4")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_cue_duration", "159.40")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_cue_in", "0.00")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_cue_out", "159.4")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_fade_in", "0.1")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_fade_out", "0.")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_longtail", "false")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_loudness", "-12.61 LUFS")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_loudness_range", "5.74 LU")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_reference_loudness", "-18.00 LUFS")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_sustained_ending", "true")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_true_peak", "1.040000")
2024/06/28 13:50:40 [autocue.cue_file:3] ("liq_true_peak_db", "0.34 dBFS")
2024/06/28 13:50:40 [autocue.cue_file:3] ("replaygain_reference_loudness", "-18.00 LUFS")
2024/06/28 13:50:40 [autocue.cue_file:3] ("replaygain_track_gain", "-5.39 dB")
Moonbase59 commented 3 months ago

Hmm. A possible reason I could see is that cue_file found a reason to re-analyze the file, then overriding with freshly calculated data. News typically vary in length, maybe that’s it, or—if you pretagged—some diverging parameter between the tags and the station settings (mostly caused by blankskip).

It would be helpful to also see the lines above Metadata added/corrected…, like such:

2024/06/28 22:00:15 [autocue.cue_file:3] Now autocueing: "/var/azuracast/stations/niteradio/media/time/time.niteradio-test-loveit.mp3"
2024/06/28 22:00:15 [autocue.cue_file:3] Blank (silence) skipping active: true, set to 5. s
2024/06/28 22:00:15 [autocue.cue_file:3] Clipping prevention active: true
2024/06/28 22:00:15 [autocue.cue_file:3] Writing tags: false, including ReplayGain: false
2024/06/28 22:00:15 [autocue.cue_file:3] Writing metadata to /tmp/cue_filed1251d.json
2024/06/28 22:00:15 [autocue.cue_file:3] cue_file result for "/var/azuracast/stations/niteradio/media/time/time.niteradio-test-loveit.mp3": {"duration": 7.199999999999999, "liq_cue_duration": 4.9, "liq_cue_in": 2.0, "liq_cue_out": 6.9, "liq_cross_start_next": 6.8, "liq_longtail": false, "liq_sustained_ending": false, "liq_loudness": "-13.99 LUFS", "liq_loudness_range": "5.15 LU", "liq_amplify": "-4.01 dB", "liq_amplify_adjustment": "0.00 dB", "liq_reference_loudness": "-18.00 LUFS", "liq_blankskip": 5.0, "liq_blank_skipped": false, "liq_true_peak": 0.864, "liq_true_peak_db": "-1.27 dBFS"}
2024/06/28 22:00:15 [autocue.cue_file:3] Inserted replaygain_track_gain -4.01 dB and replaygain_reference_loudness -18.00 LUFS
2024/06/28 22:00:15 [autocue.cue_file:3] Given fade-out (0.1 s) < overlay duration (0.1 s), moving cue-out point from 6.9 s to 6.9 s.
2024/06/28 22:00:15 [autocue.cue_file:3] Metadata added/corrected for "/var/azuracast/stations/niteradio/media/time/time.niteradio-test-loveit.mp3":

...

plus the lines from _showmeta for this track, to see if the Liquidsoap integration layer did something odd.

Also, if one of the mandatory tags is missing, cue_file might initiate a new analysis. You can check these using cue_file --help:

The absolute minimum set to (possibly) avoid a re-analysis is:
duration, liq_cross_start_next, liq_cue_in, liq_cue_out,
replaygain_track_gain.

(These might not always be enough.)

I still think the values from the VCE or advanced tab should override even a new analysis, but to see that, we’d need the output from show_meta (=the final values having been used).

P.S.: Did you ever try to just set liq_fade_in and liq_fade_out on a "news" or "time" file? That would avoid all the extra length calculation stuff. I use that with my jingles and "time" announcements (which of course also vary in length), and it works nicely.

This is my setting for above shown variable-length time.niteradio-test-loveit.mp3:

Auswahl_451

LordHelmchen666 commented 3 months ago

Yes. i set fadein/out as in your screenshot. But sometimes it works very well and sometimes it is cutting off the last few seconds. So i tried download the file, pre-tag with cue_file -kwrn, analyse duration with ffprobe and pass this to Azuracast.

curl https://####@api.radioadmin.laut.fm/news/1 --output $directory/temp/lautfm-news.mp3  >>$MAILLOG 2>&1
    cue_file -fkwrn $directory/temp/lautfm-news.mp3 >>$MAILLOG
    LENGTH="$(ffprobe -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$directory/temp/lautfm-news.mp3" 2>/dev/null)" >>$MAILLOG
    mid3v2 -A "laut.fm Nachrichten" -g "News" $directory/temp/lautfm-news.mp3 >>$MAILLOG
    curl -X 'PUT' 'https://stream.eisradio.de/api/station/1/file/6880' -H 'accept: application/json' -H 'X-API-Key: ###' -H 'Content-Type: application/json'  -d '{ "extra_metadata": { "liq_fade_in": "0.1", "liq_fade_out": "0.1", "liq_cue_out": "'$LENGTH'", "liq_cross_start_next": "'$LENGTH'" } }'

When i disable autocue and using smart.crossfade everything works fine.

LordHelmchen666 commented 3 months ago

I did not set liq_cue_in. :( It is nearly rocket science to understand that all. ggg I set it in Azuracast to 0.0. Seems to work now. ffprobe calculated duration is 153,835102

autocue:annotate:title="Nachrichten",artist="lautfm",duration="163.24",song_id="7da67716a6a2b7eb0d748b135b4b890e",media_id="6880",liq_fade_in="0.10",liq_fade_out="0.10",liq_cue_out="153.84",liq_cross_start_next="153.84",liq_cue_in="0.00":media:Syndication/lautfm-news.mp3
2024/06/28 20:06:34 [decoder.ffmpeg:3] Requested content-type for "/var/azuracast/stations/eisradio/media/Syndication/lautfm-news.mp3": {audio=pcm(stereo)}
2024/06/28 20:06:34 [decoder.ffmpeg:3] FFmpeg recognizes "/var/azuracast/stations/eisradio/media/Syndication/lautfm-news.mp3" as audio: {codec: mp3, 44100Hz, 2 channel(s)}
2024/06/28 20:06:34 [decoder.ffmpeg:3] Decoded content-type for "/var/azuracast/stations/eisradio/media/Syndication/lautfm-news.mp3": {audio=pcm(stereo)}
2024/06/28 20:06:34 [autocue.cue_file:3] Now autocueing: "/var/azuracast/stations/eisradio/media/Syndication/lautfm-news.mp3"
2024/06/28 20:06:34 [autocue.cue_file:3] Blank (silence) skipping active: false, set to 0. s
2024/06/28 20:06:34 [autocue.cue_file:3] Clipping prevention active: true
2024/06/28 20:06:34 [autocue.cue_file:3] Writing tags: false, including ReplayGain: false
2024/06/28 20:06:34 [autocue.cue_file:3] Writing metadata to /tmp/cue_filee1917f.json
2024/06/28 20:06:34 [autocue.cue_file:3] cue_file result for "/var/azuracast/stations/eisradio/media/Syndication/lautfm-news.mp3": {"duration": 153.835102, "liq_cue_duration": 153.84, "liq_cue_in": 0.0, "liq_cue_out": 153.84, "liq_cross_start_next": 153.84, "liq_longtail": false, "liq_sustained_ending": false, "liq_loudness": "-12.42 LUFS", "liq_loudness_range": "3.57 LU", "liq_amplify": "-5.58 dB", "liq_amplify_adjustment": "0.00 dB", "liq_reference_loudness": "-18.00 LUFS", "liq_blankskip": 0.0, "liq_blank_skipped": false, "liq_true_peak": 1.041, "liq_true_peak_db": "0.35 dBFS"}
2024/06/28 20:06:34 [autocue.cue_file:3] Clipping prevention: Adjusted calculated replaygain_track_gain from -5.58 dB to -5.58 dB
2024/06/28 20:06:34 [autocue.cue_file:2] Given fade-out duration (0.1 s) exceeds available time, using 0. s.
2024/06/28 20:06:34 [autocue.cue_file:3] Metadata added/corrected for "/var/azuracast/stations/eisradio/media/Syndication/lautfm-news.mp3":
2024/06/28 20:06:34 [autocue.cue_file:3] ("duration", "163.24")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_amplify", "-5.58 dB")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_amplify_adjustment", "0.00 dB")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_blank_skipped", "false")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_blankskip", "0.00")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_cross_start_next", "153.84")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_cue_duration", "153.84")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_cue_in", "0.00")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_cue_out", "153.84")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_fade_in", "0.1")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_fade_out", "0.")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_longtail", "false")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_loudness", "-12.42 LUFS")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_loudness_range", "3.57 LU")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_reference_loudness", "-18.00 LUFS")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_sustained_ending", "false")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_true_peak", "1.041000")
2024/06/28 20:06:34 [autocue.cue_file:3] ("liq_true_peak_db", "0.35 dBFS")
2024/06/28 20:06:34 [autocue.cue_file:3] ("replaygain_reference_loudness", "-18.00 LUFS")
2024/06/28 20:06:34 [autocue.cue_file:3] ("replaygain_track_gain", "-5.58 dB")

2024/06/28 20:09:45 [show_meta:3] ("duration", "163.24")
2024/06/28 20:09:45 [show_meta:3] ("liq_amplify", "-5.58 dB")
2024/06/28 20:09:45 [show_meta:3] ("liq_amplify_adjustment", "0.00 dB")
2024/06/28 20:09:45 [show_meta:3] ("liq_autocue", "cue_file")
2024/06/28 20:09:45 [show_meta:3] ("liq_blank_skipped", "false")
2024/06/28 20:09:45 [show_meta:3] ("liq_blankskip", "0.00")
2024/06/28 20:09:45 [show_meta:3] ("liq_cross_duration", "5.")
2024/06/28 20:09:45 [show_meta:3] ("liq_cross_start_next", "153.84")
2024/06/28 20:09:45 [show_meta:3] ("liq_cue_duration", "153.84")
2024/06/28 20:09:45 [show_meta:3] ("liq_cue_in", "0.00")
2024/06/28 20:09:45 [show_meta:3] ("liq_cue_out", "153.84")
2024/06/28 20:09:45 [show_meta:3] ("liq_fade_in", "0.10")
2024/06/28 20:09:45 [show_meta:3] ("liq_fade_out", "0.10")
2024/06/28 20:09:45 [show_meta:3] ("liq_fade_out_delay", "5.")
2024/06/28 20:09:45 [show_meta:3] ("liq_longtail", "false")
2024/06/28 20:09:45 [show_meta:3] ("liq_loudness", "-12.42 LUFS")
2024/06/28 20:09:45 [show_meta:3] ("liq_loudness_range", "3.57 LU")
2024/06/28 20:09:45 [show_meta:3] ("liq_reference_loudness", "-18.00 LUFS")
2024/06/28 20:09:45 [show_meta:3] ("liq_sustained_ending", "false")
2024/06/28 20:09:45 [show_meta:3] ("liq_true_peak", "1.041000")
2024/06/28 20:09:45 [show_meta:3] ("liq_true_peak_db", "0.35 dBFS")
2024/06/28 20:09:45 [show_meta:3] ("replaygain_reference_loudness", "-18.00 LUFS")
2024/06/28 20:09:45 [show_meta:3] ("replaygain_track_gain", "-5.58 dB")
2024/06/28 20:09:45 [show_meta:3] Now playing: lautfm - Nachrichten
Moonbase59 commented 3 months ago

Darn! Could have happened to me :-) You’re right, it’s getting rather complicated if one has to think about all possible side effects… +grin+ I will possibly also have forgotten in a few weeks. :rofl: Then again, we can fortunately look things up in the code. Long live FOSS!

And actually, your way of doing it is rather clever. Kudos for that!

LordHelmchen666 commented 3 months ago

It is driving me crazy. It happened again. I tried all now. cue_file=false, fadein/out=0.1, cue_in, cue_out, cross_start_next. Nothing helps. It cuts off sometimes which doesn't sounds good. When using cross.smart this don't happens.

Moonbase59 commented 3 months ago

Phew. Have to have my head switched back to here… deep into some other projects currently, Perl and JS.

Don’t know really, I guess we can rule out missing RG tags, since you write them using cue_file. I’m a little unsure if the API still takes strings, after all the PHP typing and conversion efforts lately. (I assume that should work, but can’t right now test it.)

LordHelmchen666 commented 3 months ago

I am not sure, but i guess cue_file recalculates everytime, even when i set all manually. Would it be possible to add a flag e.g. liq_force_full_duration? when is true then set fadein/out to 0.1 and cue_out, cross_start_next = duration. Could it work? What do you think?

Moonbase59 commented 3 months ago

To be honest, I wouldn’t currently want to change much. We’d have to update AzuraCast (and others using Autocue) everytime, so I’d prefer to fix bugs only for now.

I still wonder why it doesn’t do what we think it should to in your setup.

LordHelmchen666 commented 3 months ago

I agree not changing things to often. It is better to fix things wherever possible.

I set settings.log.level := 4

Rolling Release #dcd4fdc (2024-06-26 23:40)

# settings.autocue.cue_file.path := "cue_file"
 settings.autocue.cue_file.fade_in := 0.5  # seconds
 settings.autocue.cue_file.fade_out := 5.0  # seconds
# settings.autocue.cue_file.timeout := 60.0  # seconds
# settings.autocue.cue_file.target := -18.0  # LUFS
# settings.autocue.cue_file.silence := -42.0  # LU below track loudness
# settings.autocue.cue_file.overlay := -8.0  # LU below track loudness
# settings.autocue.cue_file.longtail := 15.0  # seconds
# settings.autocue.cue_file.overlay_longtail := -12.0 # extra LU
 settings.autocue.cue_file.sustained_loudness_drop := 10.0  # max. percent drop to be considered sustained
 settings.autocue.cue_file.noclip := true  # clipping prevention like loudgain's `-k`
 settings.autocue.cue_file.blankskip := 5.0  # skip silence in tracks
 settings.autocue.cue_file.unify_loudness_correction := true  # unify `replaygain_track_gain` & `liq_amplify`
# settings.autocue.cue_file.write_tags := false  # write liq_* tags back to file
# settings.autocue.cue_file.write_replaygain := false  # write ReplayGain tags back to file
# settings.autocue.cue_file.force_analysis := false  # force re-analysis even if tags found
# settings.autocue.cue_file.nice := false  # Linux/MacOS only: Use NI=18 for analysis
# settings.autocue.cue_file.use_json_metadata := true  # pass metadata to `cue_file` as JSON

I'll keep an eye on it and copy the log if it happens again.

I'll try sending as float to API and see if anything changes.

Moonbase59 commented 3 months ago

Thanks. Remember you might have to copy the Liquidsoap logs from the station. The log in the browser is quite short-lived when so much diagnostics data is produced.

Just to recap: If writing tags+ReplayGain, the settings above would translate to one of these cue_file commandlines:

cue_file -f -d 10.0 -k -b 5.0 -w -r filename.ext  # long form, floats written out
cue_file -f -d 10 -k -b 5 -w -r filename.ext  # long form, floats abbreviated
cue_file -fkwr -d 10 -b 5 filename.ext  # short form, specifying -b duration
cue_file -fkwr -d 10 -b -- filename.ext  # short form, leaving -b at default 5.0s, using --

For ease of use, commandline parameters will be auto-converted to float if needed (so 10 and 10.0 and 10.00 are the same, but 10. isn’t allowed).

Moonbase59 commented 3 months ago

I am not sure, but i guess cue_file recalculates everytime, even when i set all manually. Would it be possible to add a flag e.g. liq_force_full_duration? when is true then set fadein/out to 0.1 and cue_out, cross_start_next = duration. Could it work? What do you think?

New day, fresh thinking… Know what? You can already do all that! cue_file accepts an override JSON (stdin or file), which I internally use to pass the values from AzuraCast, i.e. from the Visual Cue Editor/Advanced tab.

Here’s the forgotten secret: If you’re pre-tagging, you could use this input to set your desired values and write them to the tags even. Just create well-formed JSON from your values and pass it on to cue_file—et voilà!

So instead of using the API (which is perfectly fine, too), you could tag the file:

echo '{"liq_fade_in": 0.1, "liq_fade_out": 0.1, "liq_cue_out": '$LENGTH', "liq_cross_start_next": '$LENGTH'}' | cue_file -j - -fkwr -d 10 -b -- filename.ext

The -j - tells cue_file to read its JSON from stdin, not from a file. You can pass any tag in the JSON, but cue_file will only ever write tags starting with liq_* and (if selected) replaygain_*.

Unfortunately, using -f/--force does just that: It forces a new analysis, getting you new cue-out and cross-start-next points.

I’ll check the internal logic and see what can be done in this respect.

Moonbase59 commented 3 months ago

v4.0.4 is out and should help in the case -f was used and you still want to overwrite some values. ;-)

See Release Notes and new FAQ section.

While v4.0.4 is not in AzuraCast, you can use a local _cuefile v4.0.4 to pre-tag your files.

LordHelmchen666 commented 3 months ago

Thanks for your patience, help and support. As I try out a lot, I often change the scripts. At the moment i use cue_file -fkwrn -b 5 -d 10 -- $directory/temp/lautfm-news.mp3 >>$MAILLOG

I'll give it a try. So snippet of my download script is now

    curl https://xxxxxx@api.radioadmin.laut.fm/news/1 --output $directory/temp/lautfm-news.mp3  >>$MAILLOG 2>&1
   # rsgain custom -I3 -a -L -c p -s i $directory/temp/lautfm-news.mp3 >>$MAILLOG
   LENGTH="$(ffprobe -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$directory/temp/lautfm-news.mp3" 2>/dev/null)" >>$MAILLOG
    echo '{"liq_fade_in": 0.1, "liq_fade_out": 0.1, "liq_cue_out": '$LENGTH', "liq_cross_start_next": '$LENGTH'}' | cue_file -j - -fkwrn -d 10 -b 5 --  $directory/temp/lautfm-news.mp3 >>$MAILLOG  
    mid3v2 -A "laut.fm Nachrichten" -g "News" $directory/temp/lautfm-news.mp3 >>$MAILLOG

It's funny that nothing has been cut off from the news in the last few hours. But for a jingle. I will post a recording. I'll downloaded 4.0.4 and use it when next download is triggered.

LordHelmchen666 commented 3 months ago

Tagging with your command works perfect. echo '{"liq_fade_in": 0.1, "liq_fade_out": 0.1, "liq_cue_out": '$LENGTH', "liq_cross_start_next": '$LENGTH'}' | cue_file -j - -fkwrn -d 10 -b 5 -- $directory/temp/lautfm-news.mp3

I let the script send me emails with the result.

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0 100 2679k    0 2679k    0     0  12.0M      0 --:--:-- --:--:-- --:--:-- 12.0M

{"duration": 171.404, "liq_cue_duration": 169.904, "liq_cue_in": 0.0, "liq_cue_out": 171.47675, "liq_cross_start_next": 171.47675, "liq_longtail": false, "liq_sustained_ending": false, "liq_loudness": "-12.42 LUFS", "liq_loudness_range": "3.77 LU", "liq_amplify": "-5.58 dB", "liq_amplify_adjustment": "0.00 dB", "liq_reference_loudness": "-18.00 LUFS", "liq_blankskip": 5.0, "liq_blank_skipped": false, "liq_true_peak": 0.975, "liq_true_peak_db": "-0.22 dBFS"}

Download lautfm-news.mp3 finished

 STARTED: Mo 1. Jul 16:44:01 CEST 2024
 FINISHED: Mo 1. Jul 16:44:03 CEST 2024

BTW What does liq_cue_duration? Do i need to set it also full duration?

LordHelmchen666 commented 3 months ago

It's funny that nothing has been cut off from the news in the last few hours. But for a jingle. I will post a recording. I'll downloaded 4.0.4 and use it when next download is triggered.

I think i found the reason why the jingle was "cut off". The duration tag was not set. I pre-tagged newly with cue_file 4.0.4 and issue has gone. So i decided to pre-tag all my files again with 4.0.4 and hope then all working as we want it.

LordHelmchen666 commented 3 months ago

It happened again, but this time i know why. You can listen here 2024-07-01-T19_00_00.webm

This time it happened because news file queued at 18:25, playout was 19:04. Playing a 30 minute syndicated show in this time. But i download news every hour at minute 51. So queued file had correctly announced 153 seconds, but new downloaded file had 170 seconds. Don't know how to avoid this.

Downloading and tagging with echo '{"liq_fade_in": 0.1, "liq_fade_out": 0.1, "liq_cue_out": '$LENGTH', "liq_cross_start_next": '$LENGTH'}' | cue_file -j - -fkwrn -d 10 -b 5 -- runs great also with syndicated shows!

Moonbase59 commented 3 months ago

I wonder if my LS corrects the "duration": 171.404 vs set "liq_cue_out": 171.47675, "liq_cross_start_next": 171.47675—those are "beyond the end".

Problem is, especially with MP3, and especially especially with VBR MP3, the duration LS or ffprobe "read" is just a guesstimate, and cue_file reads the whole file, so usually knows better.

liq_cue_duration was meant to indicate the real playout duration (cue_out - cue_in), so for instance a more precise broadcast clock could be built.

LordHelmchen666 commented 3 months ago

I wonder if my LS corrects the "duration": 171.404 vs set "liq_cue_out": 171.47675, "liq_cross_start_next": 171.47675—those are "beyond the end".

Problem is, especially with MP3, and especially especially with VBR MP3, the duration LS or ffprobe "read" is just a guesstimate, and cue_file reads the whole file, so usually knows better.

There is no audible issue. Do you need logs? liq_cue_duration was meant to indicate the real playout duration (cue_out - cue_in), so for instance a more precise broadcast clock could be built.

Now i understand that. Thanks.

Everything looks good so far. Everything now seems to be working as you would expect. So i think we could close this issue.

Moonbase59 commented 3 months ago

Fine, thanks! And happy it works out for you! Now it’s Buster’s turn for AzuraCast. :-)

LordHelmchen666 commented 3 months ago

Tonight I had another idea. I thought why use ffprobe when cue_file already have a more precise duration. So why don't run cue_file, then read duration from tag and use mid3v2 to set liq_cue_out and liq_cross_start_next. This way I would have the exactly same values and wouldn't need to calculate duration two times. I think I will give it a try.

Moonbase59 commented 3 months ago

@LordHelmchen666 Yes, why not. It actually uses ffprobe to read the initial metadata (and duration), but (only) when it does an analysis, it updates the value to what is has found out.

It’s an inexact science, that duration finding… frame lengths differ, autocue can only measure in 100ms steps, without adding even more CPU… sigh. I just found there are even cases where ffprobe can be more exact.

Will release v4.0.5 in a moment, to fix a minor glitch that went through with durations, if cue_file wasn’t re-analysing. You might want to test with that version…

Say, are you available somewhere else for a talk? Don’t like to pollute the issue, so talking on phone or Discord or my Nextcloud would be nice. (Re: possible error, news, etc.). If you don’t want to make contact data public, you can send me an email to moonbase (at) quantentunnel.de. Or reach me on Discord as Moonbase59.

LordHelmchen666 commented 3 months ago

Testing 4.0.5 right now. I am on Discord also as Lord_Helmchen

Moonbase59 commented 3 months ago

Missed the friend request for a while, sorry. Maybe when you have time and are in the mood, we can have a chat/talk over there.