w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Android FFMPEG: Could not execute the ffmpeg from Java code
Do you have root on the device? Mount '/data' and then enter your same 'ffmpeg' command in the shell and see whether the error is the same. Try using the shell to test out different command expressions. Try 'ffmpeg' alone and with just one input file. See whether those commands produce expected output. My wild guess would be that there is an issue with calling 'ffmpeg.main()' that relates to the details of your build.

Categories : Android

FFmpeg package for php
Yes simple ffmpeg does work through PHP exec if you have necessary permissions. Sample command <?php /*** convert video to flash ***/ exec("ffmpeg -i video.avi -ar 22050 -ab 32 -f flv -s 320x240 video.flv"); ?> Source

Categories : PHP

How to use FFMPEG commands
You should be able to spawn a process to run ffmpeg using ProcessBuilder: Process ffmpeg = new ProcessBuilder().command(args).start() if (ffmpeg.waitFor() != 0) { // handle failure case } (The above code blocks the current thread until ffmpeg finishes.) However, I think your bigger issue would be having to cross-compile and distribute versions of ffmpeg for every device you're targeting.

Categories : Android

How to add album art with ffmpeg?
With Recent version, ffmpeg -i out.mp3 -i test.png -map 0:0 -map 1:0 -c copy -id3v2_version 3 metadata:s:v title="Album cover" -metadata:s:v comment="Cover (Front)" out.mp3 Use -map to associate input stream to the output Use -c copy to directly demux/remux The -id3v2_version 3 is what is missing in your command line. Note that that wil write an IDV2.3 but you can ask for a 2.4 (-id3v2_version 4) with the -id3v2_version 3 option the -metadataoption will be well interpreted

Categories : PHP

ffmpeg to convert all .jpg to mp4
I tried executing ffmpeg on Ubuntu 13.10 for doing exactly that but it started complaining with all sorts of errors. It seems ffmpeg is deprecated by avconv. Here is how I compiled my JPEGs into an .mp4 using avconv: avconv -r 30 -i line-%06d.jpg -qscale 2 -r 30 out.mp4 What I was trying to do is create a video of panning across a huge JPEG. If anyone's interested, details are here: Video panning across your family tree chart (.jpg to .mp4)

Categories : Bash

Keep timecode in ffmpeg?
from man page: http://ffmpeg.org/ffmpeg.html ‘-copyts’ Do not process input timestamps, but keep their values without trying to sanitize them. In particular, do not remove the initial start time offset value. Note that, depending on the ‘vsync’ option or on specific muxer processing (e.g. in case the format option ‘avoid_negative_ts’ is enabled) the output timestamps may mismatch with the input timestamps even when this option is selected. ‘-copytb mode’ Specify how to set the encoder timebase when stream copying. mode is an integer numeric value, and can assume one of the following values: ‘1’ Use the demuxer timebase. The time base is copied to the output encoder from the corresponding input demuxer. This is sometimes required to avoid non monotonically increasin

Categories : Osx

ffmpeg + glfwGetTime()
You added the time the decoding needs to decode the Image to the 40ms you have to wait for displaying the next. This error is because you measure the time again at the end of your loop. instead of: } tiempo = glfwGetTime(); } write: } tiempo+=duraction; }

Categories : C++

Remuxing mp4 on the fly with FFmpeg API
OK, another question researched and answered by self... Turns out, as I theorized in the question, mp4 file is not fully written until the end. During a direct disk write to a file, the producer would seek back to the start of the video and update all the pointers to various atoms. That is, the general structure of mp4 is ftyp -> mdat -> moov. Where moov contains all the meta about the contained tracks. Unfortunately, it is written last. However, its location is located in the header. That is why the seek is required: mdat is of varied length (because it contains raw encoded frames, there can be x number of them). Thus, the moov atom is offset by the length of mdat. When producer finishes writing the file, it will update the header with the proper location of moov. For additional referen

Categories : C

How to decode mp3 to pcm by ffmpeg
One way to do this is to call the executable in the code: system("ffmpeg -i input.mp3 output.wav"); //assuming the executable name is ffmpeg and its location is in PATH environment variable Another way is to use the API. Example here, see the audio_decode_example() function in that file. Some tutorials: Linuxers' Tutorial "For Beginners": http://linuxers.org/tutorial/ffmpeg-tutorial-beginners Dranger: http://dranger.com/ffmpeg/ (slightly out of date) CodeProject: http://www.codeproject.com/Tips/111468/FFmpeg-Tutorial Mathew Bajoras's Tutorial: http://www.personal.psu.edu/mrb5282/tutorials/video_ffmpeg/

Categories : C

ffmpeg get value from cropdetect
cropdetect outputs to the console, so you can parse the output and then use it as a variable: ffmpeg -i input -t 1 -vf cropdetect -f null - 2>&1 | awk '/crop/ { print $NF }' | tail -1 This will result in something like: crop=640:480:0:50 Then run your actual crop command: ffmpeg -i input -vf $cropvalue,scale=240:-1 -vframes 1 -qscale:v 2 output.jpg -vcodec mjpeg, -an, and -f rawvideo are superfluous Use -qscale:v to control jpg output quality. A sane range is 2-5 (a lower value is a higher quality). Use the scale filter instead of -s; especially if you're already using filters. Also the scale filter will allow you to set a specific width or height and with -1 it will automatically provide the correct value to preserve aspect. Otherwise if you try to force a specific size

Categories : PHP

Can ffmpeg be used to output to bytes
Yes, it is. You gotta learn how to use the other protocols FFmpeg has. Input/output to a file is just a particular protocol... but you can output, for example, to a socket, to a FTP/HTTP, and so on... It's very easy for anyone to create a new protocol (in C, of course) and register it with FFmpeg. I don't think FFmpeg has a built-in solution to write to a buffer, but for sure it's possible. I've done this once.

Categories : C#

FFmpeg error code 254
Error code 254 for FFprobe means: File not found. Thanks to blahdiblah for the tip removing -v quiet from the command. The TESTVIDEOPATH was given with " at the beginning and end to get spaces in the pathname to work. When executing it, Java excaped these " and put some extra around.

Categories : Java

bash while loop and ffmpeg
It could be because some folders contain spaces, or other weird characters. Try this (won't work for ALL but for MOST cases): while read p # reads in each line of the text file- folder_list.txt do #each iteration echo "$p" #print out current line if [ -f "${p}/frame_number1.jpg" ] #checks wether the image exists in the specific folder then echo "$p" #printsout specific folder name sleep 1 #pause for 1 second ffmpeg -f image2 -r 10 -i "${p}/frame_number%01d.jpg" -r 30 "${p}/out.mp4" #create video fi # end if statement done <folder_list.txt #end of while loop I just added quotes around arguments involving "$p" so that if it contains space (and other things) it's not

Categories : Bash

How can I seek to frame No. X with ffmpeg?
av_seek_frame will only seek based on timestamp to the key-frame. Since it seeks to the keyframe, you may not get what you want. Hence it is recommended to seek to nearest keyframe and then read frame by frame util you reach the desired frame. However, if you are dealing with fixed FPS value, then you can easily map timestamp to frame index. Before seeking you will need to convert your time to AVStream.time_base units if you have specified stream. Read ffmpeg documentation of av_seek_frame in avformat.h. For example, if you want to seek to 1.23 seconds of clip: double m_out_start_time = 1.23; int flgs = AVSEEK_FLAG_ANY; int seek_ts = (m_out_start_time*(m_in_vid_strm->time_base.den))/(m_in_vid_strm->time_base.num); if(av_seek_frame(m_informat, m_in_vid_strm_idx,seek_ts, flgs)

Categories : C

ffmpeg cannot detect file while os can
The problem is that you've set up your system so every new cmd.exe shell immediately cd's to your Documents directory, so ffmpeg is trying to run there. The obvious way around that is to just give ffmpeg absolute paths instead of relative: images = os.path.abspath('.\images') cmd = "ffmpeg -f image2 -r 20 -i {}\image%01d.png -c:v libx264 -r 20 {}\output.mp4".format(images, images) Alternatively, you can always stick a cd command into what you send to the system function: curpath = os.path.abspath(os.getcwd()) cmd = "cd {} && ffmpeg -f image2 -r 20 -i .\images\image%01d.png -c:v libx264 -r 20 .\images\output.mp4".format(curpath) However, the best solution is to stop using system entirely, as the documentation for system suggests, and leave the shell out of it: cmd = "ffmpeg

Categories : Python

Run FFmpeg executable from sdcard
You can issue permissions pragmatically to any files that resides on sd-card. Create a file object and try this file.setExecutable(boolean); – true, allows execute, false disallows it. I hope this works.

Categories : Java

PowerShell script ffmpeg
Try this: $oldvids = Get-ChildItem *.mkv -Recurse foreach ($oldvid in $oldvids) { $newvid = [io.path]::ChangeExtension($oldvid.FullName, '.mp4') .ffmpeg.exe -i $oldvid.FullName -y -vcodec copy -acodec ac3 $newvid } $oldvid is a .NET FileInfo object and when it needs to be converted to a string, it can be just the filename and not the whole path. That won't work for files not in the current dir. So just use the FullName property to get the full path.

Categories : Powershell

FFMPEG compiling on heroku
I have forgotten to add all subpaths to the LD_LIBRARY_PATH So I changed my heroku variable from LD_LIBRARY_PATH: vendor/ffmpeg/lib:/usr/local/lib to LD_LIBRARY_PATH: vendor/x264/lib:vendor/mp3lame/lib:vendor/ffmpeg/lib:/usr/local/lib via heroku config:set LD_LIBRARY_PATH=vendor/x264/lib:vendor/mp3lame/lib:vendor/ffmpeg/lib:/usr/local/lib I have made a gist with detailed compiling instructions for FFMPEG on HEROKU https://gist.github.com/klangfeld/6009744

Categories : Ruby On Rails

Need help on ffmpeg batch script
This would be my suggestion. Looks like this was follow-up from your previous thread. #!/bin/bash [ -n "$BASH_VERSION" ] || { echo "You need Bash to run this script." exit } shopt -s extglob || { echo "Unable to enable exglob." exit 1 } until read -erp "Drop source folder: " SOURCE [[ -d $SOURCE ]] do echo "Drop source folder does not exist: $SOURCE" echo "You can abort this script by pressing CTRL-C." done until read -erp "Drop destination folder: " DES [[ -d $DES ]] do echo "Drop destination folder does not exist: $DES" echo "You can abort this script by pressing CTRL-C." done while IFS= read -r FILE; do BASE=${FILE##*/} NOEXT=${BASE%.???} echo ffmpeg -i "$FILE" -vcodec prores -profile:v 0 -an "$DES/${NOEXT}.mov" ## Remov

Categories : Bash

How to call ffmpeg from Activity?
You should follow basically this steps: Build ffmpeg for android (http://bambuser.com/opensource) Load the ffmpeg library (*.so) on your app Use native calls (JNI) to call ffmpeg APIs

Categories : Android

ffmpeg set auto height
I dont know if it is possible via ffmpeg (but I dont think so, because I was using ffmpeg a while ago and dont remember there was something like this in api), but your goal would be to run one more ffpeg command to get informations about the file and then you can fit your height and width via php: $cmd = "ffmpeg -i /var/www/web1/bates.avi 2>&1"; if(preg_match('/Video: ((w+), (w+), (w+))/s', `$cmd`, $video)) { $video = $video[1]; print_r($video); //flv, yuv420p, 384x204 #or $video = $video[4]; print_r($video); //384x204 }

Categories : PHP

FFmpeg: HLS options cannot be set/get/find
Try passing in the priv_data field of AVFormatContext (ofmt->priv_data) instead of the struct itself. It will be NULL at this point in your code but it gets filled in after a call to avformat_write_header. av_opt_set_int(ofmt->priv_data, "hls_list_size", 10, AV_OPT_SEARCH_CHILDREN) should work at that point. If the options need to be set before calling avformat_write_header() like your options for Live Streaming, you should pass them as the AVDictionary** options argument to that function.

Categories : C++

ffmpeg process saying it is erroring
What you are experiencing is the standard practice across all *NIX tools: they send the "business value" data to stdout and separately send any diagnostic output to stderr. This is an important hallmark of tools written in the "small is beautiful" paradigm, which greatly values the concept of piping one tool's output into the next one's input, thereby creating an ad-hoc chain of information processing. The complete scheme would break down if the tool sent "Processing... 50% done" kind of output to stdout. Feel free to ignore such output on stderr, but make sure you consume it, as you are doing now, in order to avoid blocking due to overfull output buffers.

Categories : Java

Problems with executing FFMPEG through PHP
Any time you have an exec that doesn't work in php, you should switch to passthru for debugging. passthru('../../../../../../usr/bin/ffmpeg -ab 320k -i source.wav dest320.mp3 1 2>&1'); Appending 1 2>&1 to the end, pipes your stderr to stout, and returns any errors you have while running your exec.

Categories : PHP

Qt C++ ffmpeg cannot find library
Configure PRO-file as shown below: INCLUDEPATH += C:programmingffmpeg-20130606-git--win32-devinclude LIBS += -LC:programmingffmpeg-20130606-git--win32-devlib LIBS += -lavcodec -lavformat -lavutil Then, build the project, copy the all dll libraries from C:programmingffmpeg-20130606-git--win32-sharedin to exe output path and run application. UPD Maybe you need to copy some of the following libraries from Qt5.0.2mingw47_32in: libgcc_s_sjlj-1.dll libstdc++-6.dll libwinpthread-1.dll

Categories : C++

using ffmpeg to display video on iPhone
You should not be using ffmpeg in an iOS for a number of reasons. First, there are real license issues that put including ffmpeg in a legal grey area when it comes to iOS apps. Second, performance will be very very poor. Third, iOS already includes APIs that have access to the h.264 hardware on the device. You can find my example Xcode project at AVDecodeEncode, this is an example of using my library to decode from h.264 and then encode back to h.264.

Categories : Iphone

ffmpeg pipe blocks while capturing
I found the solution by myself, after reading this article: the problem was that the errorStreamwas full and it had to be read to let the process to continue its work, so I inserted a Thread that consumes the errorStream: public InputStream getInputStream() throws Exception { try { process = Runtime.getRuntime().exec("ffmpeg -f dshow -i video="" + query + "":audio="" + microPhoneName + "" -r 25 -vcodec mjpeg -acodec mp3 -f " + getContentExtension() + " -"); new Thread("Webcam Process ErrorStream Consumer") { public void run() { InputStream i = process.getErrorStream(); try { while (!isInterrupted()) { i.read(new byte[bufferLength]); } } catch (IOE

Categories : Java

ffmpeg: 1 frame manipulation on demand
This is a pretty complicated problem that cannot be solved by simply replacing the keyframe with a modified image. Following problems (at least) should be addressed for this to work: Re-encoding all the frames that depend on the keyframe. Otherwise, the video would be corrupt. File format considerations - The modified keyframe and subsequent frames are likely to have a different size after encoding (compared to the original encoded data). Storing them in the output file is not easy Timestamp - The timestamp information for these modified frames must be preserved, else there would be audio-video sync issues in the output file. Given these issues, my recommendation is to perform the image manipulation in the raw video frame, and encode the stream afterwards. Please let me know if I can h

Categories : PHP

ffmpeg capture image two different sizes
Yes it's possible to convert/capture 1 source to multiple destination FFmpeg Documentation clearly describe that http://ffmpeg.org/ffmpeg.html The syntax you should use is: $cmd = "ffmpeg -i $video_source -an -ss $second -t 00:00:01 -r 1 -y -vcodec mjpeg -f mjpeg -s 40x25 " . escapeshellarg($video_thubmnail_destinaion) -r1 -y -vcodec mjpeg -f mjpeg -s 128x192 " . escapeshellarg($video_big_thubmnail_destinaion) . " 2>&1";

Categories : PHP

ios ffmpeg with support for floating-point ABI
See this page for info about LGPL and iOS incompatibility, you need to think about this before attempting to use ffmpeg in an iOS app: compatibility-between-the-iphone-app-store-and-the-lgpl. There are other options that are fully legal, and if you are doing h.264 encoding just using the built-in hardware is way way faster anyway.

Categories : Iphone

FFmpeg 0.8 - Compile library to convert mp2 to mp4
I tried lots of tutorials but the one that worked for me was this one (and it is a lot newer), then I used avformat_open_input to open it: http://bambuser.com/opensource Please also post how you are creating gFormatCtx and the gFileName value! I followed this tutorial, even though it is for an old version, it is great to learn: http://dranger.com/ffmpeg

Categories : Android

ffmpeg to opengl texture with glTexImage2D
In your source code you have these lines: glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, 1 ? GL_REPEAT : GL_CLAMP ); glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, 1 ? GL_REPEAT : GL_CLAMP ); First of all, the values you want to set are integers, so you have to use glTexParameteri (note the i at the end). Second, first you disable mipmapping, then you try to reenable it. If you want to mipmap, you must supply a full image pyramid (within the selected LoD range). For a video player you normally want to disable mipmapping: glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); I converted my video to 512x256 to comply

Categories : Opengl

A random pixel on a keyframe. (ffmpeg)
This is a hard problem. The FFmpeg overlay video filter requires re-encoding. When you change ALMOST anything in a video, you will be dealing with re-encoding of the video. This might be an expensive process depending on the video and on the how hurry you are (if you want real-time, you are in a hurry). A possible solution for this would be something like this: Open the INPUT video. Create the OUTPUT video. Loop over the packets of the INPUT video until you find the frame you want. Reading the flags of the video packets (AVPacket structure) you can identify the Group of Pictures of this frame. Ok, you will have to RE-ENCODE only the frames that belong to this group of pictures. Because a GOP always start with a keyframe, you will be able to do that. After done, go on reading the packet

Categories : PHP

UDP Streaming with ffmpeg - overrun_nonfatal option
The same option works from command line or C++ libraries, you need to modify your UDP URL as follows: If you original URL looks like this: udp://@239.1.1.7:5107 Add the fifo_size and overrun parameters like this: "udp://@239.1.1.7:5107?overrun_nonfatal=1&fifo_size=50000000" Remember to escape the URL with quotes. overrun_nonfatal=1 prevents ffmpeg from exiting, it can recover in most circumstances. fifo_size=50000000 uses a 50MB udp input buffer (default 5MB) The only documentation is in the source code: http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavformat/udp.c;h=5b5c7cb7dfc1aed3f71ea0c3e980be54757d3c62;hb=dd0a9b78db0eeea72183bd3f5bc5fe51a5d3f537

Categories : C++

FFMPEG Extra just codec information
how about simply greping the string? ffprobe -v quiet -show_streams -select_streams v input.avi | grep "codec_name" You can also cut the output and read the plain string: ffprobe -v quiet -show_streams -select_streams v output.mpg | grep "codec_name" | cut -d= -f 2 if you're on windows: ffprobe -v quiet -show_streams -select_streams v input.avi | find /i "codec_name"

Categories : Java

Building ffmpeg with an executable output
Consider using scratchbox to statically cross-compile for ARM (and test) FFMPEG to your requirements on your desktop (still inside SB). Once your happy, get enough space on your droid to keep the larger than otherwise binary and adb that exe up in there. Don't forget to chmod +x

Categories : C++

Some Links and Tutorials to learn ffmpeg
This both ones are the best in my opinion. Worked good for me: http://www.roman10.net/how-to-build-ffmpeg-for-android/ http://www.roman10.net/how-to-build-android-applications-based-on-ffmpeg-by-an-example/

Categories : Android

Bundle Flex AIR application with ffmpeg
If my memory is correct, you can't bundle executables into the installer for security reasons. Well you can, but you can't execute them where they're extracted (mind you, that memory dates from before the introduction of NativeProcess). The idea - I guess - is that the user can't download an AIR app that can potentially run malicious code without him knowing it. The user has to somehow explicitly allow this, for instance by downloading the file into a specific location. To reduce the number of steps for the user, you could place a zip with a preconfigured version of ffmpeg on a server, and automatically download that on first run of the application. The user will then only have to pick a location to which the zip will be extracted. If you don't have a web server, you can serve up the

Categories : Actionscript

Loading ffmpeg-php module fails
After looking up for hours, it seems that time.h for some apparent reason has been used in ffmpeg 1.2.1 (this is what I tested). This caused conflict with the OS's own file of the same name. This causes the installation to break in CentOS 6.x, RHEL 5.6 and RHEL 6.x While I cannot code in PHP (and can barely read PHP code), I have found a git repo maintained by tony2001 who has made changes to the original project and using his repo has helped me install it successfully on CentOS-6.2, CentOS-6.3 and CentOS-6.4. You can find the repo here. This seems to solve the issues in CentOS 6.x, RHEL 5.6 and RHEL 6.x. Hope this helps anyone else trying this in the future (and maybe someone else who lands up here eventually) PS: Incidentally, at the time of writing this answer ffmpeg 2.0 has been re

Categories : PHP

Error in ffmpeg when reading from UDP stream
Incoming frames needs to be handled in a callback function. So the mechanism should be such that a callback gets called whenever there is a new frame. In this way there is no need to manually fine tune the delay. Disclaimer: I have not used ffmpeg APIs.

Categories : C++



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.