w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
PHP exec not executing FFmpeg command
try giving full path where the ffmpeg application is located. e.g. /usr/bin/ffmpeg So your function might look like: $output=exec("/usr/bin/ffmpeg -f image2 -i /home/phedra/imgs/image/img%03d.png -r 12 -s 610x489 /home/phedra/imgs/video/out.avi", $out); You must check what is the location of "ffmpeg".

Categories : PHP

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

In PHP, exec fails silently, sometimes, when calling many exec commands, but the same command run again later will work
I just looked at the PHP docs for exec() and you can pass an array as a reference with a second parameter which will be filled with the output of exec. You can use this to determine a) why the command is failing and b) when the command fails and integrate that into your code. So I'd change: exec($cmd); To something like: function check_exec_results($results) { echo '<HR><PRE>',print_r($output,true),'</PRE><HR>'; //use this to figure out what output you're getting from the exec commands then remove when you've figured out a way to set $results_look_good below $results_look_good = ?; //you will need to edit this yourself to actually do some kind of check return $results_look_good; } $successful_exec = false; do { $exec_results = array(

Categories : PHP

Forking Java using the Exec Maven Plugin, without using the `exec` goal
I think you can stick to exec:exec, using that kind of configuration if you want to give the project classpath to the Java process you use: <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>exec-maven-plugin</artifactId> <configuration> <executable>java</executable> <longClasspath>true</longClasspath> <arguments> <argument>-XX:MaxPermSize=128M</argument> <argument>-Xmx1024M</argument> <argument>-Xdebug</argument> <argument>-Xrunjdwp:transport=dt_socket,address=8888,server=y,suspend=n</argument> <argument>-classpath</argument> <classpath/>

Categories : Java

"bundle exec rake db:test:prepare" vs "bundle exec rake db:populate"
The first two commands execute on your development database by default, unless you specified a RAILS_ENV. rake db:test:prepare performs all the migrations on the test database. A more detailed explanation can be found here.

Categories : Ruby On Rails

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++

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 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

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

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

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

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

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

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

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#

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

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

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

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

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

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

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++

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

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

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 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

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++

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

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 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

How to reduce mp4 size by using FFMPEG lib into android
1) Yes, you need to call System.load("libavcodec.so"). You can access the methods via JNI. 2) You need to create JNI methods which are implemented in C and call ffmpeg. JNI tutorial for Android: http://code.google.com/p/awesomeguy/wiki/JNITutorial ffmpeg tutorial: http://dranger.com/ffmpeg/

Categories : Android

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

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++

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

How to link ffmpeg library by cmake?
you ought to write a finder for ffmpeg library, then use it in your cmake-enabled project to detect a correct location and all required files (headers and libs), possible allowing to user to override search results (if we are talking about a really good finder)... there are plenty tutorials about how to do that over the net. moreover, it will be relatively easy, because ffmpeg has a bunch of .pc files (at least in my gentoo system), so all that you need is to reuse pkg-config to "detect" it... and cmake have a module called FindPkgConfig w/ macro pkg_check_modules to even more simplify this task. after all, do not forget to use FindPackageHandleStandardArgs. read details in a /usr/share/cmake/Modules/readme.txt or google it...

Categories : C++

cannot link ffmpeg libraries for my own Qt project
ld: warning: directory not found for option '-L/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib' ld: warning: directory not found for option '-F/tmp/qt-stuff-85167/source/qt-everywhere-opensource-src-4.8.1/Desktop/Qt/4.8.1/gcc/lib' Did you install your Qt on /tmp and it got after a reboot autodeleted? I am not an OSX user, so this platform might work differently than I think, but it nowhere looks good when the linker tries to access folders, which don't exist.

Categories : Qt

Video player for OS X (QTKit, ffmpeg)
You can easily compile ffmpeg by regular "./configure && make" and add built static libraries into your xcode project. More sophisticated approach is to create xcode projects for each ffmpeg library (libavcodec/format/util/etc) and add them as nested projects. It is posible to add external codecs to QTKit? Check Perian project: http://trac.cod3r.com/perian/browser http://perian.org/

Categories : Osx

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++



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