Skip to content

Commit

Permalink
v4.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Moonbase59 committed Jul 2, 2024
1 parent 02b0061 commit 11afd93
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 5 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
# 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_`.
- Prevent some strange errors that could happen when piping something into `cue_file` and JSON input was not `stdin`. We now use `ffmpeg -nostdin` to prevent it reading input that was meant for `cue_file`.
- 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.
Expand Down
3 changes: 2 additions & 1 deletion autocue.cue_file.liq
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand All @@ -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.
Expand Down
16 changes: 12 additions & 4 deletions cue_file
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit 11afd93

Please sign in to comment.