Skip to main content

A package for downloading YouTube videos, extracting audio and frames, and analyzing sound intervals

Project description

youtube_downloader

VideoSoundAnalyzer is a Python package that allows you to download videos from YouTube, extract audio and frames from local videos, and analyze the intervals where there is sound in the extracted audio.

Features

  • Download videos from YouTube
  • Extract audio from a video
  • Extract frames from a video
  • Analyze the intervals where there is sound in the extracted audio
  • Save the sound intervals to a JSON file

Installation

You can install VideoSoundAnalyzer from PyPI using pip:

Usage

Here's an example of how to use the package:

from youtube_downloader import VideoDownloader, AudioExtractor, SoundIntervalAnalyzer

# Download a video from YouTube
downloader = VideoDownloader(video_url, output_directory)
video_path = downloader.download_video()

# Extract frame of frame : select a intervals
frame_extractor = FrameExtractor(video_path, output_directory, quality, oneperframe )
frame_extractor.extract_frames()

# Extract audio from the downloaded video
if video_path:
    output_audio_path = "audio/source.mp3"
    extractor = AudioExtractor(video_path, output_audio_path)
    extractor.extract_audio()

    # Analyze the sound intervals
    analyzer = SoundIntervalAnalyzer(output_audio_path)
    analyzer.create_sound_intervals_json()

output json file extractor sound

[
  [1.0448979591836736, 2.2058956916099772],
  [2.4380952380952383, 3.250793650793651],
  [4.1099319727891155, 4.620770975056689],
  [4.690430839002268, 5.5495691609977325],
  [5.7817687074829935, 6.339047619047619]
]

License

This project is licensed under the MIT License. See the LICENSE file for more details.

Contributors

Cornélius vincent linkedin

Acknowledgments

This package utilizes the following libraries:

  • pytube
  • MoviePy
  • librosa
  • imageio
  • NumPy
  • json
  • os

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

youtube_video_analyzer-0.1.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

youtube_video_analyzer-0.1.0-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file youtube_video_analyzer-0.1.0.tar.gz.

File metadata

  • Download URL: youtube_video_analyzer-0.1.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.11.5

File hashes

Hashes for youtube_video_analyzer-0.1.0.tar.gz
Algorithm Hash digest
SHA256 22d3044b43c44b931370ffcb3652156f35c458e35fe3efc4d03b9a15dd015964
MD5 cf567e9ed106f52bd97e6a50d7b40c57
BLAKE2b-256 eae5d002596bb2dd2314573fd525d38636b442d9592d84209929b578e6bd2b3b

See more details on using hashes here.

File details

Details for the file youtube_video_analyzer-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for youtube_video_analyzer-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 166895d313f4abbdea2c14294a3dbf1e465ffcf15d854ab32e3d383a5bc84d9e
MD5 9d0287fc60cfe5335ecd964440ebbbe4
BLAKE2b-256 6dd757905d5292edd33ff6abc6da52df44454d1940ae0e025832b8a78ee4a587

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page