Saravanan666/pypi-org huggingface dataset:
Package: ffmpegio-plugin-static-ffmpeg
ffmpegio-plugin-static-ffmpeg: A Pythonffmpegioplugin to use FFmpeg binaries instatic-ffmpegpackagePython ffmpegiopackage aims to bring
the full capability ofFFmpegto read, write, and manipulate multimedia
data to Python. FFmpeg is an open-source cross-platform multimedia framework, which can handle
most of the multimedia formats available today.One caveat of FFmpeg is that there is no official program installer for Windows and MacOS (althoughhomebrewcould be used for the latter).ffmpegio-plugin-static-ffmpegenables theffmpegiopackage to
use the build of FFmpeg distributed by thestatic-ffmpegpackage.UseSimply install the package:pipinstallffmpegio-coreffmpegio-plugin-static-ffmpegThenffmpegiowill auto-detect the plugin andstatic-ffmpeg’s executables:importffmpegioprint(ffmpegio.path.FFMPEG_BIN)# ...\site-packages\static_ffmpeg\bin\win32\ffmpeg.exeprint(ffmpegio.path.FFPROBE_BIN)# ...\site-packages\static_ffmpeg\bin\win32\ffprobe.exeBecause thestatic-ffmpegpackage downloads its binaries on demand, the first
time importingffmpegiowith this plugin enabled may take a while.Noteffmpegio-plugin-static-ffmpegwillnotbe activated ifffmpegandffprobeare
already available on the system PATH.
Package: ffmpeg-media-converter
批量媒体文件格式转换器基于 ffmpeg 的批量媒体文件格式转换器License: Apache License 2.0项目地址GitHubPyPI用途将一个文件夹下指定扩展名（可指定多个）的所有媒体文件转换为指定的格式原理调用 ffmpeg 进行转换，故必须要在环境变量中设置 ffmpeg缺陷无法转换 ffmpeg 不支持的文件无法自定义更多参数，只能让 ffmpeg 自行决定或者使用 ffmpeg 的默认值（具体情况取决于 ffmpeg）delete 方法删除文件时只能通过判断相同文件名、对应扩展名的文件是否存在而决定是否删除，无法判断是否转换成功，若转换失败但对应文件存在，源文件也会被删除解释：假设文件夹下存在 a.gif ，试图转换为 a.png ，转换失败了，但是 a.png 被创建了，delete 方法检测到 a.png 存在就会删除 a.gif判断的文件名的依据：文件名与源文件一致，如源文件为 a 那么就判断是否存在 a ，扩展名为设置的 toExt ，如设置了 .png 则判断是否存在 a.png，若存在则删除 a.gif可能被删除的文件的扩展名必须在在 extensions 列表中类Image用于转换图片，默认源扩展名列表可通过.image获取，默认转换至的扩展名为.webpAudio用于转换音频，默认源扩展名列表可通过.audio获取，默认转换至的扩展名为.webmVideo用于转换图片，默认源扩展名列表可通过.video获取，默认转换至的扩展名为.webm其实三个 class 代码都非常类似，功能完全一致不同的仅仅是默认源扩展名列表和默认转换至的扩展名三个类完全可以互换，只要源扩展名列表和转换至扩展名配置正确即可实例方法convert遍历指定的文件夹，调用 ffmpeg 转换扩展名在源扩展名列表中的文件至配置的扩展名由于此方法要调用 ffmpeg ，请确保 ffmpeg 已加入环境变量delete将遍历文件夹，删除满足条件的文件此方法无需 FFmpeg无法单独保留某个文件，满足条件的将会全部删除条件：扩展名在源扩展名列表中缺陷 3 中介绍到的判断规则使用示例importffmpeg_media_converterasC# 导入converter=C.Image()# 实例化图片转换器converter.convert()# 转换converter.delete()# 删除源文件
Package: ffmpeg-media-type
ffmpeg-media-typeffmpeg-media-typeis a Python library that utilizes FFmpeg to detect various media file information, such as duration, width, and height. This library provides an easy-to-use interface for extracting essential details from media files by leveraging the powerful capabilities of FFmpeg.InstallationYou can installffmpeg-media-typevia pip:pipinstallffmpeg-media-typeNote: FFmpeg must be installed on your system for this library to function correctly. Make sure you have FFmpeg installed and added to your system's PATH.UsageTo useffmpeg-media-type, first import the library:importffmpeg_media_typeDetecting Media File InformationTo detect media file information, use thedetectfunction, providing the path to the media file as a parameter:media_info=ffmpeg_media_type.detect('/path/to/media/file.mp4')Thedetectfunction returns a model containing the following information:type: The type of media file (e.g.video,audio,image, etc.).duration: The duration of the media file in seconds.width: The width of the media file in pixels.height: The height of the media file in pixels.format: The format of the media file (e.g.mp4,mp3,png, etc.).size: The size of the media file in bytes.suggest_ext: The suggested file extension for the media file (e.g.mp4,mp3,png, etc.).Here's an example of how to access these details:duration=media_info.durationwidth=media_info.widthheight=media_info.heightExampleimportffmpeg_media_type# Specify the path to the media filefile_path='/path/to/media/file.mp4'# Detect media file informationmedia_info=ffmpeg_media_type.detect(file_path)# Extract information from the media_info dictionaryduration=media_info.durationwidth=media_info.widthheight=media_info.height# Print the extracted informationprint(f"Duration:{duration}seconds")print(f"Width:{width}pixels")print(f"Height:{height}pixels")Enhancing Accuracy in Guessing Media File Extensions with FFmpegTypically, the media file's extension is utilized to determine its file type. Nevertheless, this approach may not always yield accurate results. For instance, a file bearing the.mp4extension could, in reality, be an audio file.Theffmpeg-media-typetool enhances the precision of media file extension guessing by leveraging the built-in format functionality of FFmpeg through the commandffmpeg -formats.checkdatafor details.Access ffprobe outputIf you need to access the raw ffprobe output, you can use theffprobefunction:ffprobe_output=ffmpeg_media_type.ffprobe('/path/to/media/file.mp4')duration=ffprobe_output.format.durationcodec_type=ffprobe_output.streams[0].codec_typeContributingContributions are welcome! If you encounter any issues or have suggestions for improvements, please open an issue on theGitHub repository. If you would like to contribute code, please fork the repository and submit a pull request.Before submitting a pull request, make sure to run the tests using the following command:poetryinstall--withtestpy.testsrcPlease ensure that your code follows the established coding style and passes all tests.LicenseThis project is licensed under the MIT License. See theLICENSEfile for more information.
Package: ffmpeg-progress
ffmpeg-progressThis script is based on the work ofRupert Plumridge.Basic useimportsubprocessasspimportsysfromffmpeg_progressimportstartdefffmpeg_callback(infile:str,outfile:str,vstats_path:str):returnsp.Popen(['ffmpeg','-nostats','-loglevel','0','-y','-vstats_file',vstats_path,'-i',infile,outfile]).piddefon_message_handler(percent:float,fr_cnt:int,total_frames:int,elapsed:float):sys.stdout.write('\r{:.2f}%'.format(percent))sys.stdout.flush()start('my input file.mov','some output file.mp4',ffmpeg_callback,on_message=on_message_handler,on_done=lambda:print(''),wait_time=1)# secondsstart()is the main function to use. Ifon_messageis not passed, a default function is used. Theon_doneargument is optional. Theinitial_wait_timekeyword argument can be used to specify a time to wait before processing the log.The ffmpeg callbackmustreturn a PID (int). It is recommended to pass-nostats -loglevel 0to your ffmpeg process. The ffmpeg callback also must pass-vstats_filegiven the path from the callback argument.ffprobeAn ffprobe front-end function is included. Usage:fromffmpeg_progressimportffprobeffprobe('my file.mp4')# returns a dict()
Package: ffmpeg-py
Simple FFmpeg binding for python, mainly created for personal use.Example:fromFFmpeg.ffmpegimportFFmpegimportsubprocessffmpeg=FFmpeg()ff=(ffmpeg.OverwriteOutput().addInput("video1.webm").addInput("./logo.png").addInput("video2.webm").videoCodec("libx264").audioCodec("aac").videoFramerate(30).videoResolution(resString="1920x1080").scale2refFilter(2,0,"oh*mdar:ih*0.2","camera","video")# resize camera to 20% of screen height.overlayFilter("video","1","W-w-10","H-h-10","v")# overlay logo on bottom right.overlayFilter("v","camera","10","10")# overlay camera on top left.output("output.mp4")# output file)code,stdout,stderr=ff.execute(stderr=subprocess.STDOUT,shell=False)print(code,stdout,stderr)
Package: ffmpeg-smart-trim
Smart trim with FFMPEGThis tool implements smart trim using python-ffmpeg.
It allows precise trimming of a video with minimum re-encoding for minimum quality loss.For more info about smart trim, seehere.Installationpip3installffmpeg_smart_trimUsagepython3-mffmpeg_smart_trim.trimin.mp4--start_time12.345--end_time67.890--outputout.mp4
Package: ffmpeg-stream-to-numpy
ffmpeg stream to numpy arrays# ffmpeg must be installed!$pipinstallffmpeg-stream-to-numpyfromffmpeg_stream_to_numpyimportNumpyVideoimportcv2vi=NumpyVideo(videofile=r"C:\Users\Gamer\Videos\dfbs4.mp4",ffmpeg_param=("-re",# real speed"-hwaccel","cuda","-c:v","h264_cuvid",),)forini,iinenumerate(vi.play_video_ffmpeg()):# do something herecv2.imshow("test",i)ifcv2.waitKey(1)&0xFF==ord("q"):breakifini==100:vi.playvideo=False# stops the streamcv2.destroyAllWindows()
Package: ffmpegwrapper
FFmpegWrapper is a small wrapper for the ffmpeg encoder. You can append
Codec, Filters and other OptionStores to the FFmpeg class and then run the
resulting command.>>> from ffmpegwrapper import FFmpeg, Input, Output, VideoCodec, VideoFilter
>>> codec = VideoCodec('webm')
>>> input_video = Input('old')
>>> output_video = Output('new', codec)
>>> FFmpeg('ffmpeg', input_video, output_video)
<FFmpeg ['ffmpeg', '-i', 'old', '-vcodec', 'webm', 'new']>
Package: ffmperative
FFMPerative - Chat to Compose VideoFFMPerative is your copilot for video editing workflows. Powered by Large Language Models (LLMs) through an intuitive chat interface, now you can compose video edits in natural language to do things like:Change Speed, Resize, Crop, Flip, Reverse Video/GIFSpeech-to-Text Transcription and Closed-CaptionsJust describe your changes likethese examples.SetupRequirementsPython 3ffmpegPyPI:pip install ffmperativeOr pip install from source:git clone https://github.com/remyxai/FFMPerative.git
cd FFMPerative && pip install .ffmperativedefaults to inference using the local model on CPU.
To use the remotely hosted endpoint, set an environment variable with a huggingface token:export HF_ACCESS_TOKEN=<your-token-here>and use the optional--remoteflagQuickstartAdd closed-captions with:ffmperativedo--prompt"merge subtitles 'captions.srt' with video 'video.mp4' calling it 'video_caps.mp4'"FeaturesPython UsageSimply import the library and pass your command as a string toffmp.fromffmperativeimportffmpffmp("sample the 5th frame from '/path/to/video.mp4'",remote=True)Compose 🎞️Use thecomposecall to compose clips into an edited video. Use the optional--promptflag to guide the composition by text prompt.ffmperativecompose--clips/path/to/video/dir--output/path/to/my_video.mp4--prompt"Edit the video for social media"Resourcesffmpeg-pythonSample FFMPerative DatasetFFMPerative LLaMA2 checkpointAutomatically Edit Videos from Google Drive in ColabCommunityJoin us on Discord
Package: ffmphisdp
ffmphisDPThis package takes care of reading a video stream one frame at a time from a local file or a url while converting it to a given framerate.Features:Streaming all frames from a video url or a video fileJumping to another point of the stream at a given frame index or timestampFor a given video and a given framerate always returns the same framesHow to use itfrom ffmphisdp.video_reader import ControlledFPSVideoCapture

stream = ControlledFPSVideoCapture("myvideo.mp4", fps=10)

while True:
    ret, frame = stream.read()
    if not ret:
        break # End of the stream
    <do something with the frame>Important NotePreviously reading video was handled by the skcvideo package, it's important to understand that ffmphisdp introduces a breaking change from skcvideo.The frames returned by ffmphisdp and those returned by skcvideo are not the exact same, care should be taken when using legacy data to read videos using the correct reader.Here is an example, for a given video at 25fps converted to 10fps:skcvideo would return the original video frame indexes:0,1,2,4,7,9,12,14,17ffmphisdp return the original video frame indexes:1,3,6,8,11,13,16
Package: ffmpy
ffmpyffmpy is a simplisticFFmpegcommand line wrapper. It implements a Pythonic interface for FFmpeg command line compilation and uses Pythonsubprocessmodule to execute compiled command line.InstallationYou guessed it:pip install ffmpyQuick example>>>importffmpy>>>ff=ffmpy.FFmpeg(...inputs={'input.mp4':None},...outputs={'output.avi':None}...)>>>ff.run()This will takeinput.mp4file in the current directory as the input, change the video container from MP4 to AVI without changing any other video parameters and create a new output fileoutput.aviin the current directory.Documentationhttp://ffmpy.rtfd.ioSeeExamplessection for usage examples.Licenseffmpy is licensed under the terms of MIT license
Package: ffmpy3
ffmpy3ffmpy3 is a fork of ffmpy, a simplisticFFmpegcommand line wrapper. ffmpy implements a Pythonic interface for executing FFmpeg via command line and uses Python’ssubprocessmodule for synchronous execution. Asynchronous execution usingyield fromorawaitis also supported using Python’sasyncio.subprocessmodule.InstallationYou guessed it:pip install ffmpy3Quick exampleThe following code snippet executes FFmpeg synchronously, takinginput.mp4from the current directory as the input. It remuxes the contents ofinput.mp4into a new file calledoutput.aviwhich is saved in the current directory.>>>importffmpy3>>>ff=ffmpy3.FFmpeg(...inputs={'input.mp4':None},...outputs={'output.avi':None}...)>>>ff.run()The following code snippet does the same thing as above, but executes FFmpeg asynchronously.>>>ff=ffmpy3.FFmpeg(...inputs={'input.mp4':None},...outputs={'output.avi':None}...)>>>ff.run_async()>>>awaitff.wait()Documentationhttp://ffmpy3.rtfd.ioSeeExamplessection for usage examples.Licenseffmpy3 is licensed under the terms of the MIT license.
Package: ffmpymedia
# FFMPYMEDIAFFMPYMEDIA is a wrapper library around FFMPEG.
It interfaces with ffmpeg through the shell and interprets the program stdout/stderr to generate it’s internal structures.
The following functionality is planned or implemented.## Media AnalysisIt interprets the output of the ffprobe utility and generates it’s internal data structures with it.
The MediaAnalyser API exposes theMediaAnalyser.media_file_difference()method which returns the difference in media streams layout between a Template and a real file.
It also exposes theMediaAnalyser.validate_media_file()which determines if a mediaFile has the same layout as a Template or another media file.## Future FunctionalityIt is planned to implement wrappers around the ffmpeg utility for media transcoding and streaming and around ffserver for media stream serving and aggregation.
Package: ffms
Example usageIf you don’t need to keep the index, create a video source right away:>>> import ffms
>>> source_file = "test/x264.mkv"
>>> vsource = ffms.VideoSource(source_file)Or you can create an indexer:>>> indexer = ffms.Indexer(source_file)
>>> indexer.format_name
'matroska'
>>> indexer.track_info_list
[TrackInfo(type=0, codec_name='h264')]Then create the index for the video source:>>> index = indexer.do_indexing(-1)
>>> track_number = index.get_first_indexed_track_of_type(ffms.FFMS_TYPE_VIDEO)
>>> vsource = ffms.VideoSource(source_file, track_number, index)Extract information from the video source:>>> vsource.properties.NumFrames
8
>>> vsource.track.keyframes
[0, 5]
>>> vsource.track.timecodes
[0.0, 1000.0, 2000.0, 3000.0, 4000.0, 5000.0, 6000.0, 7000.0]Retrieve a video frame:>>> frame = vsource.get_frame(0)
>>> frame.EncodedWidth, frame.EncodedHeight
(128, 72)
>>> frame.planes[0]
array([16, 16, 16, ..., 16, 16, 16], dtype=uint8)ffmsinfo.pyis a demo script showing how this package can be used.InstallationTo install the package for Python 3, use:$ ./setup.py installTo install the package for Python 2, use:$ python2 setup.py installOn Windows, you may use one of the MSI binary packages provided on thedownload page.RequirementsPython 3.2+(or 2.7)FFmpegSourcenumpypywin32(Windows only)lib3to2(if installing for Python 2)The API was designed to be an object-oriented and Pythonic version
ofthe original FFmpegSource API.
Package: ffms2
ffms2 – Python bindings for FFmpegSourceThis project is a fork that supports more recent versions of FFMS.
The original repository can be found athttps://bitbucket.org/spirit/ffms.Example usageIf you don't need to keep the index, create a video source right away:>>> import ffms2
>>> source_file = "test/CINT_Nik_H264_720_512kb.mp4"
>>> vsource = ffms2.VideoSource(source_file)Or you can create an indexer:>>> indexer = ffms2.Indexer(source_file)
>>> indexer.format_name
'mov,mp4,m4a,3gp,3g2,mj2'
>>> indexer.track_info_list
[TrackInfo(type=0, codec_name='h264'), TrackInfo(type=1, codec_name='aac')]Then create the index for the video source:>>> for track in indexer.track_info_list:
>>>     indexer.track_index_settings(track.num, 1, 0)
>>> index = indexer.do_indexing2()
>>> track_number = index.get_first_indexed_track_of_type(ffms2.FFMS_TYPE_VIDEO)
>>> vsource = ffms2.VideoSource(source_file, track_number, index)Extract information from the video source:>>> vsource.properties.NumFrames
1430
>>> vsource.track.keyframes[:5]
[0, 12, 24, 36, 48]
>>> vsource.track.timecodes[:5]
[0.0, 41.666666666666664, 83.33333333333333, 125.0, 166.66666666666666]Retrieve a video frame:>>> frame = vsource.get_frame(0)
>>> frame.EncodedWidth, frame.EncodedHeight
(416, 240)
>>> frame.planes[0]
array([41, 41, 41, ..., 41, 41, 41], dtype=uint8)Audio stuff:>>> track_number = index.get_first_indexed_track_of_type(ffms2.FFMS_TYPE_AUDIO)
>>> asource = ffms2.AudioSource(source_file, track_number, index)
>>> aprops = asource.properties
>>> aprops.SampleRate, aprops.BitsPerSample, aprops.Channels
(48000, 16, 2)
>>> min_audio, max_audio = float("inf"), float("-inf")
>>> for audio in asource.linear_access(rate=100):
...     if audio.min() < min_audio:
...         min_audio = audio.min()
...     if audio.max() > max_audio:
...         max_audio = audio.max()
>>> min_audio, max_audio
(-16191, 18824)ffmsinfo.pyis a demo script showing how this package can be used.easy_usage.pyis a demo script showing how write the index file to speed up access to the media file.InstallationTo install the package for Python 3, use:$./setup.pyinstallPrerequisitesPython 3.7+FFmpegSourcenumpypywin32(Windows only)The API was designed to be an object-oriented and Pythonic version of the
originalFFmpegSource
API.DevelopmentThanks to GitHub actions, releasing a new version is only a matter of creating
a tag on the newest master.
Package: ffmulticonverter
Graphical application which enables you to convert audio, video, image and
document files between all popular formats using ffmpeg, unoconv, and ImageMagick.Features:Conversions for several file formats.Very easy to use interface.Access to common conversion options.Audio/video ffmpeg-presets management.Options for saving and naming files.Multilingual - over 20 languages.Requires: pyqt4 (for python3)
Optionally requires: ffmpeg, imagemagick, unoconv
Package: ffn
ffn - Financial Functions for PythonAlpha release - please let me know if you find any bugs!If you are looking for a full backtesting framework, please check outbt.
bt is built atop ffn and makes it easy and fast to backtest quantitative strategies.Overviewffn is a library that contains many useful functions for those who work inquantitative
finance. It stands on the shoulders of giants (Pandas, Numpy, Scipy, etc.) and provides
a vast array of utilities, from performance measurement and evaluation to
graphing and common data transformations.importffnreturns=ffn.get('aapl,msft,c,gs,ge',start='2010-01-01').to_returns().dropna()returns.calc_mean_var_weights().as_format('.2%')aapl62.54%c-0.00%ge36.19%gs-0.00%msft1.26%dtype:objectInstallationThe easiest way to installffnis from thePython Package Indexusingpip.pipinstallffnSince ffn has many dependencies, we strongly recommend installing theAnaconda Scientific Python Distribution. This distribution comes with many of the required packages pre-installed, including pip. Once Anaconda is installed, the above command should complete the installation.DocumentationRead the docs athttp://pmorissette.github.io/ffnQuickstartFull API
Package: ffnet
Basic usage of the package:>>> from ffnet import ffnet, mlgraph, savenet, loadnet, exportnet
>>> conec = mlgraph( (2,2,1) )
>>> net = ffnet(conec)
>>> input = [ [0.,0.], [0.,1.], [1.,0.], [1.,1.] ]
>>> target  = [ [1.], [0.], [0.], [1.] ]
>>> net.train_tnc(input, target, maxfun = 1000)
>>> net.test(input, target, iprint = 2)
>>> savenet(net, "xor.net")
>>> exportnet(net, "xor.f")
>>> net = loadnet("xor.net")
>>> answer = net( [ 0., 0. ] )
>>> partial_derivatives = net.derivative( [ 0., 0. ] )For instalation instructions and documentation go tohttp://ffnet.sourceforge.net.
Package: ffnetui
ffnetui provides GUI forffnet package. They are released separately for easier maintance. GUI tries to be as simple as possible yet providing all functionality you expect when it comes to train and test the network.InstallationUsually it should be enough to call:pip install ffnetuiand then execute ‘ffnetui’ script which just has been installed.For Windows alsoall-in-one binariesare provided.User manualWaits to be written…Prerequisitesffnetui depends on:ffnettraitsuimatplotlib
Package: ffonons
FFononsAnalysis of foundation model force fields (FF) to predict harmonic phonons.Seejanosh.github.io/ffonons. Very much work in progress! 🚧Example: Phonon bands and DOS formp-2691comparingCHGNet v0.3.3andMACE-MP-0with PBE reference data from Togo's PhononDB (excluding Born non-analytic corrections):
Package: ffp2
FFP2Simple library to generate File-Fingerprints (hashes over content to compare files or check for changes)FFP2 can help you to generate fingerprint (hashes) over the content of files. Wiht that you can easily check
if 2 different files have the very same content or if the content of a file was modified.Installation$pipinstallffp2Usage>>>fromffp2importFilefingerprint>>>fingerprint=Filefingerprint('FilepathGoesHere')>>>print(fingerprint)