Ending of the video is buggy for me.
Here is an example. Look at the ending:
https://user-images.githubusercontent.com/65528389/171937326-28e00a67-3fc2-4bf3-acd4-bb8dc4ee77fb.mp4
Anyone got an idea how to fix it?
Does this happen on every video you generate? Or was it just this one?
It seems to happen every so often. I've had it on a few of mine too
Does this happen on every video you generate? Or was it just this one?
happens almost every time for me. It seems that some videos are worse than others tho
Do you mind sending the full video? I need more context on this issue.
Do you mind sending the full video? I need more context on this issue.
the video was too big for github thats why I didnt upload the full video. I will try to compress it tho hold on
Can you do Dropbox or Drive?
happens almost every time for me. It seems that some videos are worse than others tho
Does this also happen when you use the female voice?
happens almost every time for me. It seems that some videos are worse than others tho
Does this also happen when you use the female voice?
It happens regardless, I was able to fix it on my end, but I need more context to see if it's the same issue.
happens almost every time for me. It seems that some videos are worse than others tho
Does this also happen when you use the female voice?
It happens regardless, I was able to fix it on my end, but I need more context to see if it's the same issue.
https://user-images.githubusercontent.com/65528389/171948410-d485915d-4144-4e03-96c0-4f233f221c31.mp4
here is the compressed video. it isnt the exact same vid because it got replaced, but its the same reddit post.
In final_video.py, replace:
final = CompositeVideoClip([background_clip, image_concat])
final.write_videofile(
"assets/final_video.mp4", fps=30, audio_codec="aac", audio_bitrate="192k"
)
With:
final = CompositeVideoClip([background_clip, image_concat])
final.write_videofile("assets/final_clip.mp4", fps=30, audio_codec="aac", audio_bitrate="192k")
ffmpeg_extract_subclip("assets/final_clip.mp4", 0, length, targetname="assets/final_video.mp4")
os.remove("assets/final_clip.mp4")
And add to the top of your file: from moviepy.video.io.ffmpeg_tools import ffmpeg_extract_subclip.
Thanks! it says "length" isnt defined tho
Oh, yeah. So replace def make_final_video(number_of_clips): with def make_final_video(number_of_clips, length): and in main.py, replace final_video = make_final_video(number_of_comments) with final_video = make_final_video(number_of_comments, length).
Seems to work! Thank you so much!! I sometimes get this error tho, do you know what it means or how to fix it?
Traceback (most recent call last): File "C:\Users\User\Desktop\RedditVideoMakerBot-master\main.py", line 19, in <module> length, number_of_comments = save_text_to_mp3(reddit_object) File "C:\Users\User\Desktop\RedditVideoMakerBot-master\video_creation\voices.py", line 46, in save_text_to_mp3 length += MP3(f"assets/mp3/{idx}.mp3").info.length File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\mutagen\_file.py", line 48, in __init__ self.load(*args, **kwargs) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\mutagen\_util.py", line 156, in wrapper return func(self, h, *args, **kwargs) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\mutagen\id3\_file.py", line 421, in load self.info = self._Info(fileobj, offset) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\mutagen\_util.py", line 185, in wrapper return func(*args, **kwargs) File "C:\Users\User\AppData\Local\Programs\Python\Python39\lib\site-packages\mutagen\mp3\__init__.py", line 402, in __init__ raise HeaderNotFoundError("can't sync to MPEG frame") mutagen.mp3.HeaderNotFoundError: can't sync to MPEG frame
I think I got it a couple of times before as well, but I dont know what it means. It seems as if it happens to some specific reddit posts tho. (it isnt just random)
I have never gotten that error before... mind trying with another Reddit thread and seeing if that works?
A lot of people using the male voice are getting that error. We're still trying to come up with a solution https://github.com/elebumm/RedditVideoMakerBot/pull/92
Yeah, I see that. I got that problem once, reran it, and it worked fine.
A lot of people using the male voice are getting that error. We're still trying to come up with a solution #92
interesting, thanks for the help! Ill try to find a solution
video_creation\voices.py", line 46, in save_text_to_mp3 length += MP3(f"assets/mp3/{idx}.mp3").info.length
As the error mentions, there is an issue getting the mp3 length. My solution was to switch from Mutagen MP3 to pydub AudioSegment
from pydub import AudioSegment
audio = AudioSegment.from_file("assets/{}/mp3/title.mp3".format(path))
length += audio.duration_seconds
Source: https://github.com/jiaaro/pydub
There should be a PR fixing this.
video_creation\voices.py", line 46, in save_text_to_mp3 length += MP3(f"assets/mp3/{idx}.mp3").info.length
As the error mentions, there is an issue getting the mp3 length. My solution was to switch from Mutagen MP3 to pydub AudioSegment
from pydub import AudioSegment
audio = AudioSegment.from_file("assets/{}/mp3/title.mp3".format(path))length += audio.duration_secondsSource: https://github.com/jiaaro/pydub
"path" is not defined