ffpyplayer | A cython implementation of an ffmpeg based player | Media Player library

 by   matham Python Version: v4.3.2 License: LGPL-3.0

kandi X-RAY | ffpyplayer Summary

kandi X-RAY | ffpyplayer Summary

ffpyplayer is a Python library typically used in Media, Media Player applications. ffpyplayer has no bugs, it has no vulnerabilities, it has build file available, it has a Weak Copyleft License and it has low support. You can download it from GitHub.

A cython implementation of an ffmpeg based player.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              ffpyplayer has a low active ecosystem.
              It has 99 star(s) with 31 fork(s). There are 16 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 20 open issues and 60 have been closed. On average issues are closed in 263 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of ffpyplayer is v4.3.2

            kandi-Quality Quality

              ffpyplayer has 0 bugs and 8 code smells.

            kandi-Security Security

              ffpyplayer has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              ffpyplayer code analysis shows 0 unresolved vulnerabilities.
              There are 1 security hotspots that need review.

            kandi-License License

              ffpyplayer is licensed under the LGPL-3.0 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              ffpyplayer releases are available to install and integrate.
              Build file is available. You can build the component from source.
              ffpyplayer saves you 332 person hours of effort in developing the same functionality from scratch.
              It has 797 lines of code, 34 functions and 10 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed ffpyplayer and discovered the below as its top functions. This is intended to give you an instant insight into ffpyplayer implemented functionality, and help decide if they suit your requirements.
            • Run pkg - config
            • Get the output of a command
            • Get wheel data
            Get all kandi verified functions for this library.

            ffpyplayer Key Features

            No Key Features are available at this moment for ffpyplayer.

            ffpyplayer Examples and Code Snippets

            No Code Snippets are available at this moment for ffpyplayer.

            Community Discussions

            QUESTION

            Python remove file after playing ffpyplayer
            Asked 2021-May-06 at 13:33

            In my project I like to play a video with cv2 and sound with ffpyplayer.

            The code is shown below works except this last line:

            ...

            ANSWER

            Answered 2021-May-06 at 03:29

            You forgot to close MediaPlayer.

            According to document:

            close_player(self)
            Closes the player and all resources.

            I've used pathlib.Path.unlink() to remove file, but should work same with os.remove. Check out pathlib.Path as this provides convenient and powerful high-level interfaces.

            Source https://stackoverflow.com/questions/67408904

            QUESTION

            Kivy sounds do not play on android device even though they play fine on laptop
            Asked 2020-Dec-09 at 05:58

            I am trying to play a sound using Kivy. The sound plays perfectly and everything works perfectly on my laptop, but when I load the APK on my Android device, the sound does not play.

            I have manually allowed "storage permissions" on my android device, and in my buildozer.spec file I have included permissions to write and read external storage. I created a test file to try and debug to see what was going wrong but to no avail. I will share the details of this test file below.

            To start, here is the .py file:

            ...

            ANSWER

            Answered 2020-Sep-29 at 07:23

            There may be quite a few reasons for this. First of all, I don't see anything wrong with the code so there must be a problem with the target system. I suggest that you check whether any access (to speaker) is blocked by antivirus software.......This has happened repeatedly with me in the past, checking the app permissions is probably the only solution.

            Source https://stackoverflow.com/questions/64014568

            QUESTION

            Kivy video not deinterlaced
            Asked 2020-Jun-19 at 13:28

            I'm developing a GUI with a video player. I'm using the Video widget, but on play I can see that my video is not/badly deinterlaced, and that some lines appears on the frame. My video is a high res video, and I have no problem playing it on my system player, only in Kivy. I have looked in the documentation of both kivy and ffpyplayer, and nothing seems to mention deinterlacing

            My code so far is simply

            ...

            ANSWER

            Answered 2020-Jun-19 at 13:28

            So I wasn't able to pass the needed parameters to the ffmpeg player used by Kivy, so instead I converted the videos with ffmpeg before passing them to kivy... Not a perfect solution, but hey, it works !

            Source https://stackoverflow.com/questions/62258734

            QUESTION

            how can i control frames in opencv?
            Asked 2020-May-31 at 21:17

            how can i control frames in opencv? here you insert the url of a video in the internet/local and this streams it to you.but voice and video are not Coordinated.video is faster than voice :/

            ...

            ANSWER

            Answered 2020-May-31 at 21:17

            It seems you can't control when to play audio because it uses SDL to play it in separated thread but get_frame() gives tuple (frame, val) and frame is (image, time_when_to_display_image) and you should use this time_when_to_display_image to control when to display image.

            And all this code doesn't need cv2.VideoCapture() to get frame.

            I use cv2 only to display it but you can use any GUI to create window to display it.

            I use current_time to get next frame without using time.sleep() because video wasn't smooth.

            BTW: You can use player.set_size(720, 480) to resize frame.

            Source https://stackoverflow.com/questions/62118915

            QUESTION

            Python 3.7.7 Kivy: Unable to find any valuable Window provider. sdl2 - ValueError: Not a boolean: 400
            Asked 2020-Apr-05 at 13:04

            I'm stuck at this problem. I have tried to install all prerequisites that i found in internet. I'm using Windows 10 and CMDer. This error also occured in any of programs of Kivy that i run. Here's the error details.

            ...

            ANSWER

            Answered 2020-Apr-05 at 13:04

            The error fixed by configuring C:\Users\\.kivy\config.ini:

            Source https://stackoverflow.com/questions/61039736

            QUESTION

            Loading texture from MPG
            Asked 2020-Mar-01 at 04:13
            Error:
            • [ERROR ] [Image ] Error loading texture somevideo.mpg
            Actual Result:
            • The error is caused and I am not able to use any of the attributes except play()
            The code for reference: ...

            ANSWER

            Answered 2020-Mar-01 at 04:13

            According to the documentation, partial

            “freezes” some portion of a function’s arguments

            So that your print function in the partial is just printing the value of self.video1.loaded as it was when the partial function was called.

            Here is a version of your posted code that prints the current version of loaded every half second:

            Source https://stackoverflow.com/questions/60414627

            QUESTION

            ffpyplayer Image to QPixmap
            Asked 2019-Oct-29 at 09:51

            I am looking for a way to stream a video file to a QPixmap in PyQt using FfPyPlayer. The docs give an example to stream Image objects out of the player, however I am not sure how to convert this Image to a QPixmap. I do see that there is a way to convert it to a bytearray, and QPixmap does have a QPixmap.loadFromData() function but I was not able to tie these two together successfully.

            Here's the example from the docs:

            ...

            ANSWER

            Answered 2019-Oct-29 at 09:51

            The problem is that QPixmap.loadFromData() expects actual image "files", while what ffpyplayer (as in ffmpeg) provides are actually raw images, which is the actual representation (rasterization) of the images as they will eventually appear.

            For various reasons, QPixmap cannot directly deal with raw data, as it's intended for showing images on screen, while QImages can, as they also are hardware independent.

            QImage can load raw image data (meaning that, for example, if the image is compressed, the raw data is the actual representation of an uncompressed image), but it needs to know something about the "image format" and, obviously the image width/height.
            When you use QPixmap.loadFromData() what actually happens is that Qt "guesses" the image file format, decompresses it (if necessary) to get data about "each pixel", gets both graphical size and pixel format, then it builds an internal QImage with all that information and finally returns it as QPixmap.

            In this case, you already have all that data provided by ffpyplayer, so you just skip the first "decoding" passage entirely and create a QImage, and then get a QPixmap from it.

            Source https://stackoverflow.com/questions/58565864

            QUESTION

            Playing video with audio on a Tkinter frame
            Asked 2019-Mar-26 at 22:00

            So I'm trying to do something really janky. I'm using opencv and ffpyplayer to try to make an embedded video player on a Tk window.

            It does work but i'm having issue syncing the audio and the video, i can get close to a decent result but after a bit it goes out of sync again.

            whole code:

            ...

            ANSWER

            Answered 2019-Mar-26 at 21:43

            So ok I found a wayyyy better solution to this. I tried using again the vlc module, I had trouble using it before but after I got through it I actually found a way to print the output from vlc to a frame with a canvas.

            It's actually stupidly simple, I got rid of cv2 and ffpyplayer and used a simple VLC player

            Note that in my case Screen is a Frame, so to make this work just use 'Frame'.winfo_id() to get the id of the tk frame where to output the video, the audio works as well. Then just use player .set_hwnd(ID) to set it to the vlc player.

            Source https://stackoverflow.com/questions/55197752

            QUESTION

            ../pypy3/bin/pip3 install give ERRORS
            Asked 2019-Feb-26 at 21:29

            I am using pypy3 to compile python project which is related to video streaming. I wanted to speed up the video (want to increase average frames per second).

            To run the project, I need to install opencv-python, scipy, ffpyplayer, and pyglet.

            I tried installing opencv using just pip, however, it did not work (I tried almost every possibilities).

            After research, I figured out that I have to use pip inside pypy folder (../pypy3/bin/pip). However, it gives same error that "Could not find a version that satisfies the requirement opencv-python (from versions: ) No matching distribution found for opencv-python". Also scipy "error: library dfftpack has Fortran sources but no Fortran compiler found".

            Have anyone ever used those packages with pypy? I have tried in virtualenv and on my computer too.

            Please help me with this since I am working on this for several weeks already. (I have tried on OSX and windows)

            ...

            ANSWER

            Answered 2019-Feb-26 at 21:29

            OpenCV on PyPI (where pip downloads from) provides only binary wheels that are compiled for cpython, not pypy. Unfortunately there is no source for binary wheels for PyPy at this time. You dont' really have any good options at this point in time (Feb 2019):

            • Try compiling from source with CMake, the OpenCV source code, and PyPy, but I wouldn't expect it to work out of the box.
            • Use this CFFI alternative which has not been updated in quite a while
            • Use cpython to interact with OpenCV and somehow pass the result to PyPy via something like pymetabiosis but that project seems unsupported

            Have you profiled your code and determined that python is slowing you down? From the packages you named, I would imagine the problem is that you are just trying to do too much in each frame, or that you are not using double buffering to read a frame while processing the previous one.

            Source https://stackoverflow.com/questions/54888910

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install ffpyplayer

            You can download it from GitHub.
            You can use ffpyplayer like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link