Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
ffmpeg bitrate error when trying to capture frames at intervals from a video
25 octobre 2011, par TheShaggyBeardHere is the error I get from running this script:
[mjpeg @ 0x8559710]bitrate tolerance too small for bitrate Error while opening codec for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate, width or height
So here is what I am trying to do - I want to automate creating animated gif previews from a video file (in this case I know they will always be a specific format being mp4). Here is what I have:
echo 'Save the file-name and make a folder named "filenamemp4"' fileName=$(find . -type f -name "*.mp4") folderName=$( cat $fileName | grep -o [[:alnum:]] | tr -d '\n' | cat) echo 'Grab the frame rate and total number of frames and put them into xaa and xab' qtinfo asa.mp4 | awk 'NR = 1 { print $2 }' | grep -o "^[0-9]*" | split -l 1 echo 'Assign values to variable' frameRate=$(cat xaa) frameTotal=$(cat xab) videoLength=$(expr $frameTotal / $frameRate) echo 'Take a screenshot at 10% intervals - this is the part that gives me a bitrate error. It says that the -r option has an invalid input being 1 / value of videoLength' ffmpeg -i $fileName -y -ss $videoLength -an -sameq -f image2 -s 'qcif' -r $(expr 1/$videoLength) preview%02d.jpg echo 'Take the jpgs and mash them into an animated gif' convert -delay 50 -loop 10 preview*.jpg preview.gif echo 'Move the gif to the specified folder' mv preview.gif $folderName/preview.gif echo 'Clean Up' find . -type f -name "*.jpg" -exec rm -rf {} \;
So perhaps there is a better way of doing this, or I am understanding how to use the -r option of ffmpeg wrong. In the tutorial I read on ffmpeg for a similar scenario, they used -r 1/5 to produce frames with a 5 second interval. My assumption is that for the desired interval you want, you just slap it in the denominator for the -r option.
-
How to render video and audio
25 octobre 2011, par pic11I am trying to implement my own media player. What is the best way to render video and audio? At this point I am thinking to use SurfaceView and AudioTrack classes, but not sure if it is the best option. I am interested in SDK and NDK solutions.
File output on regular desktop is non-blocking, that is OS takes care of buffering and actual disk writes are asynchronous to the thread that initiates the output. Does the same principle apply to video and audio output? If not, I would need to run a separate thread to handle output asynchronously from decoding/demuxing.
What free software decoders are available for android? I am thinking to use ffmpeg. Can relatively recent (say, top 30% in terms of CPU power) tablet handle 1,280×720 and 1,920×1,080 formats in software mode?
-
Using ffmpeg to capture frames at intervals from a video
25 octobre 2011, par TheShaggyBeardSo here is what I am trying to do - I want to automate creating animated gif previews from a video file (in this case I know they will always be a specific format). Here is what I have:
echo 'Make a folder named "filenamemp4"' folderName=$(find . -type f -name "*.mp4" | grep -o [[:alnum:]] | tr -d '\n' | cat) echo 'Grab the frame rate and total number of frames and put them into xaa and xab' qtinfo asa.mp4 | awk 'NR = 1 { print $2 }' | grep -o "^[0-9]*" | split -l 1 echo 'Assign values to variable' frameRate=$(cat xaa) frameTotal=$(cat xab) videoLength=$(expr $frameTotal / $frameRate) echo 'Take a screenshot at 10% intervals - this is the part that gives me a bitrate error. It says that the -r option has an invalid input being 1 / value of videoLength' ffmpeg -i asa.mp4 -y -ss $videoLength -an -sameq -f image2 -s 'qcif' -r $(expr 1/$videoLength) preview%02d.jpg echo 'Take the jpgs and mash them into an animated gif' convert -delay 50 -loop 10 preview*.jpg preview.gif echo 'Move the gif to the specified folder' mv preview.gif $folderName/preview.gif echo 'Clean Up' find . -type f -name "*.jpg" -exec rm -rf {} \;
So perhaps there is a better way of doing this, or I am understanding how to use the -r option of ffmpeg wrong. In the tutorial I read on ffmpeg for a similar scenario, they used -r 1/5 to produce frames with a 5 second interval. My assumption is that for the desired interval you want, you just slap it in the denominator for the -r option.
-
ffmpeg timelapse settings to slow down video
23 octobre 2011, par Steve -
How to use ffmpeg so that there would be no need in including its dlls in your app folder ?
22 octobre 2011, par KabumbusSo my point is to find normal ffmpeg in form of .lib for c/C++ windows developers so to be capable of including all needed functions inside my app - so to say one exe no extra dlls.
So I am looking thrue its windows /autobuilds/ in search for such array of .lib files. as for now closest to what I wanted was that ffmpeg-swscale-mingw32-shared-dev\lib folder with .lib and .dll.a files. problem is I am quite new to C/C++ development so I wonder if this build is what I need or I need something else?
And what are .dll.a files for in ffmpeg mingw32 shared dev build after all?