auto-subtitle icon indicating copy to clipboard operation
auto-subtitle copied to clipboard

Unable to add subtitles to video!!!

Open RedHeartSecretMan opened this issue 2 years ago • 4 comments

This code exist bug: ` video = ffmpeg.input(path) audio = video.audio

    ffmpeg.concat(
        video.filter('subtitles', srt_path, force_style="OutlineColour=&H40000000,BorderStyle=3"), audio, v=1, a=1
    ).output(out_path).run(quiet=True, overwrite_output=True)`

To be specific, video = ffmpeg.filter(video, 'subtitles', subtitle_path, force_style="OutlineColour=&H40000000, BorderStyle=3"), lead to .run() error, ffmpeg maybe No such filter: 'subtitles'.

I hope you will reply as soon as

RedHeartSecretMan avatar Feb 14 '23 17:02 RedHeartSecretMan

What kind of device are you using? You can set the quiet option in run to False to get the error message from ffmpeg.

RapDoodle avatar Feb 18 '23 14:02 RapDoodle

Glad to hear from you, I have fixed the problem, it seems that the "ffmpeg-python" generation graph was incorrectly executed by "ffmpeg". Since what I want to do is to add "srt" subtitles to the "mp4" video, the two seem to be incompatible, setting the encoding of the subtitles to "mov_text" will successfully add subtitles to the video.

RedHeartSecretMan avatar Feb 19 '23 09:02 RedHeartSecretMan

@RedHeartSecretMan I have the same issue, can you explain how you fixed it?

buddhikadesilva avatar Jul 16 '23 22:07 buddhikadesilva

In my research and testing, the main reason for this problem is that the video format is incompatible with the subtitle format encoded into it. For details, you can look at the project I wrote https://github.com/RedHeartSecretMan/go_subtitle/blob/main/subtitler/app.py 145-171 lines

RedHeartSecretMan avatar Jul 28 '23 13:07 RedHeartSecretMan