Skip to content

Commit e7d9802

Browse files
author
Clement Champetier
committed
pyconcat: check codec name of streams to rewrap
1 parent 9bbbe6e commit e7d9802

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

app/pyConcat/pyconcat.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,20 @@
3333
av.preloadCodecsAndFormats()
3434

3535
streamTypeToConcat = Set()
36+
codecToConcat = Set()
3637
# get all input files
3738
inputFiles = []
3839
for input in args.inputs:
3940
inputFile = av.InputFile(input)
4041
streamTypeToConcat.add( inputFile.getStream(0).getProperties().getStreamType() )
42+
codecToConcat.add( inputFile.getStream(0).getProperties().getCodecName() )
4143
inputFiles.append(inputFile)
4244

4345
# Check type of streams to rewrap
4446
if len(streamTypeToConcat) > 1:
4547
raise RuntimeError("Cannot concatenate streams of different type.")
48+
if len(codecToConcat) > 1:
49+
raise RuntimeError("Cannot concatenate streams of different codec: ", [codec for codec in codecToConcat])
4650

4751
# Create the output
4852
outputFile = av.OutputFile( args.outputFileName );

0 commit comments

Comments
 (0)