Open RashiqAzhan opened 3 years ago
Did you solved it @RashiqAzhan ??
Any solution to this?
These solution worked for me. I was editing audio so converted it from bytes to a FilterableStream using input. input and video were already FilterableStreams. input had other audio tracks and subtitles which were preserved.
For some reason mkv's don't output if you give it a format='mkv', in the output. 'pipe:0' is used or piping inputs in ffmpeg.input(), and 'pipe:1' is used to pipe outputs in ffmpeg.output. Although output can take FilterableStreams as inputs, for some reason you can not pipe them in using 'pipe:0'.
process3 = (
ffmpeg.input('pipe:0', format='f32le', ar=sample_rate)
.output(input_, filename=output_path) #'pipe:0'
.overwrite_output()
.run_async(pipe_stdin=True, pipe_stderr=True, quiet=True)
)
err = process3.communicate(input=audio)
process5 = (
ffmpeg.input('pipe:0', format='f32le', ar=sample_rate)
.output(video, filename=output_path)
.overwrite_output()
.run_async(pipe_stdin=True, pipe_stderr=True, quiet=True)
)
err = process5.communicate(input=audio)
process7 = (
ffmpeg.input('pipe:0', format='f32le', ar=sample_rate)
.output(video, filename=output_path, vcodec='copy', acodec='aac', strict='experimental')
.overwrite_output()
.run_async(pipe_stdin=True, pipe_stderr=True, quiet=True))
err = process7.communicate(input=audio)
And if you know the stream number for the file type, then you can also do the follows
process8 = (
ffmpeg.input('pipe:0', format='f32le', ar=sample_rate)
.output(input_['0'], input_['2'], input_['1'], filename=output_path, vcodec='copy', acodec='aac')
.overwrite_output()
.run_async(pipe_stdin=True, pipe_stderr=True, quiet=True))
err = process8.communicate(input=audio)
I also need a solution to this issue
I searched for such an example in the documentation but I couldn't devise a solution. I have two streams.
Video:
Audio:
I have tried outputting them but I get an error saying
TypeError: cannot unpack non-iterable Popen object
.Terminal Output:
I have also tried using the concat method but to no success.
Terminal Output:
Any help resolving this would be greatly appreciated.