Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Confused about writing a media converter
23 août 2011, par Erich LancasterI want to write my own media converter application using ffmpeg. I have a couple of questions
Can I use a command line to make the conversion. I don't think that would work if the user hasn't installed ffmpeg on to his system. If that's the case, how'd I overcome it. I don't believe their API has anything for media conversion.
Is it possible to write it in Java?
-
Transcoding a video from GoToMeeting WMV to MP4 using FFMPEG on Windows locks up dos window [migrated]
22 août 2011, par RyanI've been tasked with converting some pre-recorded GoToMeeting videos from wmv to mp4 format. I've got the GoToMeeting transcoder app available from Citrix (g2mtranscoder.exe) that takes the source wmv and makes it so that ffmpeg can work with the wmv. The problem I have is when I then try and take that wmv and transcode it to mp4.
I'm using the latest pre-compiled static version of ffmpeg for Windows from here http://ffmpeg.zeranoe.com/builds/
Here is the command line I'm using to begin the conversion:
"C:\ffmpeg\ffmpeg.exe" -i "999_1366_768_g2m_transcoded.wmv" -f "mp4" -b "1000k" -r "30" -ab "128k" -ar "22050" -s "1366x768" -strict "experimental" -y "999.mp4"
Here is FFMPEG's output. The last line is where the dos window seems to stop executing/locks up (when I say lock up I mean just the dos window is locked up, not the entire machine):
ffmpeg version N-31932-g41bf67d, Copyright (c) 2000-2011 the FFmpeg developers built on Aug 16 2011 18:54:12 with gcc 4.6.1 configuration: --enable-gpl --enable-version3 --enable-memalign-hack --enable-runtime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --enable-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib libavutil 51. 12. 0 / 51. 12. 0 libavcodec 53. 10. 0 / 53. 10. 0 libavformat 53. 7. 0 / 53. 7. 0 libavdevice 53. 3. 0 / 53. 3. 0 libavfilter 2. 31. 1 / 2. 31. 1 libswscale 2. 0. 0 / 2. 0. 0 libpostproc 51. 2. 0 / 51. 2. 0 [asf @ 01BBB600] max_analyze_duration 5000000 reached at 5194000 Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000/1) -> 59.92 (719/12) Input #0, asf, from 'D:\Inetpub\g2m\Transcoding\999_1366_768_g2m_transcoded.wmv': Metadata: WMFSDKVersion : 10.00.00.4007 WMFSDKNeeded : 0.0.0.0000 IsVBR : 1 VBR Peak : 4403 Buffer Average : 1470 WM/ToolVersion : 4.8 Build 723 WM/ToolName : GoToMeeting BitRateFrom the writer: 1553 Audio samples : 6221 Video samples : 3455 recording time : Mon, 22 Aug 2011 11:48:42 Eastern Daylight Time Duration: 00:38:30.71, start: 0.000000, bitrate: 160 kb/s Stream #0.0: Audio: wmav2, 44100 Hz, 1 channels, s16, 48 kb/s Stream #0.1: Video: wmv3 (Main), yuv420p, 1366x768, 2154 kb/s, 59.92 tbr, 1k tbn, 1k tbc [buffer @ 01BBC120] w:1366 h:768 pixfmt:yuv420p tb:1/1000000 sar:0/1 sws_param: Output #0, mp4, to '\\nas4\FMS_APPLICATIONS\SVC\sk12\webinars\999.mp4': Metadata: WMFSDKVersion : 10.00.00.4007 WMFSDKNeeded : 0.0.0.0000 IsVBR : 1 VBR Peak : 4403 Buffer Average : 1470 WM/ToolVersion : 4.8 Build 723 WM/ToolName : GoToMeeting BitRateFrom the writer: 1553 Audio samples : 6221 Video samples : 3455 recording time : Mon, 22 Aug 2011 11:48:42 Eastern Daylight Time encoder : Lavf53.7.0 Stream #0.0: Video: mpeg4, yuv420p, 1366x768, q=2-31, 1000 kb/s, 30 tbn, 30 tbc Stream #0.1: Audio: aac, 22050 Hz, 1 channels, s16, 128 kb/s Stream mapping: Stream #0.1 -> #0.0 Stream #0.0 -> #0.1 Press [q] to stop, [?] for help frame= 149 fps= 63 q=23.5 size= 1103kB time=00:00:04.96 bitrate=1818.6kbits/s dup=144 drop=0
Does anyone have any idea why it's locking up the dos window and essentially failing to convert the file to mp4? I had a friend test it on a linux box and he was able to convert the video just fine.
Thanks
-
Decoding a TCP stream using ffmpeg
22 août 2011, par JConwayI am using the Ffmpeg library in an Android application I am writing. I have written the code to open up a local file and decode that using avformat_open_input(). However I need to use Ffmpeg to read in a video stream over TCP. I have found a few things within Ffmpeg such as libavcodec/tcp.h but I can't establish how to actually open up a TCP stream into the decoder.
Any suggestions would be really appreciated.
-
play audio (stream) with ffmpeg on iphone
22 août 2011, par The Psicopathi compiled FFMpeg and i have put them in the xcode project, i don't found in the net any tutorial for stream a wma file with this lib, someone have any tutorial links? (or can make me any example?) thanks!
-
FFMPEG with QT memory leak
22 août 2011, par Timothy BaldridgeLet me start with a code clip:
QByteArray ba; ba.resize(500000); int encsize = avcodec_encode_video(context, (uint8_t*)ba.data(), 500000, frame.unownedPointer());
What I'm doing is encoding the data from frame and putting the data into the buffer pointed at QByteArray. If I comment out the avcodec_encode_video line my memory leak goes away. unownedPointer() looks like this:
if (this->frame != NULL) return this->frame; this->frame = avcodec_alloc_frame(); uchar *data = this->img.bits(); frame->data[0] = (uint8_t *)data; frame->data[1] = (uint8_t *)data + 1; frame->data[2] = (uint8_t *)data + 2; frame->linesize[0] = width * lineSize(this->fmt); frame->linesize[1] = width * lineSize(this->fmt); frame->linesize[2] = width * lineSize(this->fmt); return this->frame;
Where this->frame is a AVFrame *, and this->img is a QImage.
At a encoding rate of about 30fps, I'm getting a memory leak of about 50MB/sec. So I'm not sure what the issue could be. It seems as if avcodec_encode_video() is copying memory and never freeing it or something. Any ideas?
If avcodec_encode_video is converting my RGB24 data to YUV420P would it be modifying the data pointed to by frame.unownedPointer()?