Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Need a workaround for error in xuggler todo with vorbis
25 septembre 2012, par ChrisI have been at this for days, I am using xuggler, the only version i can use is 3.4 because upto 4.4 writing to outputstream directly causes jvm crash.
I need to encode audio using vorbis, however, when i run code which works with any other audio codec I get
2012-09-25 13:54:16,578 [Thread-4] ERROR org.ffmpeg - [libvorbis @ 0308a010] libvorbis: buffer overflow. 2012-09-25 13:54:16,578 [Thread-4] WARN com.xuggle.xuggler - error: avcodec_encode_audio failed (../../../../../../../csrc/com/xuggle/xuggler/StreamCoder.cpp:1586)
I think a workaround for found for this is in later versions of StreamCoder.cpp
if (mCodecContext->codec->id == CODEC_ID_FLAC || mCodecContext->codec->id == CODEC_ID_VORBIS) { // FLAC & VORBIS audio for some reason gives an error if your output buffer isn't // over double the frame size, so we fake it here. This could be further optimized // to only require an exact number, but this math is simpler and will always // be large enough. bufferSize = (64 + getAudioFrameSize() * (bytesPerSample + 1)) * 2; }
But if I use the following code to make the IBuffer,
int bufferSize = aCoder.getAudioFrameSize() * (aCoder.getBitRate()); final byte[] audioBuf = new byte[bufferSize]; //read audio bytes into audiobuf.... buf = IBuffer.make(null, audioBuf, 0, (64 + aCoder.getAudioFrameSize() * (aCoder.getBitRate() + 1)) * 2); System.out.println("afterbufmake"); smp = IAudioSamples.make(buf,1,IAudioSamples.Format.FMT_S16); if (smp == null) { System.out.println("smp == null"); // return; }
smp always ends up null.
Can anyone think of what might be happening with buffer overflow for just Vorbis and a workaround as I have only 3.4 version of Xuggler that works for what I need which is writing to outputstream.
Thank you.
-
C# Problem Reading Console Output to string
25 septembre 2012, par MoreThanChaosi want to launch ffmpeg from my app and retrive all console output that ffmpeg produces. Thing seems obvious, i followed many forum threads/articles like this one but i have problem, though i follow all information included there I seem to end up in dead end.
String that should contain output from ffmpeg is always empty. I've tried to see where is the problem so i made simple c# console application that only lists all execution parameters that are passed to ffmpeg, just to check if problem is caused by ffmpeg itself. In that case everything work as expected.
I also did preview console window of my app. When i launch ffmpeg i see all the output in console but the function that should recieve that output for further processing reports that string was empty. When my param-listing app is launched the only thing I see is the expected report from function that gets output.
So my question is what to do to get ffmpeg output as i intended at first place.
Thanks in advance MTH
-
unable to create flv file from 3gp using ffmpeg php
25 septembre 2012, par Naeemi am using the following code but it is not generating the flv file, other code is working fine if i convert mp4 to flv, following is my code.
define('FFMPEG','/usr/local/bin/ffmpeg'); $src='/home/zimmapp/public_html/images/video/video_3465733831.3gp'; $destination='/home/zimmapp/public_html/images/video/naeem.flv'; //i user this code exec(FFMPEG . " -i $src -sameq -ar 22050 -ab 96000 -deinterlace -nr 500 -s 320x240 -aspect 4:3 -r 20 -g 500 -me_range 20 -b 270k -deinterlace -f flv -y $destination"); //OR this exec( FFMPEG ." -i $src -ar 22050 -ab 32 -f flv -s 320×240 $destination") or print "Convert Error";
BUT Nothing working my website support gave me this error report:
server I found this error:Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 90000.00 (180000/2) Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/home/zimmapp/public_html/images/video/1347616191-2.3gp': Metadata: major_brand : isom minor_version : 0 compatible_brands: isom3gp4 creation_time : 2012-09-06 07:02:00 Duration: 00:00:02.32, start: 0.000000, bitrate: 9769 kb/s Stream #0.0(eng): Video: h264, yuv420p, 1280x720, 11834 kb/s, 29.58 fps, 90k tbr, 90k tbn, 180k tbc Metadata: creation_time : 2012-09-06 07:02:00 Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 126 kb/s Metadata: creation_time : 2012-09-06 07:02:00 Unable to find a suitable output format for ' -sameq'
-
ffmpeg is deleting id3 tags
25 septembre 2012, par payalI'm using below code for converting MP3 files using FFmpeg.
All id3 tags are deleted in the converted file.
exec('ffmpeg -i 01.mp3 -acodec libmp3lame -ab 128k -map_meta_data 0:0 -ac 1 1.mp3 '))
What am I doing wrong? I tried this code as well but same result – I'm getting all id3 tags deleted.
exec('ffmpeg -i 01.mp3 -acodec libmp3lame -ab 128k **-map_metadata 0:0** -ac 1 1.mp3 '))
here is the ouytput
plase find the command line output
ffmpeg version N-44715-g10c00f7-syslint Copyright (c) 2000-2012 the FFmpeg developers built on Sep 24 2012 03:18:19 with gcc 4.4.6 (GCC) 20120305 (Red Hat 4.4.6-4) configuration: --prefix=/usr/local/cpffmpeg --enable-shared --enable-nonfree --enable-gpl -- enable-pthreads --enable-libopencore-amrnb --enable-decoder=liba52 -- enable-libopencore-amrwb --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --extra-cflags=- I/usr/local/cpffmpeg/include/ --extra-ldflags=-L/usr/local/cpffmpeg/lib --enable-version3 --extra-version=syslint libavutil 51. 73.101 / 51. 73.101 libavcodec 54. 58.100 / 54. 58.100 libavformat 54. 28.100 / 54. 28.100 libavdevice 54. 2.101 / 54. 2.101 libavfilter 3. 17.100 / 3. 17.100 libswscale 2. 1.101 / 2. 1.101 libswresample 0. 15.100 / 0. 15.100 libpostproc 52. 0.100 / 52. 0.100 [mp3 @ 0x1a76240] max_analyze_duration 5000000 reached at 5015510 Input #0, mp3, from '/home/xxxxxxx/public_html/xxxx/01.mp3': Metadata: title : dheere dheere genre : www.Mp3pk.com artist : www.Mp3pk.com album : AASHIQUI Duration: 00:05:28.77, start: 0.000000, bitrate: 146 kb/s Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16, 112 kb/s Output #0, mp3, to '/home/xxxxxx/public_html/xxxx/1.mp3': Metadata: TIT2 : dheere dheere TCON : www.Mp3pk.com TPE1 : www.Mp3pk.com TALB : AASHIQUI TSSE : Lavf54.28.100 Stream #0:0: Audio: mp3, 22050 Hz, mono, s16, 16 kb/s Stream mapping: Stream #0:0 -> #0:0 (mp3 -> libmp3lame) Press [q] to stop, [?] for help size= 642kB time=00:05:28.75 bitrate= 16.0kbits/s video:0kB audio:642kB subtitle:0 global headers:0kB muxing overhead 0.043491%
-
EC2 for video-encoding
24 septembre 2012, par TK KocheranI have a potential job which will require me to do some video encoding with FFMPEG and x264. I'll have a series of files which I'll need to encode once, then I'll be able to bring down the instances. Since I'm not really sure of the resource utilization of x264 and FFMPEG, what kind of instances should I get? I'm thinking either a
High-CPU Extra Large Instance
7 GB of memory
20 EC2 Compute Units (8 virtual cores with 2.5 EC2 Compute Units each)
1690 GB of instance storage
64-bit platform
I/O Performance: High
API name: c1.xlargeor, alternatively a
Cluster GPU Quadruple Extra Large Instance
22 GB of memory
33.5 EC2 Compute Units (2 x Intel Xeon X5570, quad-core “Nehalem” architecture)
2 x NVIDIA Tesla “Fermi” M2050 GPUs
1690 GB of instance storage
64-bit platform
I/O Performance: Very High (10 Gigabit Ethernet)
API name: cg1.4xlargeWhat should I use? Does x264/FFMPEG perform better with faster/more CPUs or does it really pound the GPU more? In any case, it seems that the Cluster GPU seems to be the higher performance instance. What should I prefer?