Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
When second time to do video processing using FFmpeg in JNI in Android, the app crashes with fatal signal 11
25 septembre 2013, par user1914692(1) This is an Android application, perform video processing using FFmpeg in JNI in Android. When the app is installed in the device, and run the first time to process one video file, the app runs very well. After the first video file is processed, I proceed to choose the second video file to start processing. The app immediately crashes.
Log error is:
> 09-25 10:53:52.801: I/native-activity(2339): begin: open_input_file > .mov . > 09-25 10:53:52.801: I/native-activity(2339): open_input_file > 09-25 10:53:52.801: I/native-activity(2339): begin: avformat_open_input . > 09-25 10:53:52.811: I/native-activity(2339): avformat_open_input ret: 0 > 09-25 10:53:52.811: I/native-activity(2339): begin: avformat_find_stream_info . > 09-25 10:53:52.811: A/libc(2339): Fatal signal 11 (SIGSEGV) at 0x00000028 (code=1), thread 2569 (IntentService[V)
The app crashes in "ret = avformat_find_stream_info(inVStruct.inFormatContext, NULL" See the snippet below:
LOGI("begin: avformat_find_stream_info .\n"); if ((ret = avformat_find_stream_info(inVStruct.inFormatContext, NULL)) < 0) { LOGI("Cannot find stream information\n"); av_log(NULL, AV_LOG_ERROR, "Cannot find stream information\n"); return ret; }
(2) Following the FFmpeg tutorial, I have done 5 steps to free memory for related variables in opened input video file and output video file:
// 1: close CodecContext: avcodec_close(AVCodecContext) // 2: free Frame: avcodec_free_frame(AVFrame *): free frame and dynamically allocated objects in it, e.g. extended_data; av_free(AVFrame *) // 3: close the file (either AVFormatContext->pb, or FILE *): avio_close(AVFormatContext->pb); fclose(FILE *) // 4: free AVFormatContext and all its streams: avformat_free_context(AVFormatContext *) // 5: free data: av_free( * ): Free a memory block which has been allocated with av_malloc(z)() or av_realloc(). av_freep recommended. e.g. av_free(avPicture.data[0]);
All freeings are fine.
One minor point: From demuxing.c, it seems it does not do avformat_free_context for the input video file. I tried that in the program, and it shows error; so I remove the two sentences below.
avformat_free_context(inVStruct.inFormatContext); LOGI("finish: inVStruct.inFormatContext"); 09-25 10:49:40.222: A/libc(1915): @@@ ABORTING: LIBC: ARGUMENT IS INVALID HEAP ADDRESS IN dlfree addr=0x7204a0a8 09-25 10:49:40.222: A/libc(1915): Fatal signal 11 (SIGSEGV) at 0xdeadbaad (code=1), thread 2107 (IntentService[V)
(3) I suspect the the crash when doing processing the 2nd time is because of something is not freed, so it is out of memory. But I do free those variables.
Any clue? Thanks!
-
php_ffmpeg extension installed, want to know available classes in this extension [on hold]
25 septembre 2013, par user2808180I have successfully installed the php extension "php_ffmpeg" and it is working fine. I tested the extension with class ffmpeg_movie and It shows me complete information of the file.
But the problem is to convert any uploaded video file to flv. Is there any classes available in the extension 'php_ffmpeg', I would like you to share some sample code for that.
I will like to stick to php code as I am not sure that I might not get access to the share server shell.
I also tried exec, on my Windows Based local machine, but I haven't found success beyond "DIR" command.
Please if you have some knowledge about "php_ffmpeg" extension and classes available in it, with example code or know some resource which include that please help me.
$return = 1; $output = array(); $source = $_SERVER['DOCUMENT_ROOT'] . '/sample.avi'; $target = $_SERVER['DOCUMENT_ROOT'] . '/target.flv'; $cmd = "ffmpeg -i {$source} {$target}"; exec($cmd, $output, $return); echo '
'; print_r($output); echo '
'; echo $cmd; -
How to save file to s3 after processing by ffmpeg using carrierwave
25 septembre 2013, par loganathanI am trying to convert the bit rate of the Mp3 file before uploading to S3, I can able to create version for the mp3 file but the version is not saving in s3 instead original file is uploading to s3.
version :bitrate_96k do process :resample => "96" end def resample(bitrate) tmp_path = File.join( File.basename(current_path), "tmpfile" ) File.rename current_path, tmp_path audio_details = `ffmpeg -i '#{tmp_path}' 2>&1`.split(",").split("\n").flatten file_bitrate = audio_details.grep(/bitrate/).grep(/bitrate/).join.split("bitrate: ").last.split("\s").first unless file_bitrate == bitrate `ffmpeg -i #{tmp_path.shellescape} -acodec libmp3lame -y -ab 96k #{current_path.path}` File.unlink(current_path) FileUtils.mv(temp_path, current_path) end end
-
FFMPEG Covert from MP4 to WEBM only working on some files.
25 septembre 2013, par ShivamDI have tried the following URLs, using the streamio wrapper for FFMPEG. The URL's are
http://static.bouncingminds.com/ads/5secs/baileys_5sec.mp4 (works) http://techslides.com/demos/sample-videos/small.mp4 (doesn't work)
For the latter I get the following error:
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height
The code I use to transcode them:
movie.transcode("test.webm", "-vcodec libvpx -strict -2") { |p| puts p }
As mentioned this works perfectly for the first video. Is there any specific setting I need in order to work with all mp4 videos?
-
Error in converting a MOV video into MP4 using ffmpeg
25 septembre 2013, par user2767347I want to convert a mov video into mp4 using ffmpef library of php. I am using given code:
$cmd='ffmpeg -i sample.mov -sameq output.mp4'; echo exec($cmd);
It is not working at all. Even I didn't get any error. Could anyone tell me the proper steps to do this conversion. I have tried a lot of code examples but not working for me.