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

remove initial period and text after final period in string
This regex does what you want: ^.+|.[^.]*$ Replace its matches with the empty string. In R: gsub("^\.+|\.[^.]*$", "", subject, perl=TRUE); Explanation: ^ # Anchor the match to the start of the string .+ # and match one or more dots | # OR . # Match a dot [^.]* # plus any characters except dots $ # anchored to the end of the string.

Categories : Regex

Format input field to separate the first 4 digits with a period, and the next 2 digits with a period
you can use input boxes of required length ex: <input type="text" maxlength="4">.<input type="text" maxlength="2">.<input type="text" maxlength="4">

Categories : Javascript

Count within a time period, a group of a smaller time period
Yup, possible with a GROUP BY and a HAVING, using some UNIX_TIMESTAMP rounding (subtracting stamp % 300 from stamp) to group into blocks of 300 seconds (5 minutes). SELECT COUNT(*), MIN(stamp) FROM mytable WHERE stamp >= NOW() - INTERVAL 30 minute GROUP BY FROM_UNIXTIME( UNIX_TIMESTAMP(stamp) - MOD(UNIX_TIMESTAMP(stamp),300) ) HAVING COUNT(*) >= 4 This assumes that you mean clock blocks rather than rolling blocks, i.e. you want from 00:00:00 to 00:04:59 etc., rather than from 13:23:01 to 13:28:00. This causes some issues with the "30 minutes ago" rule, so you might want to think that one through a bit carefully. EDIT: Well seeing as you insisted on making it a rolling block... let's add some delicious awfully-performing joining. SELECT COUNT(*), rolling.s

Categories : Mysql

Oracle group by work time period and non work time period
The key to this grouping is to subtract 9 hours from the datetime to get the "workdate" and then use the hour function to determine whether it is a work hour or something else. Here is an example: select trunc(worktime - 9.0/24) as workdate, (case when hour(worktime) between 8 and 20 then 'WorkHours' else 'OtherHours' end), count(*) from t group by trunc(worktime - 9.0/24), (case when hour(worktime) between 8 and 20 then 'WorkHours' else 'OtherHours' end); To check for a particular month, you probably want to use the workdate rather than the actual date (so the first nine hours of the month are really part of the previous month).

Categories : SQL

Querying for a time period between a time period
I think your logic is backwards, if you want the constants between the column values: SELECT * FROM ALLOCATION WHERE dt_starting <= STR_TO_DATE('2013-09-02', '%Y-%m-%d') AND dt_ending >= STR_TO_DATE('2013-09-06', '%Y-%m-%d') AND id_res = 1; EDIT: If you are looking for an overlap between the time periods, then the logic is that one starts before the other ends, and the first ends after the second neds: SELECT * FROM ALLOCATION WHERE dt_starting <= STR_TO_DATE('2013-09-06', '%Y-%m-%d') AND dt_ending >= STR_TO_DATE('2013-09-02', '%Y-%m-%d') AND id_res = 1;

Categories : Mysql

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

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

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

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

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

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

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#

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

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

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

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

ffmpeg + play video loop
From documentqtion lavf_decoding.html#ga4fdb3084415a82e3810de6ee60e46a61">http://ffmpeg.org/doxygen/trunk/group_lavf_decoding.html#ga4fdb3084415a82e3810de6ee60e46a61 0 if OK, < 0 on error or end of file so if <0 then call av_seek_frame to return to start (same doc)

Categories : C++

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

Starting Multiple FFmpeg Sessions
If you want to run processes in parallel, you need to place an ampersand & at the end of the process execution line, to inform the shell you want it running in the background. For example, this command runs the five processes in sequence (about ten seconds): $ date;for i in 1 2 3 4 5;do sleep 2;done;date Tue, Sep 10, 2013 4:05:32 PM Tue, Sep 10, 2013 4:05:43 PM Whereas this one only takes two seconds because they're running in parallel: $ date;for i in 1 2 3 4 5;do sleep 2 & done;wait;wait;wait;wait;wait;date Tue, Sep 10, 2013 4:05:45 PM [1] 6116 [2] 4940 [3] 7040 [4] 6944 [5] 3592 [1] Done sleep 2 [2] Done sleep 2 [3] Done sleep 2 [4]- Done sleep 2 [5]+ Done sleep 2 Tue,

Categories : Linux

Find out what device to use for capturing with ffmpeg?
You can determine the currently active ALSA device by testing with aplay, like so aplay -vv /path/to/sample.wav Alternatively, you could explicitly configure a specific hardware device by setting it in /etc/asound.conf The bitrate of the ffmpeg audio codec can be controlled via the -ab parameter

Categories : Linux

Video Trimming via ffmpeg twice crash
Your problem may be related to discussion here The linked thread is old but symptom there was that android/JNI call to ffmpeg worked first time but not the second time. As noted in the thread, the solution is to explicitly unload/load the library in between successive calls to ffmpeg. you could try it.

Categories : Android

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

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

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

How to build FFmpeg 2.0 for android on linux?
Either in ./build_android.sh or in ./configure you have an extra ^M. Open the files with vi and clean them from this garbage, see ./configure : /bin/sh^M : bad interpreter

Categories : Android



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