Skip to content

Commit

Permalink
Doing full movie pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Lokhia authored and DnzzL committed Feb 1, 2023
1 parent 1429e72 commit f9ffc8e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions notebooks/audio/gender_identification.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ def export_to_csv(self, file_path):

if __name__ == '__main__':
load_dotenv()
path_to_video = os.getenv("path_to_extract", "./")
audio = os.getenv("path_to_audio", "./")
path_to_video = os.getenv("path_to_full_movie", "./")
audio = os.getenv("path_to_full_audio", "./")
movie = Movie(path_to_video, audio)
print(movie.dialogues)
# print(movie.dialogues)
movie.export_to_csv('./HP4_results.csv')
# """Pour convertir en tests :"""
# gender_of_time_45 = movie.search_gender_tag(45) # None
Expand Down
9 changes: 5 additions & 4 deletions notebooks/audio/media_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ def import_as_clip(path_to_video):
return mp.VideoFileClip(path_to_video)


def separate_voice_and_music(file):
os.system('spleeter separate -o ../../../ -f "{instrument}/{filename}.{codec}" ' + file)
def separate_voice_and_music(file): # Do not work above 700 seconds
os.system('spleeter separate -d 700.0 -o ../../../ -f "{instrument}/{filename}.{codec}" ' + file)


def extract_audio_from_movie(file, extension='.wav'):
Expand All @@ -27,9 +27,10 @@ def extract_audio_from_movie(file, extension='.wav'):
path_to_full_movie = os.getenv("path_to_full_movie", "./")
path_to_extract = os.getenv("path_to_extract", "./")
path_to_trailer = os.getenv("path_to_trailer", "./")
path_to_full_audio = os.getenv("path_to_full_audio", "./")

extract_audio_from_movie(path_to_full_movie)
# separate_voice_and_music(path_to_extract)
# extract_audio_from_movie(path_to_full_movie)
# separate_voice_and_music(path_to_full_audio)

# cut_and_save(path_to_full_movie, 2115, 2491, path_to_extract)

Expand Down

0 comments on commit f9ffc8e

Please sign in to comment.