Skip to main content

A MediaSwift PYTHON PACKAGE FOR VIDEO CONVERSION PLAY AND PROBING.

Project description

MediaSwift - EMPOWERING PYTHON WITH ADVANCED MULTIMEDIA OPERATIONS.

License

A POWERFUL PYTHON LIBRARY FOR SEAMLESS MULTIMEDIA OPERATIONS. MediaSwift SIMPLIFIES COMPLEX TASKS, MAKING IT EASY TO INTEGRATE AND ENHANCE YOUR MULTIMEDIA APPLICATIONS. DIVE INTO THE FUTURE OF MEDIA HANDLING WITH MediaSwift YOUR GO-TO LIBRARY FOR 2024.

KEY FEATURES:

  • EFFORTLESS FILE CONVERSION .
  • SEAMLESS MULTIMEDIA PLAYBACK .
  • PROVIDING INFORMATION MediaSwift ALSO OFFERS DETAILED MULTIMEDIA INFORMATION RETRIEVAL .

EXPLORE THE CAPABILITIES OF MediaSwift AND ELEVATE YOUR PYTHON MULTIMEDIA PROJECTS WITH SIMPLICITY AND EFFICIENCY.

SUPPORTED VIDEO CODECS:

h264, libx264, mpeg4, vp9, av1, hevc, mjpeg, H.265 / HEVC, VP8, VP9, AV1, VC1, MPEG1, MPEG2, H.263, Theora, MJPEG, MPEG-3, MPEG-4, AND MORE .

SUPPORTED AUDIO CODECS:

aac, mp3, opus, vorbis, pcm, alac, flac, wv, ape, mka, opus, ac3, eac3, alac, AND MORE .

SUPPORTED FILE EXTENSIONS:

VIDEO FORMATS : .mp4, .avi, .mkv, .webm, .mov, .wmv, .webm, .flv, .mov, .wmv, .hevc, .prores, .dv AUDIO FORMATS : .mp3, .aac, .ogg, .wav, .flac, .flac, .m4a, .ogg, .wv, .ape, .mka, .opus, mpc, .tak, .alac, AND MORE .

NOTE : ALSO SUPPORT DOLBY DIGITAL PLUS AND DOLBY DIGITAL AUDIO CODEC .eac3, .ac3 AND SUPPORT MORE VIDEO AND AUDIO CODECS AND VARIOUS [ FORMATE EXTENSION ] .

MediaSwift: A VERSATILE LIBRARY WITH MANY SUPPORT AUDIO AND VIDEO CODECS, AS WELL AS MULTIPLE FILE FORMATS EXTENSION .

LIST THE AVAILABLE CODECS AND FORMATES:

from MediaSwift import ffpe

info = ffpe()

info.formats()
info.codecs()

ENHANCE COMPATIBILITY BY LEVERAGING THE .format() AND .codecs() METHODS TO VALIDATE SUPPORT FOR A VARIETY OF FORMATS AND CODECS.

CHECK LIBRARY VERSION USING:

from MediaSwift import version

version_info = version()
print(version_info)

PLAY MEDIA USING ffpl

THE ffpl CLASS PROVIDES METHODS FOR PLAY MEDIA FILES. HERE ARE SOME EXAMPLES OF HOW TO USE THESE METHODS:

from MediaSwift import ffpl

play = ffpl()
media_file = r"PATH_TO_INPUT_FILE"
play.play(media_file)

QUICK TIP: USE THE .play() METHOD TO PLAY MEDIA FILES.

USING THE ffpr CLASS

THE ffpr CLASS PROVIDES METHODS FOR PROBING MEDIA FILES. HERE ARE SOME EXAMPLES OF HOW TO USE THESE METHODS:

from MediaSwift import ffpr

DETAILS = ffpr()
INFO = DETAILS.probe(r"PATH_TO_INPUT_FILE")
DETAILS.pretty(INFO)

IN THIS EXAMPLE, REPLACE "PATH_TO_INPUT_FILE" WITH THE ACTUAL PATH TO YOUR MEDIA FILE. THE .probe METHOD RETURNS A DICTIONARY CONTAINING INFORMATION ABOUT THE MEDIA FILE. THE .pretty

USING THE ffpe CLASS

THE ffpe CLASS PROVIDES METHODS FOR VIDEO CONVERSION, LISTING CODECS, AND LISTING FORMATS. HERE ARE SOME EXAMPLES OF HOW TO USE THESE METHODS:

EXAMPLE - CONVERT SINGLE VIDEO USING THIS :

from MediaSwift import ffpe

ffmpe = ffpe()

ffmpe.convert(
    input_file = r"PATH_TO_INPUT_FILE",    # INPUT FILE PATH
    output_dir = r"PATH_TO_OUTPUT_FOLDER", # OUTPUT PATH
    cv='h264',        # VIDEO CODEC
    ca='aac',         # AUDIO CODEC
    s='1920x1080',    # VIDEO RESOLUTION
    hwaccel='cuda',   # HARDWARE ACCELERATION
    ar=44100,         # AUDIO SAMPLE RATE
    ac=2,             # AUDIO CHANNELS
    ba='192k',        # AUDIO BITRATE
    r=30,             # VIDEO FRAME RATE
    f='mp4',          # OUTPUT FORMAT
    preset='fast',    # PRESET FOR ENCODING
    bv='2000k'        # VIDEO BITRATE 
)

- EXAMPLE - CONVERT MULTIPLE VIDEO USING THIS :

- QUICK TIP - ALWAYS SET INPUT FILE PATH IN SQUARE '[ ]' BRACKETS:

from MediaSwift import ffpe

ffpe_instance = ffpe()

input_files = [
    r"PATH_TO_INPUT_FILE",
    r"PATH_TO_INPUT_FILE",
    # ADD MORE FILE PATHS AS NEEDED
]
output_dir = r"PATH_TO_OUTPUT_FOLDER"

ffpe_instance.convert_with_threading(
    input_files = input_files, # INPUT FILE PATH
    output_dir = output_dir,   # OUTPUT PATH
    cv='h264',        # VIDEO CODEC
    ca='aac',         # AUDIO CODEC
    s='1920x1080',    # VIDEO RESOLUTION
    hwaccel='cuda',   # HARDWARE ACCELERATION
    ar=44100,         # AUDIO SAMPLE RATE
    ac=2,             # AUDIO CHANNELS
    ba='192k',        # AUDIO BITRATE
    r=30,             # VIDEO FRAME RATE
    f='mp4',          # OUTPUT FORMAT
    preset='fast',    # PRESET FOR ENCODING
    bv='2000k'        # VIDEO BITRATE
)

QUICK TIP : USE THE .convert(INFO) METHOD TO CONVERT MEDIA FILES .

NOTE - ALWAYS SET INPUT FILE PATH IN SQUARE '[ ]' BRACKETS:

IMPORT OBJECT AND MODULE :

from MediaSwift import ffpe, ffpl, ffpr
from MediaSwift import *

INSTALLATION :

pip install MediaSwift

AUTHOR INFORMATION:

THIS PROJECT IS MAINTAINED BY [ ROHIT SINGH ] . FOR ANY QUERIES OR CONTRIBUTIONS TO CHECK MY GITHUB, PLEASE REACH OUT TO US. THANK YOU FOR USING MediaSwift PYTHON LIBRARY, NEW LIBRARY RELEASE 2024 .

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

MediaSwift-2.1.5.tar.gz (65.0 MB view details)

Uploaded Source

Built Distribution

MediaSwift-2.1.5-py3-none-any.whl (65.0 MB view details)

Uploaded Python 3

File details

Details for the file MediaSwift-2.1.5.tar.gz.

File metadata

  • Download URL: MediaSwift-2.1.5.tar.gz
  • Upload date:
  • Size: 65.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.2

File hashes

Hashes for MediaSwift-2.1.5.tar.gz
Algorithm Hash digest
SHA256 08632cb3fa8642d716d93b896a71f908c6bfd90ac018bafbe3321a2bcd6064f2
MD5 ee04d5bda13ca2a2484b02172a70b9fa
BLAKE2b-256 bf9bd2bee758a6d3d70c77204c7b227e775340cca6c77b7f93707f742713617c

See more details on using hashes here.

File details

Details for the file MediaSwift-2.1.5-py3-none-any.whl.

File metadata

  • Download URL: MediaSwift-2.1.5-py3-none-any.whl
  • Upload date:
  • Size: 65.0 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.12.2

File hashes

Hashes for MediaSwift-2.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 04f9790bf122db3fa7e41d8daaf09982b08833de88230bccc13fd7b3cdce128e
MD5 5637e93e985d231804275d35d7a286bf
BLAKE2b-256 64ff7ce7c510c2cf41e5d861e2fe70384036f4f715bffccdbd278f9f9d6bb32d

See more details on using hashes here.

Supported by

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