I'm trying to use Google Colab to do something. Particularly I want to use ffmpeg package to create a video from a image.
But ffmpeg doesn't seems to be working fine.
The output of this (in the last block) was supposed to be 400 400 instead of 0 0
frame_width = int(cap.get(3))
frame_height = int(cap.get(4))
print frame_width, frame_height
The same code is working fine with Azure notebooks and also on my local machine.
What can be the reason for it? And how to rectify that?
You need to install ffmpeg first:
!apt install ffmpeg
As mentioned here, the following commands worked for me:
! add-apt-repository -y ppa:savoury1/ffmpeg4
! apt-get -qq install -y ffmpeg
Related
I need to use FFMpeg on my project to automatically generate thumbnails from videos uploaded to my site. I understand you need FFMpeg to do this. I can't seem to find any information on how to install FFMpeg into the Laragon Local Server. I found older tutorials on how to install FFMpeg into Xampp for example, but they are now out of date as the latest FFMpeg uses different file structures etc. Anyone know how to install FFMpeg to Laragon?
#Kevin K:
It is very simple to use FFMpeg with Laragon. Here's how:
Download the binaries:
https://github.com/BtbN/FFmpeg-Builds/releases/download/autobuild-2021-06-01-13-18/ffmpeg-n4.4-19-g8d172d9409-win64-gpl-4.4.zip
Unzip and move the 3 files in bin to C:\laragon\bin
ffmpeg.exe
ffplay.exe
ffprobe.exe
Open Laragon's Terminal Menu > Laragon > Terminal and check:
ffmpeg -v
You should use FFMpeg in your PHP code with library like:
https://github.com/PHP-FFMpeg/PHP-FFMpeg
Ref: https://forum.laragon.org/topic/2448/how-to-use-ffmpeg-to-edit-video-with-laragon
I want to add level prefix to ffmpeg logs.
Im using ffmpeg -loglevel level+info -i input
And it is working as well in my Mac (ios) but is not working in my Ubuntu 18 with ffmpeg version 3.4.6-0ubuntu0.18.04.1
When I am running it in my Ubuntu I got:
Invalid loglevel "level+info". Possible levels are numbers or:
"quite"
"panic"
...
...
...
"trace"
Please advise
The level flag was introduced in ffmpeg 4.0, so upgrade.
As Gyan's answer - The level flag was introduced in ffmpeg 4.
The solution is install FFmpeg 4 on Ubuntu by adding FFmpeg PPA on Ubuntu system acording to this guide: https://tecadmin.net/install-ffmpeg-on-linux/
sudo add-apt-repository ppa:jonathonf/ffmpeg-4
sudo apt-get update
sudo apt-get install ffmpeg
I used the pip install ffmpeg command to install ffmpeg onto my Jupyter Notebook.
However, when I try to run the animation command, I get the error:
MovieWriter ffmpeg unavailable; trying to use class 'matplotlib.animation.PillowWriter' instead.
How should I remedy this problem?
I used the command: brew install ffmpeg.
It worked
There are several different versions of ffmpeg and ffprobe flying around, and each version has a different API.
If I apt-get install ffmpeg on Ubuntu 16.04, I get ffmpeg version 2.8.15-0ubuntu0.16.04.1. If I install apt-get install ffmpeg on Ubuntu 18.04, I get version 3.4.4-0ubuntu0.18.04.1.
When I visit the ffmpeg documentation, it says "The following documentation is regenerated nightly, and corresponds to the newest FFmpeg revision. Consult your locally installed documentation for older versions." That is, the hosted documentation is neither of those two versions.
So I have two questions:
What does it mean "your locally installed documentation"? Is it only talking about man ffmpeg? Or is there some way to host the documentation as a webpage?
Are there any places that simply host the older versions of the ffmpeg documentation?
For anyone who uses docker and wants to just host the docs without thinking too much, this is the Dockerfile I came up with.
FROM ubuntu:18.04
# Install requirements for ffmpeg doc generation
RUN apt-get update && apt-get install -y git build-essential texinfo yasm
# Install requirements for minimal webserver
RUN apt-get install -y webfs mime-support && update-mime
RUN git clone https://git.ffmpeg.org/ffmpeg.git
# Checkout the version that you want
RUN cd ffmpeg \
&& git checkout tags/n2.8.15 \
&& ./configure \
&& make doc
WORKDIR /ffmpeg/doc
CMD webfsd -F -p 80
Then you can
docker build -t ffmpeg-doc .
docker run --rm -it -p 80:80 ffmpeg-doc
And visit http://localhost for the list of generated files. The common ones will be http://localhost/ffmpeg.html or http://localhost/ffprobe.html.
What does it mean "your locally installed documentation"? Is it only talking about man ffmpeg?
It is referring to the various man pages and ffmpeg -h.
Are there any places that simply host the older versions of the ffmpeg documentation?
You can make it yourself. Install the build-essential and texinfo packages, download the source code for your FFmpeg version, then make the HTML documentation:
./configure
make doc
The HTML files will be located in the doc directory.
Alternatively, and more recommended, download or compile a recent version from the git master branch and use the online documentation.
while installing ffmpeg on my centos server.I get this error while running ./configure: checking for ffmpeg headers... configure: error: ffmpeg headers not found. Make sure ffmpeg is compiled as shared libraries using the --enable-shared option
cd /usr/local/src
wget http://downloads.sourceforge.net/project/ffmpeg-php/ffmpeg-php/0.6.0/ffmpeg-php-0.6.0.tbz2?use_mirror=nchc
tar -xjf ffmpeg-php-0.6.0.tbz2
phpize
./configure
make make
install
Try using ffmpeg auto installer, you need to dounload a package with required plugins, its free,
you can refer this link for demo
https://www.youtube.com/watch?v=EaaT7vj8K2s
Here you will get complete installation package
http://ffmpeginstaller.com/
It will take around 30 mins for complete installation, you just need to keep an eye on command prompt.
You can Install FFMPEG on CENTOS by just Downloading rpm package of ffmpeg from ffmpeg.org and place at a particular location in ur Centos Server.
by Configuring the binary you can easily use ffmpeg commands.
Hope this Will help you :)
I hope this helps.
If ever you're trying to install ffmpeg to CENTOS 7, you might want to try this since this is what I did since I have a unsolvable problems with my packages.
Download compressed ffmpeg and extract it to the server: https://www.johnvansickle.com/ffmpeg/ in this case I used ffmpeg-git-amd64-static.tar.xz.
Extract the xz file. cmd: tar -xf filename.tar.xz
Extract the tar file if it's still in tar file. cmd: tar -xvf filename.tar
Go to the extracted file’s directory.
You must see these files under the folder
Try the command ./ffmpeg -version
Add it to the environment variable so that you can use the ffmpeg globally. Assuming that the ffmpeg main folder is contained in usr/ffmpeg, get the original PATH value using the command: echo $PATH , copy the original path value add it with the path of the ffmpeg directory (e.g. :usr/ffmpeg) and add it to the PATH environment variable with the command: export
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/ffmpeg
You should be able to use the ffmpeg command now with cmd: ffmpeg -version
Try to convert files now example: cmd: ffmpeg -i input.webm output.mp4 and it should all work now.