Newest 'ffmpeg' Questions - Stack Overflow
Les articles publiés sur le site
-
libavcodec's AVRational vs 29.9 fps
29 mars 2014, par sigflupSo the AVCodecContext structure has a nice little member named time_base which is used to represent frames per second when encoding video, which is what I'm doing. time_base is an AVRational structure which consists of a numerator (num) and a denominator (den). I'm not good at math and so the only rational number I can think of for 29.9 is 29 and 9/10, which doesn't work. What should I fill num and den with?
p.s the answer is not 299/10
-
OpenCV no longer working after Homebrew install
28 mars 2014, par Tom smithI have have been running OpenCV from QT creator on Mac OSX. I was having trouble getting VideoWriter to work so it was suggested I try installing ffmpeg with opencv. Using brew I executed this command
brew install homebrew/science/opencv --with-ffmpeg
However, during this process I received the following error
Warning: Could not link opencv. Unlinking... Error: The `brew link` step did not complete successfully The formula built, but is not symlinked into /usr/local You can try again using `brew link opencv'
The "possible conflicting files were mostly from "/usr/local/include/opencv2/"
I tried the command brew suggested but this gave me a permission denied warning so I found a fix to execute before the command, both of which are below.
sudo chown -R `whoami` /usr/local brew link --overwrite opencv
This appeared to execute correctly giving me the following response
Linking /usr/local/Cellar/opencv/2.4.8.2... 251 symlinks created
The problem is this now seems to have broken my working project. When I try to run the project now I get the following errors Unfortunately after trying to rebuild the project I cannot get the error below to show up in the terminal again but it said the following error, was expected in /usr/local/include but not found in the build directory (afraid I cannot be sure of the exact wording)
dyld: lazy symbol binding failed:
In QT creator however, when trying to build the project it says
error: symbol(s) not found for architecture x86_64 error: linker command failed with exit code 1 (use -v to see invocation)
Any suggestions for a fix, and also how I can get VideoWriter to work with opencv on Mac OSX after I have my project working again?
-
FFmpeg rtsp over http authentication
28 mars 2014, par user441918I am trying to connect an IP camera, in rtsp over http. I am using FFmpeg 1.0.7. The below code seems working fine if the camera is open to everyone. But if the camera requires authentication, the below code doesn't work as it doesn't pass the user credentials. I don't know how to pass the user credentials to FFMpeg library.
// open video stream AVDictionary *serverOpt = NULL; av_dict_set(&serverOpt, "rtsp_transport", "http", 0); if (avformat_open_input(&_formatCtx, [url UTF8String], NULL, &serverOpt)!=0){ NSLog(@"error opening stream"); [self dealloc_helper]; return -1; // Couldn't open file }
Please advise.
-
MBP Retina Isight and FFmpeg
28 mars 2014, par ManuhozI try to reach the video stream from my brand new MacBook Pro Retina (Mavericks) to use it as an input in ffmpeg (and stream it again via RTMP).
I've tried different solutions in other stack overflow's topics but none seems to work :
wacaw -L doesn't list any device
Quicktime Broadcaster doesn't display any video (Audio only)
but the Isight does work in Photo Booth.
Any ideas ? Anyone working on the subject ?
Thanks
-
FFMPEG re-write headers for RTMP stream iOS
28 mars 2014, par Mihai GheteI'm using
FFMPEG
to stream video over theRTMP
protocol in iOS. I'm trying to make a network adaptive system which will drop frames and decrease bit rate (of video frames) if the network performance decreases. When I'm connecting to theRTMP
server, I first write the headers. But when I'm changing the video configuration, forces me to re-write the headers (using av_write_header). What is the best way to re-write the headers?This is how I'm writing the headers for the first time (this works). Based on this, how can I re-write the headers when needed?
AVStream* video = avformat_new_stream(file, videoCodec->codec), audio = avformat_new_stream(file, audioCodec->codec); memcpy(video->codec, videoCodec, sizeof(AVCodecContext)); memcpy(audio->codec, audioCodec, sizeof(AVCodecContext)); video->codec->extradata = av_malloc(video->codec->extradata_size); audio->codec->extradata = av_malloc(audio->codec->extradata_size); memcpy(video->codec->extradata, videoCodec->extradata, video->codec->extradata_size); memcpy(audio->codec->extradata, audioCodec->extradata, audio->codec->extradata_size); video->codec->codec_tag = FLV_TAG_TYPE_VIDEO; audio->codec->codec_tag = FLV_TAG_TYPE_AUDIO; video->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; audio->codec->flags |= CODEC_FLAG_GLOBAL_HEADER; audio->codec->sample_rate = audioRate; video->codec->time_base.num = 1; audio->codec->time_base.den = video->codec->time_base.den = FLV_TIMEBASE; avformat_write_header(file, NULL);
Thank you.