From b63b510549fef6bd670d7267aa251e00da9c83eb Mon Sep 17 00:00:00 2001 From: Michael Kamprath Date: Thu, 31 Dec 2020 15:40:41 -0800 Subject: [PATCH] corrected bug in transcoding Corrected a bug that caused each transcoding block to push to all destinations, not just the destinations that were configured to use it. --- CHANGELOG.md | 5 +++-- multistreaming-server/rtmp-conf-generator.py | 9 +++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e581031..ea3fd02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,13 +1,13 @@ # Changelog All notable changes to this project will be documented in this file. -## [Unreleased] - +## [0.4.1] ### Changed * Updated `ffmpeg` to the 4.3.x version branch ### Fixed * Corrected bug that occurred when audio bit rated was configured in JSON using an integer +* Corrected a bug where each transcode block pushed to all destinations ## [0.4.0] ### Added @@ -64,6 +64,7 @@ All notable changes to this project will be documented in this file. [Unreleased]: https://github.com/michaelkamprath/multi-service-rtmp-broadcaster/compare/v0.4.0...HEAD +[0.4.1]: https://github.com/michaelkamprath/multi-service-rtmp-broadcaster/compare/v0.4.0...v0.4.1 [0.4.0]: https://github.com/michaelkamprath/multi-service-rtmp-broadcaster/compare/v0.3.1...v0.4.0 [0.3.1]: https://github.com/michaelkamprath/multi-service-rtmp-broadcaster/compare/v0.3.0...v0.3.1 [0.3.0]: https://github.com/michaelkamprath/multi-service-rtmp-broadcaster/compare/v0.2.0...v0.3.0 diff --git a/multistreaming-server/rtmp-conf-generator.py b/multistreaming-server/rtmp-conf-generator.py index df2da45..398de46 100755 --- a/multistreaming-server/rtmp-conf-generator.py +++ b/multistreaming-server/rtmp-conf-generator.py @@ -1,10 +1,11 @@ #!/usr/bin/env python3 +import copy +import jinja2 import json +import os import re import sys -import os -import jinja2 # # Configurable ENV VARS @@ -43,7 +44,6 @@ 'keyFrames': 60, 'audioOpts': '-c:a copy', 'logFfmpeg': True if CONFIG_FFMPEG_LOG else False, - 'applicationEndpoints': set(), 'maxMuxingQueueSize': int(CONFIG_FFMPEG_MAX_MUXING_QUEUE_SIZE) if CONFIG_FFMPEG_MAX_MUXING_QUEUE_SIZE else None, @@ -118,9 +118,10 @@ def generateTranscodeConfig(transcode_config_name, block_config, config): ) exit(1) transcode_config = { - key: transcode_config_block.get(key, DEFAULT_TRANSCODE_CONFIG[key]) + key: copy.deepcopy(transcode_config_block.get(key, DEFAULT_TRANSCODE_CONFIG[key])) for key in default_transcode_config.keys() } + transcode_config['applicationEndpoints'] = set() if 'videoKeyFrameSecs' in transcode_config_block: transcode_config['keyFrames'] = 30 * transcode_config_block['videoKeyFrameSecs']