Ffmpeg-python: The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

Created on 13 May 2019  路  3Comments  路  Source: kkroening/ffmpeg-python

import ffmpeg

def add_audio_in_video(audio, video):
v = ffmpeg.input(video)
a = ffmpeg.input(audio)
out = ffmpeg.output(v, a)
out.run()

if __name__ == '__main__':
a = 'video_with_audio.mp3'
v = 'first_part.mp4'
add_audio_in_video(a, v)

The encoder 'aac' is experimental but experimental codecs are not enabled, add '-strict -2' if you want to use it.

How can I fix it? Thx :)

question resolved

Most helpful comment

out = ffmpeg.output(v, a, 'out.mp4', strict='-2')

It works!

All 3 comments

I run:
out = ffmpeg.output(v, a, 'out.mp4', ac = 2)
It does not work.

out = ffmpeg.output(v, a, 'out.mp4', strict='-2')

It works!

Thanks @MaJian8. Marking as resolved and closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

tossorrow picture tossorrow  路  6Comments

nathanaelneveux picture nathanaelneveux  路  4Comments

monokal picture monokal  路  3Comments

znorris picture znorris  路  4Comments

lalamax3d picture lalamax3d  路  3Comments