diff --git a/CHANGELOG.md b/CHANGELOG.md index 30ca06c..11f1950 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,15 @@ # autocue changelog +### 2024-07-02 – v4.0.5 + +- Fixed a situation where `cue_file` would read a string duration from ffprobe for audio stream \#0, which led to an error in the AzuraCast log like this: + ``` + 2024/07/02 16:03:27 [autocue:2] Error while processing autocue: error(kind="json",message="Parsing error: json value cannot be parsed as type {duration: float, _}",positions="at autocue.liq, line 814 char 6 - line 826 char 10") + ``` +- `cue_file` now outputs the same duration for both tag reading and full analysis mode. +- `cue_file` will not anymore write a `duration` tag to files. That was a newly introduced bug in v4.0.4. + + ### 2024-07-01 – v4.0.4 - Allow to override results via JSON even _after_ having done a fresh analysis (automatic or forced), for ultimate flexibility when using `cue_file` for pre-processing. You can now add fades, ramp or hook points, or do other calculations and feed the results into `cue_file` for tagging. **Use with care**, because some values are dependent on others. In any case, `cue_file` will ever _only_ write tags beginning with `liq_` and (if requested) `replaygain_`. @@ -7,6 +17,7 @@ - Don’t write _all_ `liq_*` tags (could have side effects), but only those _known_ (see `cue_file --help` for current list). - Streamlined tag conversion code a little. + ### 2024-06-18 – v4.0.3 - Changed default of `-x`/`--extra` and `settings.autocue.cue_file.overlay_longtail` from `-15.0` LU to `-12.0` LU, requested by @RM-FM and the community. Together with the `-d`/`--drop` default change from `60.0` to `40.0`, this makes for a "tighter" playout and doesn’t lose too much of long or sustained endings. diff --git a/autocue.cue_file.liq b/autocue.cue_file.liq index e3986f8..3d086ea 100644 --- a/autocue.cue_file.liq +++ b/autocue.cue_file.liq @@ -38,6 +38,7 @@ # 2024-06-18 - Moonbase59 - v4.0.3 - Changed overlay_longtail from -15 to -12, # most people seem to want transitions a bit tighter # 2024-07-01 - Moonbase59 - v4.0.4 - Sync with cue_file version +# 2024-07-02 - Moonbase59 - v4.0.5 - Sync with cue_file version # Lots of debugging output for AzuraCast in this, will be removed eventually. @@ -51,7 +52,7 @@ let settings.autocue.cue_file.version = settings.make( description= "Software version of autocue.cue_file. Should coincide with `cue_file`.", - "4.0.4" + "4.0.5" ) # Internal only! Not a user setting. diff --git a/cue_file b/cue_file index dfc4efe..bab04ad 100755 --- a/cue_file +++ b/cue_file @@ -63,13 +63,14 @@ # errors when piping something to cue_file # - streamline tag conversion code a little # - only write known tags, not all `liq_*` +# 2024-07-02 Moonbase59 - v4.0.5 Fix minor bugs with file duration # # Originally based on an idea and some code by John Warburton (@Warblefly): # https://github.com/Warblefly/TrackBoundaries # Some collaborative work with RM-FM (@RM-FM): Sustained ending analysis. __author__ = 'Matthias C. Hormann' -__version__ = '4.0.4' +__version__ = '4.0.5' import os import sys @@ -356,10 +357,10 @@ def read_tags( tags_found = {**tags_in_stream, **tags_in_format, **tags_in_json} # eprint(json.dumps(tags_found, indent=2, sort_keys=True)) - # add duration of stream #0 + # add duration of stream #0 if it exists and can be converted to float try: - tags_found["duration"] = result['streams'][0]['duration'] - except KeyError: + tags_found["duration"] = float(result['streams'][0]['duration']) + except (KeyError, ValueError): try: # we might have a video duration (.mka) like "00:07:01.117000000", # ignore @@ -903,6 +904,10 @@ def write_tags(filename, tags={}, replaygain=False): tags_new.pop(k, None) del tags_new["R128_TRACK_GAIN"] + # Never write "duration" to tags + if "duration" in tags_new: + del tags_new["duration"] + # eprint(replaygain, temp, json.dumps(tags_new, indent=2)) if MUTAGEN_AVAILABLE and filename.suffix.casefold() in mp4_ext: @@ -1223,6 +1228,9 @@ if args.force or not skip_analysis: # allow to override even the analysis results if args.json: result = override_from_JSON(result, tags_json) + # override duration, seems ffprobe can be more exact + if "duration" in tags_found: + result["duration"] = tags_found["duration"] else: result = add_missing(tags_found, args.target, args.blankskip, args.noclip)