Skip to content

Commit

Permalink
add check for existing stereo stream by langauge - avoid duplicating
Browse files Browse the repository at this point in the history
  • Loading branch information
yajrendrag committed Jun 10, 2024
1 parent c653fae commit 864f374
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions source/convert_multichan_audio_to_2ch/changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@

**<span style="color:#56adda">0.0.2</span>**
- add check for existing stereo stream of multichannel stream languages

**<span style="color:#56adda">0.0.2</span>**
- use correct plugin name in logger message

Expand Down
2 changes: 1 addition & 1 deletion source/convert_multichan_audio_to_2ch/info.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@
"on_worker_process": 0
},
"tags": "audio,encoder,ffmpeg,library file test",
"version": "0.0.2"
"version": "0.0.3"
}
3 changes: 2 additions & 1 deletion source/convert_multichan_audio_to_2ch/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,11 @@ def __init__(self, *args, **kwargs):
def streams_to_stereo_encode(probe_streams):
audio_stream = -1
streams = []
stereo_streams = [probe_streams[i]['tags']['language'] for i in range(len(probe_streams)) if probe_streams[i]['codec_type'] == 'audio' and 'tags' in probe_streams[i] and 'language' in probe_streams[i]['tags'] and probe_streams[i]['channels'] == 2]
for i in range(0, len(probe_streams)):
if "codec_type" in probe_streams[i] and probe_streams[i]["codec_type"] == "audio":
audio_stream += 1
if int(probe_streams[i]["channels"]) > 4:
if int(probe_streams[i]["channels"]) > 4 and 'tags' in probe_streams[i] and 'language' in probe_streams[i]['tags'] and probe_streams[i]['tags']['language'] not in stereo_streams:
streams += str(audio_stream)
return streams

Expand Down

0 comments on commit 864f374

Please sign in to comment.