Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
Build Live Audio Stream Player
5 décembre 2011, par KurtFor an internship project i've been trying to develop a simple audio player for audio live stream.
Currently i'm using a homemade three buffering (of 1/3 s each) solution played by QAudioOutput, which recall himself after finished his reading.
void VideoServer::getBuf(QBuffer * p_buf) { audio_chunk* ac = NULL; std::vector v; v.clear(); for (int i = 0; i < 20;) { ac = _audioPreviewSharedData->deQueueAudio(); if (ac) { v.insert(v.end(), ac->v_buf.begin(), ac->v_buf.end()); i++; delete ac; } else usleep(50000); } p_buf->close(); p_buf->setData((const char *)(&v[0]), v.size()*2); p_buf->open(QIODevice::ReadOnly); }
-
void VideoServer::slot_launchAudioPreviewBuffering() { getBuf(_buf1); getBuf(_buf2); _state = 2; connect(_audioPreviewTimer, SIGNAL(timeout()), this, SLOT(slot_audioPreviewBuffering())); _audioPreviewTimer->start(0); connect(_audioOut, SIGNAL(stateChanged(QAudio::State)), this, SLOT(finishedPlaying(QAudio::State))); }
-
void VideoServer::finishedPlaying(QAudio::State state) { if(state == QAudio::IdleState) { slot_audioPreviewBuffering(); } }
-
void VideoServer::slot_audioPreviewBuffering() { switch (_state) { case 0: { _audioOut->start(_buf2); getBuf(_buf1); _state = 1; break; } case 1: { _audioOut->start(_buf3); getBuf(_buf2); _state = 2; break; } case 2: { _audioOut->start(_buf1); getBuf(_buf3); _state = 0; break; } } }
But i'm suffering of choppy sound (little interruption between audio chunk).
How to play this flux without interruption () and with a reasonable delay between audio and video (less 1s) ? Is there a best way ? Am i doing wrong ?
Thank you !
-
Can I use ffmpeg to create multi-bitrate (MBR) MPEG-4 videos ?
5 décembre 2011, par hoangbv15I am currently in a webcam streaming server project that requires the function of dynamically adjusting the stream's bitrate according to the client's settings (screen sizes, processing power...) or the network bandwidth. The encoder is ffmpeg, since it's free and open sourced, and the codec is MPEG-4 part 2. We use live555 for the server part.
How can I encode MBR MPEG-4 videos using ffmpeg to achieve this?
-
ffmpeg missing frames when generating video from images
5 décembre 2011, par EderI have been trying to generate a video from a set of images using ffmpeg. Everything seems to be working, but when I watch the video I notice that some of the images are missing. I checked the output from ffmpeg, and it seems that it processes all the source images. Has any of you experienced the same problem? I'm using mp4 format and mpeg4 codec.
Interestingly, if I use avi format, without specifying any codec, I can see those missing images correctly (although the video seems to be jumping from one image to the next quite irregularly). By the way, I have only 14 images, so I set a frame rate of 6. The mp4 video is smooth with these settings, but the avi is quite 'jumpy'.
Thanks in advance.
-
Which is better for pixel-level analysis of television (TV) video, OpenCV or ffmpeg ? [closed]
5 décembre 2011, par Randall CookI need to do some pixel-level analysis of television (TV) video. I have used ffmpeg in the past for analyzing video from files, but it wasn't exactly easy. I am thinking of giving OpenCV a try. Any recommendations or advice?
Let's assume that I am starting with an MPEG-2 transport stream, and the analysis needs to run in real-time on Linux. I was also planning on using Intel's IPP library for some of the number crunching.
-
parser not found for codec wmav2
5 décembre 2011, par HashCoderI am getting a warning when I run the below command.
Warning: [asf @ 01C787A0] parser not found for codec wmav2, packets or times may be inval id.
I am using the latest ffmpeg.exe, did I miss any parameters. Any suggestions please.
ffmpeg -i Assets\Logitech_webcam_on_PC.wmv -sameq -f swf -y -an -s 640x360 MySlide.swf ffmpeg version N-35295-gb55dd10, Copyright (c) 2000-2011 the FFmpeg developers built on Nov 30 2011 00:52:52 with gcc 4.6.2 configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-ru ntime-cpudetect --enable-avisynth --enable-bzlib --enable-frei0r --enable-libope ncore-amrnb --enable-libopencore-amrwb --enable-libfreetype --enable-libgsm --en able-libmp3lame --enable-libopenjpeg --enable-librtmp --enable-libschroedinger - -enable-libspeex --enable-libtheora --enable-libvo-aacenc --enable-libvo-amrwben c --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxavs --enable- libxvid --enable-zlib libavutil 51. 29. 1 / 51. 29. 1 libavcodec 53. 39. 1 / 53. 39. 1 libavformat 53. 22. 0 / 53. 22. 0 libavdevice 53. 4. 0 / 53. 4. 0 libavfilter 2. 50. 0 / 2. 50. 0 libswscale 2. 1. 0 / 2. 1. 0 libpostproc 51. 2. 0 / 51. 2. 0 [asf @ 01C787A0] parser not found for codec wmav2, packets or times may be inval id. Seems stream 1 codec frame rate differs from container frame rate: 1000.00 (1000 /1) -> 0.08 (1/12) Input #0, asf, from 'Assets\Logitech_webcam_on_PC.wmv': Metadata: WMFSDKVersion : 11.0.5721.5265 WMFSDKNeeded : 0.0.0.0000 IsVBR : 1 VBR Peak : 50500.0000 Buffer Average : 66550.0000 Duration: 00:00:36.22, start: 0.000000, bitrate: 497 kb/s Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 32000 Hz, 1 channels, s16, 20 kb/s Stream #0:1(eng): Video: wmv2 (WMV2 / 0x32564D57), yuv420p, 320x180, 422 kb/ s, 0.08 tbr, 1k tbn, 1k tbc [buffer @ 02AA9760] w:320 h:180 pixfmt:yuv420p tb:1/1000000 sar:0/1 sws_param: [scale @ 02AA9A80] w:320 h:180 fmt:yuv420p -> w:640 h:360 fmt:yuv420p flags:0x4 Output #0, swf, to 'MySlide.swf': Metadata: WMFSDKVersion : 11.0.5721.5265 WMFSDKNeeded : 0.0.0.0000 IsVBR : 1 VBR Peak : 50500.0000 Buffer Average : 66550.0000 encoder : Lavf53.22.0 Stream #0:0(eng): Video: flv1, yuv420p, 640x360, q=2-31, 200 kb/s, 90k tbn, 0.08 tbc Stream mapping: Stream #0:1 -> #0:0 (wmv2 -> flv) Press [q] to stop, [?] for help frame= 4 fps= 0 q=0.0 size= 97kB time=00:00:48.00 bitrate= 16.6kbits/s frame= 5 fps= 0 q=0.0 Lsize= 111kB time=00:01:00.00 bitrate= 15.2kbits/ s dup=0 drop=599 video:111kB audio:0kB global headers:0kB muxing overhead 0.128646%