unknown audio
This commit is contained in:
18
bin/ffx.py
18
bin/ffx.py
@@ -116,7 +116,10 @@ audioStreams = [s for s in streamData if s['codec_type'] == 'audio']
|
||||
subtitleStreams = [s for s in streamData if s['codec_type'] == 'subtitle']
|
||||
|
||||
for aStream in audioStreams:
|
||||
print(f"audio stream: {aStream['channel_layout']}")
|
||||
if 'channel_layout' in aStream.keys():
|
||||
print(f"audio stream: {aStream['channel_layout']}") #channel_layout
|
||||
else:
|
||||
print(f"unknown audio stream with {aStream['channels']} channels") #channel_layout
|
||||
|
||||
commandTokens = ['ffmpeg', '-y', '-i', inputFilename]
|
||||
|
||||
@@ -133,6 +136,11 @@ for s in range(len(subtitleStreams)):
|
||||
audioTokens = []
|
||||
audioStreamIndex = 0
|
||||
for aStream in audioStreams:
|
||||
|
||||
channels = aStream['channels']
|
||||
|
||||
if 'channel_layout' in aStream.keys():
|
||||
|
||||
channelLayout = aStream['channel_layout']
|
||||
|
||||
if channelLayout == '6.1':
|
||||
@@ -156,6 +164,14 @@ for aStream in audioStreams:
|
||||
'libopus',
|
||||
f"-b:a:{audioStreamIndex}",
|
||||
stereoBandwidth]
|
||||
else:
|
||||
|
||||
if channels == 6:
|
||||
audioTokens += [f"-c:a:{audioStreamIndex}",
|
||||
'libopus',
|
||||
f"-b:a:{audioStreamIndex}",
|
||||
ac3Bandwidth]
|
||||
|
||||
|
||||
audioStreamIndex += 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user