From kalileo at universalx.net Wed May 1 00:09:32 2013 From: kalileo at universalx.net (Kalileo) Date: Wed, 1 May 2013 05:09:32 +0700 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: On May 1, 2013, at 03:27 , Carl Eugen Hoyos wrote: > Brad O'Hearne writes: > >> As constructive feedback, I recommend removing aac entirely >> from the codebase PLEASE NOOOO!!!! > > The native aac encoder is better than most non-experimental > audio encoders for stereo input, it is not good for >2 channels > (which is not supported at all by most other encoders). I can confirm that, we use the "experimental" ffmpeg aac in production on a lot of transcoders (stereo), and there are absolutely zero problems, nada, nothing, everybody is happy with the quality. It might not have all the features possible, but it is great as it is already, we love it. If there is the impression created here that ffmpeg aac would have a quality problem, then I strongly disagree, based on real practical experience using it every day. Please do not remove it, unless there is a better one included instead. Brad, that the problem with what you spread here, you elaborate and theorize about your problems, and propose fundamental changes to ffmpeg, but all based on some unsystematic experiments, assumptions and half-theories. And at the end the problem is never in ffmpeg. Your "constructive feedback" to remove aac would be a disaster for the many who use it and are happy with it, please do not recommend such a nonsense. From klaussfreire at gmail.com Wed May 1 00:21:40 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Tue, 30 Apr 2013 19:21:40 -0300 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: On Tue, Apr 30, 2013 at 7:09 PM, Kalileo wrote: >> The native aac encoder is better than most non-experimental >> audio encoders for stereo input, it is not good for >2 channels >> (which is not supported at all by most other encoders). > > I can confirm that, we use the "experimental" ffmpeg aac in production on a lot of transcoders (stereo), and there are absolutely zero problems, nada, nothing, everybody is happy with the quality. It might not have all the features possible, but it is great as it is already, we love it. > > If there is the impression created here that ffmpeg aac would have a quality problem, then I strongly disagree, based on real practical experience using it every day. > > Please do not remove it, unless there is a better one included instead. Indeed this symptom seems to happen only with >2 channels. Is there any possibility of improvement here? Or is there some legal blockage or something like that? From cehoyos at ag.or.at Wed May 1 00:24:21 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 30 Apr 2013 22:24:21 +0000 (UTC) Subject: [Libav-user] Audio quality loss while encoding References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: Brad O'Hearne writes: > "This codec is not to be used for production, > as it will not continue to be developed or supported." Neither is true as far as I can tell. (Again, I am not a native speaker, so I may misunderstand you sentence, but the aac encoder is neither less nor more supported than any other encoder, and will certainly see more development than at least most other encoders in the future.) Carl Eugen From cehoyos at ag.or.at Wed May 1 00:24:57 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 30 Apr 2013 22:24:57 +0000 (UTC) Subject: [Libav-user] Audio quality loss while encoding References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: Claudio Freire writes: > Indeed this symptom seems to happen only with >2 channels. > > Is there any possibility of improvement here? Patch definitely welcome! Carl Eugen From klaussfreire at gmail.com Wed May 1 00:33:14 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Tue, 30 Apr 2013 19:33:14 -0300 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: On Tue, Apr 30, 2013 at 7:24 PM, Carl Eugen Hoyos wrote: > Claudio Freire writes: > >> Indeed this symptom seems to happen only with >2 channels. >> >> Is there any possibility of improvement here? > > Patch definitely welcome! Surely I could and would like to give it a try, I've written an AC3 encoder way back so there should be no surprises. However, I do have my plate overly full. Any docs to read about its current limitations and perhaps previous experience working on it that you have handy? (I'll of course google eventually if I get to it, but... saving time by asking ;) ) From brado at bighillsoftware.com Wed May 1 02:14:00 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 30 Apr 2013 17:14:00 -0700 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: On Apr 30, 2013, at 3:09 PM, Kalileo wrote: > Brad, that the problem with what you spread here I spread *nothing*. Here's the exact statement from Paul Mahol, presumably one of the developers on the list. > Note that native aac encoder is experimental and mostly useless. If you feel the AAC encoder is *not* mostly useless (I have no idea, I"m just listening to those in the know), then take it up with Paul. My point is what would be the point of leaving "mostly useless" code in the codebase. If someone else finds use for it, great -- then the assertion that it is "mostly useless" is what you should be taking issue with. If it is of great use, then awesome, don't leave it in. > , you elaborate and theorize about your problems, and propose fundamental changes to ffmpeg, but all based on some unsystematic experiments, assumptions and half-theories. And at the end the problem is never in ffmpeg. That is completely irrelevant to the issue of whether leaving a dead codec (if indeed that is as indicated) in the codebase, and is nothing more than taking an uncalled-for personal swipe. But since you brought it up, there were no "unsystematic experiments". I've had a running app with 100% source code posted to this list, for everyone to see; I posted the steps I had taken, the tests I had run, the output I received, and what my understanding was of various aspects of FFmpeg function, and my reasoning as to what the problems might be. I've also been very appreciative of any feedback or discussion given. That said, bottom line -- the "theories" of those replying turned out to be wrong. If my question was so boneheaded and elementary -- why wasn't it obvious? The code has been sitting there for a month now, I've just done my level best to ask the questions I had. Look, as I've said previously when others wanted to turn a problem of 1s and 0s into a personal attack -- I'm not here to have adversarial communication, I'm here to solve a code problem for a client. And in the most diplomatic way possible, I've tried to communicate -- and I'll be a little bit more precise about it this time around -- FFmpeg might be the greatest set of tools ever created, but the API, documentation, and examples leave much ambiguity and many questions. It isn't a user's API -- it's like a tech book written for a reader that has the foreknowledge of the author. That isn't a knock, it is merely an observation, and one in the best interest of the improvement of FFmpeg, not a diss of anyone's girlfriend or turf. Forget my own personal opinion about it, just read the posts that roll in on the mailing list...I've been on the list now for over a year -- the same questions continually arise. Ever thought to ask why that is? It isn't anything to get your knickers in a twist about -- that's GOOD info -- that's info that helps show the way to where things might be improved, clarified. I personally thought that was the spirit and intention of open source software -- by virtue of community interaction, the tools and understanding of how to use them were improved. I thought leaving the solution to my problem up on Github for others might be a nice contribution for others who come after with a similar use-case. But it has become quite clear through having to see this problem through that the mere asking of questions has definite boundaries here, and there are those that take affront to a simple deductive process if there's any remote insinuation that there might be an issue (and I don't even mean a bug here, I mean a potential usage issue) with FFmpeg. Considering all possibilities until they are ruled out via testing -- don't know what to tell you. That's a common approach. No fingers pointed, no offense intended. Its all nuts and bolts. B From cehoyos at ag.or.at Wed May 1 02:26:05 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 1 May 2013 00:26:05 +0000 (UTC) Subject: [Libav-user] Audio quality loss while encoding References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: Claudio Freire writes: > Surely I could and would like to give it a try, > I've written an AC3 encoder way back so there > should be no surprises. That sounds incredibly promising! > However, I do have my plate overly full. > Any docs to read about its current limitations > and perhaps previous experience working on it > that you have handy? Sorry, not more than git log and possibly some discussion on ffmpeg-devel that I do not remember;-( There is a real test somewhere that shows that the stereo encoding is not as bad, the quality issues with >2 channels should be easily reproducible. Sorry, Carl Eugen From brado at bighillsoftware.com Wed May 1 03:07:23 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 30 Apr 2013 18:07:23 -0700 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: That is a far cry from "mostly useless" as Paul claims. I guess I wasn't as ignorant in my original assumption of the meaning of the term "experimental" as was suggested. Sent from my iPhone On Apr 30, 2013, at 3:24 PM, Carl Eugen Hoyos wrote: > Brad O'Hearne writes: > >> "This codec is not to be used for production, >> as it will not continue to be developed or supported." > > Neither is true as far as I can tell. > (Again, I am not a native speaker, so I may > misunderstand you sentence, but the aac encoder > is neither less nor more supported than any > other encoder, and will certainly see more > development than at least most other encoders > in the future.) > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From kalileo at universalx.net Wed May 1 08:30:56 2013 From: kalileo at universalx.net (Kalileo) Date: Wed, 1 May 2013 13:30:56 +0700 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: <280CBFFD-B3C5-49B1-8AD0-23DBD26E7529@universalx.net> On May 1, 2013, at 07:14 , Brad O'Hearne wrote: > On Apr 30, 2013, at 3:09 PM, Kalileo wrote: > >> Brad, that the problem with what you spread here > > I spread *nothing*. Here's the exact statement from Paul Mahol, presumably one of the developers on the list. 'presumably' - again you assume, and use such an assumption as the basis of a theory / recommendation. Then, Paul did not recommend to remove it, but _you_ did. >> , you elaborate and theorize about your problems, and propose fundamental changes to ffmpeg, but all based on some unsystematic experiments, assumptions and half-theories. And at the end the problem is never in ffmpeg. > > That is completely irrelevant to the issue of whether leaving a dead codec (if indeed that is as indicated) in the codebase, and is nothing more than taking an uncalled-for personal swipe. But since you brought it up, there were no "unsystematic experiments". I've had a running app with 100% source code posted to this list, for everyone to see; I posted the steps I had taken, the tests I had run, the output I received, and what my understanding was of various aspects of FFmpeg function, and my reasoning as to what the problems might be. I've also been very appreciative of any feedback or discussion given. That said, bottom line -- the "theories" of those replying turned out to be wrong. If my question was so boneheaded and elementary -- why wasn't it obvious? The code has been sitting there for a month now, I've just done my level best to ask the questions I had. > > Look, as I've said previously when others wanted to turn a problem of 1s and 0s into a personal attack -- I'm not here to have adversarial communication, I'm here to solve a code problem for a client. And in the most diplomatic way possible, I've tried to communicate -- and I'll be a little bit more precise about it this time around -- FFmpeg might be the greatest set of tools ever created, but the API, documentation, and examples leave much ambiguity and many questions. It isn't a user's API -- it's like a tech book written for a reader that has the foreknowledge of the author. That isn't a knock, it is merely an observation, and one in the best interest of the improvement of FFmpeg, not a diss of anyone's girlfriend or turf. Forget my own personal opinion about it, just read the posts that roll in on the mailing list...I've been on the list now for over a year -- the same questions continually arise. Ever thought to ask why that is? > > It isn't anything to get your knickers in a twist about -- that's GOOD info -- that's info that helps show the way to where things might be improved, clarified. I personally thought that was the spirit and intention of open source software -- by virtue of community interaction, the tools and understanding of how to use them were improved. I thought leaving the solution to my problem up on Github for others might be a nice contribution for others who come after with a similar use-case. But it has become quite clear through having to see this problem through that the mere asking of questions has definite boundaries here, and there are those that take affront to a simple deductive process if there's any remote insinuation that there might be an issue (and I don't even mean a bug here, I mean a potential usage issue) with FFmpeg. Considering all possibilities until they are ruled out via testing -- don't know what to tell you. That's a common approach. No fingers pointed, no offe > nse intended. Its all nuts and bolts. This is another example of what I mean, you could have said that with 10% of the words you used. These long elaborations make it very difficult to understand your problem(s) and to help you (which I have tried several times, and which at least in one case have helped you to make progress). So far, from what I remember, despite all the theories about mysterious problems in ffmpeg the solution to the problems you reported and elaborated here have not resulted in any bug report for ffmpeg. The solution was always that the assumptions you made, and based your elaborations on, were wrong. Others called that FUD, I call it half-theories. My only point is (as said before) is that I recommend that, instead of developing theories about problems in ffmpeg based on assumptions, to check and recheck your assumptions, systematically, all of them. So far, once you started to do that, you found a solution to all problems you reported here, didn't you? So this is merely an attempt to help you to get to a solution to your problems faster. Feel free to ignore it. Over and out. From klaussfreire at gmail.com Wed May 1 08:42:34 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Wed, 1 May 2013 03:42:34 -0300 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: On Tue, Apr 30, 2013 at 9:26 PM, Carl Eugen Hoyos wrote: > Claudio Freire writes: > >> Surely I could and would like to give it a try, >> I've written an AC3 encoder way back so there >> should be no surprises. > > That sounds incredibly promising! > >> However, I do have my plate overly full. > >> Any docs to read about its current limitations >> and perhaps previous experience working on it >> that you have handy? > > Sorry, not more than git log and possibly some > discussion on ffmpeg-devel that I do not remember;-( > > There is a real test somewhere that shows that > the stereo encoding is not as bad, the quality > issues with >2 channels should be easily > reproducible. Well.. didn't test the test, but I did find something. Still not all seems fixed, for I can still find some artifacts, and a very important symptom: it doesn't achieve the target bitrate. That's weird isn't it? What I found was a simple numeric bug in aacpsy.c:319 float avg_chan_bits = chan_bitrate / ctx->avctx->sample_rate * (j ? 128.0f : 1024.0f); Should be float avg_chan_bits = chan_bitrate * (j ? 128.0f : 1024.0f) / ctx->avctx->sample_rate; Why? Rounding. chan_bitrate / sample_rate is an integer op, and can induce a lot of rounding error for many channels (low chan_bitrate) or high sample_rate. The perceptual difference is notorious, not everywhere, but when allocation is stressed, it now performs notably better. I didn't perform double-blind tests... I should. I've got a big family to shove test on ;^) But still, not perfect... I gave it 256k, and it produced 140k. Lots of room for improvement still, but I thought I'd share this bit. I'll keep looking. From klaussfreire at gmail.com Wed May 1 09:26:53 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Wed, 1 May 2013 04:26:53 -0300 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: On Wed, May 1, 2013 at 3:42 AM, Claudio Freire wrote: > What I found was a simple numeric bug in aacpsy.c:319 > > float avg_chan_bits = chan_bitrate / ctx->avctx->sample_rate * > (j ? 128.0f : 1024.0f); > > Should be > > float avg_chan_bits = chan_bitrate * (j ? 128.0f : 1024.0f) / > ctx->avctx->sample_rate; > > Why? Rounding. chan_bitrate / sample_rate is an integer op, and can > induce a lot of rounding error for many channels (low chan_bitrate) or > high sample_rate. The perceptual difference is notorious, not > everywhere, but when allocation is stressed, it now performs notably > better. I didn't perform double-blind tests... I should. I've got a > big family to shove test on ;^) > > But still, not perfect... I gave it 256k, and it produced 140k. Lots > of room for improvement still, but I thought I'd share this bit. I'll > keep looking. Aaand mostly finally in aaccoder.c:713, search_for_quantizers_twoloop ignores lambda, so there's no effective rate control. Replacing int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels; with int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels * lambda; Results in general bliss. Will check the other search methods. From brado at bighillsoftware.com Wed May 1 12:28:08 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Wed, 1 May 2013 03:28:08 -0700 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: <280CBFFD-B3C5-49B1-8AD0-23DBD26E7529@universalx.net> References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> <280CBFFD-B3C5-49B1-8AD0-23DBD26E7529@universalx.net> Message-ID: On Apr 30, 2013, at 11:30 PM, Kalileo wrote: > Then, Paul did not recommend to remove it, but _you_ did. If useless, why keep useless code? If not useless, keep it. Whether useless or not, that's for you to debate with who claimed it, which wasn't me. I don't care either way -- I just would prefer no cruft in the code. > Others called that FUD, I call it half-theories. The reason people have to conjecture about how FFmpeg works is that there is no manual, guide, or sufficient document explaining it adequately -- the only answers are locked in certain people's heads. If you don't want people coming to the mailing list and trying in earnest to understand how FFmpeg works, then document it. > So far, from what I remember, despite all the theories about mysterious problems in ffmpeg the solution to the problems you reported and elaborated here have not resulted in any bug report for ffmpeg. The solution was always that the assumptions you made, and based your elaborations on, were wrong. I think this probably tells the tale more than anything. This was never a competition or matter of "I'm right, you're wrong" to me. I came here to solve a problem for a client, not pit my code vs. FFmpeg, and use it to pump my ego and take a victory lap at someone else's expense in a public forum. I've literally spent weeks on this, and have done far more testing and "rechecking" than I've indicated, at no one's prompting or direction on this mailing list. Here is a direct summary of the reason my problem (which was actually the combination of several problems) was difficult to solve: 1. Inadequate examples and documentation. 2. Partially accurate/inaccurate information received on this mailing list about the nature of pts, dts, and time_base. 3. At worst a bug in documentation, at best very confusing documentation about the AVCodecContext's frame_size. 4. Questions of alignment. (on a side note -- why does this question ever have to be asked -- if FFmpeg requires it, either assert or check / return error in the code, so there's no question) Some of the info was helpful. Some of it was not. It took many, many hours of testing to sift through it and figure out what was accurate, and what was not. In the end, it was someone off-list who had used FFmpeg in the past and had gone on to roll his own video / audio encoding toolset who listened to the bad audio and immediately knew it wasn't an alignment problem (even though I had tested that out and knew it too), which freed me to turn my turrets elsewhere. Dumping AAC and going against what it appears the API doc says regarding AVCodecContext frame_size resulted in the resolution. Brad From klaussfreire at gmail.com Wed May 1 12:53:10 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Wed, 1 May 2013 07:53:10 -0300 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: On Wed, May 1, 2013 at 4:26 AM, Claudio Freire wrote: >> But still, not perfect... I gave it 256k, and it produced 140k. Lots >> of room for improvement still, but I thought I'd share this bit. I'll >> keep looking. > > > Aaand mostly finally in aaccoder.c:713, search_for_quantizers_twoloop > ignores lambda, so there's no effective rate control. > > > Replacing > > int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels; > > with > > int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / > avctx->channels * lambda; > > Results in general bliss. Will check the other search methods. Ok... I had to forfeit my right to sleep, but here it is. Managed to make both the fast and 2loop methods work reasonably well (albeit I don't know why anyone would use fast, because it's not faster. I assume it's an experiment?). I don't have access to AAC standards, though, since they're paywalled (at least the ones I found), so most of the changes were done blind, assuming from what I know of audio codecs, and by trial and error. In particular, fast has some magic numbers there that I got from trial and error, and nothing more... profound. In any case, attached it is, git diff. -------------- next part -------------- A non-text attachment was scrubbed... Name: aac_bit_alloc.patch Type: application/octet-stream Size: 3380 bytes Desc: not available URL: From klaussfreire at gmail.com Wed May 1 12:58:42 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Wed, 1 May 2013 07:58:42 -0300 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: On Wed, May 1, 2013 at 7:53 AM, Claudio Freire wrote: > On Wed, May 1, 2013 at 4:26 AM, Claudio Freire wrote: >>> But still, not perfect... I gave it 256k, and it produced 140k. Lots >>> of room for improvement still, but I thought I'd share this bit. I'll >>> keep looking. >> >> >> Aaand mostly finally in aaccoder.c:713, search_for_quantizers_twoloop >> ignores lambda, so there's no effective rate control. >> >> >> Replacing >> >> int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / avctx->channels; >> >> with >> >> int destbits = avctx->bit_rate * 1024.0 / avctx->sample_rate / >> avctx->channels * lambda; >> >> Results in general bliss. Will check the other search methods. > > > Ok... I had to forfeit my right to sleep, but here it is. Managed to > make both the fast and 2loop methods work reasonably well (albeit I > don't know why anyone would use fast, because it's not faster. I > assume it's an experiment?). > > I don't have access to AAC standards, though, since they're paywalled > (at least the ones I found), so most of the changes were done blind, > assuming from what I know of audio codecs, and by trial and error. > > In particular, fast has some magic numbers there that I got from trial > and error, and nothing more... profound. > > In any case, attached it is, git diff. Oh, forgot to explain a bit. I believe the reason why it works for channels=2 and not so much for >2, is that psy already does some rate control by adapting the model to the bit rate and bit reservoire. But that doesn't work for channels > 2, since psy doesn't see all channels at once in those cases, only pairs of channels, and it ends up introducing some significant bias towards an over-estimation. There's the lambda parameter compensating that... except AAC quantization parameter search methods mostly ignored it, save faac (which I didn't try). Fast had some rather nasty bugs too, resulting in entirely zeroed out zones in complex passages. Fixed that somewhat by tweaking numbers, adding bias against zeroing. From dribas at cenatav.co.cu Wed May 1 16:41:48 2013 From: dribas at cenatav.co.cu (Dayana) Date: Wed, 01 May 2013 10:41:48 -0400 Subject: [Libav-user] compiling ffmpeg with -fPIC Message-ID: <518129AC.7010205@cenatav.co.cu> Hi!!! Im developing an aplication using libavcodec, libavformat and libavutil. Im trying to make a shared library and for that I have to get libavs compiled with -fPIC ... I was trying to do it by setting --enable-pic in the configure file, however Im still have the same error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC could somebody give me a hint please?? :) dayana From cehoyos at ag.or.at Wed May 1 16:59:19 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 1 May 2013 14:59:19 +0000 (UTC) Subject: [Libav-user] compiling ffmpeg with -fPIC References: <518129AC.7010205@cenatav.co.cu> Message-ID: Dayana writes: > Im trying to make a shared library and for that I > have to get libavs compiled with -fPIC ... I was > trying to do it by setting --enable-pic in the > configure file, however Im still have the same error: > > /usr/local/lib/libavcodec.a(lpc_mmx.o) You are (still) trying to link a static library - /usr/local/lib/libavcodec.a - with a shared object compiled with -fpic which cannot work. Carl Eugen From ratin3 at gmail.com Wed May 1 17:00:16 2013 From: ratin3 at gmail.com (Ratin) Date: Wed, 1 May 2013 08:00:16 -0700 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: <518129AC.7010205@cenatav.co.cu> References: <518129AC.7010205@cenatav.co.cu> Message-ID: On Wed, May 1, 2013 at 7:41 AM, Dayana wrote: > Hi!!! Im developing an aplication using libavcodec, libavformat and > libavutil. Im trying to make a shared library and for that I have to get > libavs compiled with -fPIC ... I was trying to do it by setting > --enable-pic in the configure file, however Im still have the same error: > > /usr/local/lib/libavcodec.a(**lpc_mmx.o): relocation R_X86_64_PC32 > against symbol `ff_pd_1' can not be used when making a shared object; > recompile with -fPIC > > > could somebody give me a hint please?? > > :) dayana > ./configure --extra-cflags="-fPIC" > ______________________________**_________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/**listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ratin3 at gmail.com Wed May 1 17:03:16 2013 From: ratin3 at gmail.com (Ratin) Date: Wed, 1 May 2013 08:03:16 -0700 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: References: <518129AC.7010205@cenatav.co.cu> Message-ID: On Wed, May 1, 2013 at 8:00 AM, Ratin wrote: > On Wed, May 1, 2013 at 7:41 AM, Dayana wrote: > >> Hi!!! Im developing an aplication using libavcodec, libavformat and >> libavutil. Im trying to make a shared library and for that I have to get >> libavs compiled with -fPIC ... I was trying to do it by setting >> --enable-pic in the configure file, however Im still have the same error: >> >> /usr/local/lib/libavcodec.a(**lpc_mmx.o): relocation R_X86_64_PC32 >> against symbol `ff_pd_1' can not be used when making a shared object; >> recompile with -fPIC >> >> >> could somebody give me a hint please?? >> >> :) dayana >> > > > > ./configure --extra-cflags="-fPIC" > > assuming you do --enable-shared option, and not statically linking > > > ______________________________**_________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/**listinfo/libav-user >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed May 1 17:02:19 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 1 May 2013 15:02:19 +0000 (UTC) Subject: [Libav-user] Audio quality loss while encoding References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: Claudio Freire writes: > I don't have access to AAC standards These are not the final standards, but should help: ftp://ftp.tnt.uni-hannover.de/pub/MPEG/audio/mpeg4/documents/ Carl Eugen From dribas at cenatav.co.cu Wed May 1 17:07:48 2013 From: dribas at cenatav.co.cu (Dayana) Date: Wed, 01 May 2013 11:07:48 -0400 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: References: <518129AC.7010205@cenatav.co.cu> Message-ID: <51812FC4.30604@cenatav.co.cu> |First of all thanks a lot!! ./configure --extra-cflags="-||fPIC" assuming you do --enable-shared option, and not statically linking | |You are (still) trying to link a static library - /usr/local/lib/libavcodec.a - with a shared object compiled with -fpic which cannot work. >> Im only did ./configure, make, make install, for obtaining the libavcodec.a, that is that Im using for creating mi libx.so | On 05/01/2013 11:03 AM, Ratin wrote: > > > > On Wed, May 1, 2013 at 8:00 AM, Ratin > wrote: > > On Wed, May 1, 2013 at 7:41 AM, Dayana > wrote: > > Hi!!! Im developing an aplication using libavcodec, > libavformat and libavutil. Im trying to make a shared library > and for that I have to get libavs compiled with -fPIC ... I > was trying to do it by setting --enable-pic in the configure > file, however Im still have the same error: > > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation > R_X86_64_PC32 against symbol `ff_pd_1' can not be used when > making a shared object; recompile with -fPIC > > > could somebody give me a hint please?? > > :) dayana > > > > | > | > > |./configure --extra-cflags="-||fPIC" > > > > | > > |assuming you do --enable-shared option, and not statically linking| > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed May 1 17:04:49 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 1 May 2013 15:04:49 +0000 (UTC) Subject: [Libav-user] compiling ffmpeg with -fPIC References: <518129AC.7010205@cenatav.co.cu> Message-ID: Ratin writes: > ./configure --extra-cflags="-fPIC" This is not a good idea since an equivalent option exists (that may set additional settings). Carl Eugen From ratin3 at gmail.com Wed May 1 18:05:08 2013 From: ratin3 at gmail.com (Ratin) Date: Wed, 1 May 2013 09:05:08 -0700 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: References: <518129AC.7010205@cenatav.co.cu> Message-ID: On Wed, May 1, 2013 at 8:04 AM, Carl Eugen Hoyos wrote: > Ratin writes: > > > ./configure --extra-cflags="-fPIC" > > This is not a good idea since an equivalent > option exists (that may set additional settings). > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > Agreed, if the equivalent option works. -------------- next part -------------- An HTML attachment was scrubbed... URL: From dribas at cenatav.co.cu Wed May 1 18:07:08 2013 From: dribas at cenatav.co.cu (Dayana) Date: Wed, 01 May 2013 12:07:08 -0400 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: References: <518129AC.7010205@cenatav.co.cu> Message-ID: <51813DAC.10707@cenatav.co.cu> I tried with > ./configure --extra-cflags="-fPIC" and I still have the same error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC :( On 05/01/2013 12:05 PM, Ratin wrote: > On Wed, May 1, 2013 at 8:04 AM, Carl Eugen Hoyos > wrote: > > Ratin writes: > > > ./configure --extra-cflags="-fPIC" > > This is not a good idea since an equivalent > option exists (that may set additional settings). > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > Agreed, if the equivalent option works. > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From klaussfreire at gmail.com Wed May 1 20:39:11 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Wed, 1 May 2013 15:39:11 -0300 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1366802514683-4657364.post@n4.nabble.com> <6AFDAFCD-E398-452B-9A72-4D701E6B569B@bighillsoftware.com> <84921EB5-A68B-4B6B-A808-F153A3B726C1@bighillsoftware.com> <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: On Wed, May 1, 2013 at 12:02 PM, Carl Eugen Hoyos wrote: > Claudio Freire writes: > >> I don't have access to AAC standards > > These are not the final standards, but should help: > ftp://ftp.tnt.uni-hannover.de/pub/MPEG/audio/mpeg4/documents/ Cool, thanks From xuanyu.huang at gmail.com Thu May 2 14:53:03 2013 From: xuanyu.huang at gmail.com (=?GB2312?B?u8bQ+dPu?=) Date: Thu, 2 May 2013 22:53:03 +1000 Subject: [Libav-user] sws_scale crashes Message-ID: Hi Guys, I met a crash when doing image conversion (just pixel format conversion, no resizing). sws_context is got using sws_getContext (I also tried sws_getCachedContext) code fragment is here: pFrameConverted = avcodec_alloc_frame(); int numBytes = avpicture_get_size(LPixelFormatToFFMPEG(vfSource.pf), vfSource.iWidth, vfSource.iHeight); buffer = (uint8_t *)av_malloc(numBytes*sizeof(uint8_t)); avpicture_fill((AVPicture *)pFrameConverted, buffer, LPixelFormatToFFMPEG(vfSource.pf), vfSource.iWidth, vfSource.iHeight); // pCurrentFrame is the AVFrame object returned by av_decode_video2 sws_scale(pSwsContext, pCurrentFrame->data, pCurrentFrame->linesize, 0, vfSource.iHeight, pFrameConverted->data, pFrameConverted->linesize) ; sws_scale crashes randomly (crashes in different frames). Can anyone provide any idea on this? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From radu.robotin at gmail.com Thu May 2 15:24:17 2013 From: radu.robotin at gmail.com (Radu Robotin) Date: Thu, 2 May 2013 16:24:17 +0300 Subject: [Libav-user] av_buffersink_get_frame() crashes Message-ID: I'm using ffmpeg with libavcodec and libavfilters for a custom project. I've recently upgraded to the latest version available from git and noticed that my previous code has stopped working. I'm processing several streams, each in his own thread in the following way: next sample is taken from the stream, decoded and then inserted in the buffer source of the filtergraph using av_buffersrc_add_frame() a frame is extracted from the buffer sink of the filtergraph using av_buffersink_get_frame() the filtered frame is copied in a buffer for further processing before upgrading to the latest version of ffmpeg I've been using ffmpeg 1.2 and everything worked flawlessly. The filtered buffer was pulled from the filtergraph using the av_buffersink_get_buffer_ref(). The problem I'm encountering: at the first pass everything works fine, however when I call the processing function for the second time (for processing the next frame), it coredumps when I call av_buffersink_get_frame() with the message " corrupted double-linked list ". I tried further investigating the problem and have several frames processed during the same call of this function: everything works until the second call, then it coredumps at the same point. To me it seems that something changes the structure of the filtergraph between the calls to the processing function. Has something changed from the previous version in the way filtergraph is created/stored? I would really like to use the new API and pull frames out of the buffersink, instead of getting the buffer as it is in ver 1.2. Thanks, any help would be appreciated! -------------- next part -------------- An HTML attachment was scrubbed... URL: From xtingray at gmail.com Thu May 2 16:12:21 2013 From: xtingray at gmail.com (=?ISO-8859-1?Q?Gustav_Gonz=E1lez?=) Date: Thu, 2 May 2013 09:12:21 -0500 Subject: [Libav-user] Creating animated GIF using libavformat Message-ID: Hello there, Currently, I'm working on a Qt-based class to export arrays of images as movie clips. The code works perfectly with almost all the extensions, except by the GIF format. This is how I usually create every frame for my animations: writeVideoFrame(const QImage &image) .... RGBtoYUV420P(image.bits(), pic_dat, image.depth()/8, true, width, height); avpicture_fill((AVPicture *)picture, pic_dat, PIX_FMT_YUV420P, width, height); Now, for the case of GIF animations, I already know that I have to work with the RGB pixel format. I figured it out by myself after I got this message: ERROR: gif only handles the rgb24 pixel format. Use -pix_fmt rgb24. So, I started to try things like this: writeVideoFrame(const QImage &image) .... avpicture_fill((AVPicture *)picture, image.bits(), AV_PIX_FMT_RGB24, width, height); Unfortunatelly, the result is not the expected. This is a little example of my problem. What should be one circle moving through the scene, is the same animation scaled and repeated three times: http://www.maefloresta.com/tmp/test.gif I know my code is missing some kind of image transformation similar to RGBtoYUV420P() but for the case of the GIF RGB24 pixel format. At least, that's my guess. I really appreciate any hint from you guys. Thank you! -- ============================ Gustav Gonzalez xtingray at gmail.com ============================ -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu May 2 18:22:31 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 2 May 2013 16:22:31 +0000 (UTC) Subject: [Libav-user] Creating animated GIF using libavformat References: Message-ID: Gustav Gonz?lez writes: > ERROR: gif only handles the rgb24 pixel format. Originally, there was a gif muxer that only accepted rgb24 rawvideo as input. In current git head, you will find a gif encoder (an encoder instead of a muxer) that can be used by the image2 muxer (the same muxer used for jpg, tif, tga etc.) and that accepts different colour spaces. Carl Eugen From onemda at gmail.com Thu May 2 18:36:01 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 2 May 2013 16:36:01 +0000 Subject: [Libav-user] Creating animated GIF using libavformat In-Reply-To: References: Message-ID: On 5/2/13, Carl Eugen Hoyos wrote: > Gustav Gonzalez writes: > >> ERROR: gif only handles the rgb24 pixel format. > > Originally, there was a gif muxer that only accepted > rgb24 rawvideo as input. > In current git head, you will find a gif encoder (an > encoder instead of a muxer) that can be used by the > image2 muxer (the same muxer used for jpg, tif, tga gif muxer only. > etc.) and that accepts different colour spaces. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From Jamal.Waseem at de.bosch.com Thu May 2 07:43:17 2013 From: Jamal.Waseem at de.bosch.com (Jamal Waseem (RBEI/ESD1)) Date: Thu, 2 May 2013 13:43:17 +0800 Subject: [Libav-user] av_find_stream_info returns -1 Message-ID: Hi, Currently I am decoding H264 stream and I am successfully able to save each frame on my Hard disk. I want to use the same code in my Library(DLL) which I am building but when I use av_find_stream_info() then the structure is not getting updated and the function is returning -1. If(av_find_stream_info(pFormatCtx)<0) Return -1 Where pFormatCtx is of type AVFormatContext. AVFormatContext *pFormatCtx=NULL; Please help me regarding this ? Mit freundlichen Gr??en / Best regards Jamal Waseem RBEI/ESD1 Tel. +918067835850 Mobil +919008403062 BeQIK -------------- next part -------------- An HTML attachment was scrubbed... URL: From xtingray at gmail.com Thu May 2 21:42:58 2013 From: xtingray at gmail.com (=?ISO-8859-1?Q?Gustav_Gonz=E1lez?=) Date: Thu, 2 May 2013 14:42:58 -0500 Subject: [Libav-user] Creating animated GIF using libavformat In-Reply-To: References: Message-ID: 2013/5/2 Paul B Mahol > On 5/2/13, Carl Eugen Hoyos wrote: > > Gustav Gonzalez writes: > > > >> ERROR: gif only handles the rgb24 pixel format. > > > > Originally, there was a gif muxer that only accepted > > rgb24 rawvideo as input. > > In current git head, you will find a gif encoder (an > > encoder instead of a muxer) that can be used by the > > image2 muxer (the same muxer used for jpg, tif, tga > > gif muxer only. > > etc.) and that accepts different colour spaces. > Ok, I'm sorry if I do dummy questions, but I'm still learning the basics about all the ffmpeg/video stuff. I already downloaded the source code from the git repository and I found two files that I assume are what I need to study: libavcodec/gif.c (GIF encoder) libavformat/gif.c (Animated GIF muxer) Is there any other file I should take a look at? I was reading those files, and the methods I found give me a good idea about how to use them, nevertheless I would like to see a "hello world" example (working), do you have any? Thank you! PS: I was looking for one inside the ffmpeg code, but I had no luck. -- ============================ Gustav Gonzalez xtingray at gmail.com ============================ -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Fri May 3 02:09:35 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 02 May 2013 21:09:35 -0300 Subject: [Libav-user] avcodec_decode_audio4() help Message-ID: <5183003F.4080506@gmail.com> I have a problem with the latest releases of ffmpeg. I was using code that mimicked the code in avcodec_decode_audio3 calling avcodec_decode_audio4. However, when I use that code now I get a frying pan noise when playing the audio in my viewer. I reverted to avcodec_decode_audio3 again and it shows as deprecated but I also get the frying pan noise. I looked at ffplay and I almost fainted how much the code for avcodec_decode_audio4 is. Can someone guide me through the avcodec_decode_audio4 with some example simpler than ffplay.c? Lots of thanks in advance. From kalileo at universalx.net Fri May 3 06:30:02 2013 From: kalileo at universalx.net (Kalileo) Date: Fri, 3 May 2013 11:30:02 +0700 Subject: [Libav-user] avcodec_decode_audio4() help In-Reply-To: <5183003F.4080506@gmail.com> References: <5183003F.4080506@gmail.com> Message-ID: <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> On May 3, 2013, at 07:09 , Gonzalo Garramuno wrote: > I have a problem with the latest releases of ffmpeg. I was using code that mimicked the code in avcodec_decode_audio3 calling avcodec_decode_audio4. However, when I use that code now I get a frying pan noise when playing the audio in my viewer. I reverted to avcodec_decode_audio3 again and it shows as deprecated but I also get the frying pan noise. > I looked at ffplay and I almost fainted how much the code for avcodec_decode_audio4 is. > Can someone guide me through the avcodec_decode_audio4 with some example simpler than ffplay.c? > Lots of thanks in advance. It might help if you add more info, such as what kind of audio you're working with (which shows the problem), and if there's any kind of audio which does not show this effect. If you decode aac, then you might get hit by the change to planar format, which happened November 16, 2012 in the ffmpeg sources (although the effect is usually not a 'frying pan noise'). From wseemann at gmail.com Fri May 3 06:31:54 2013 From: wseemann at gmail.com (William Seemann) Date: Thu, 02 May 2013 23:31:54 -0500 Subject: [Libav-user] Using FFmpeg programmatically with a proxy Message-ID: <51833DBA.2060806@gmail.com> I'm trying to use FFmpeg with a proxy. The following code works if I comment out: setenv("http_proxy", "http://172.0.0.1:3128/", 1); The proxy server is an instance of Squid]. I know the proxy server is working because I can use the same URL with VLC without any issues. With the proxy specified, the output from my code is always: Proxy path: http://172.0.0.1:3128/ Metadata could not be retrieved -5 // indicates an IO Error setDataSource failed, rc is: -1 I compiled FFmpeg with everything enabled. Can someone explain why this code doesn't work with a proxy? #include #include #include #include const int SUCCESS = 0; const int FAILURE = -1; typedef struct State { AVFormatContext *pFormatCtx; int audio_stream; int video_stream; AVStream *audio_st; AVStream *video_st; } State; int setDataSource(State** ps, const char* path) { State *state = *ps; if (state->pFormatCtx) { avformat_close_input(&state->pFormatCtx); } int ret = 0; if ((ret = avformat_open_input(&state->pFormatCtx, path, NULL, NULL)) != 0) { printf("Metadata could not be retrieved %d\n", ret); *ps = NULL; return FAILURE; } if (avformat_find_stream_info(state->pFormatCtx, NULL) < 0) { printf("Metadata could not be retrieved\n"); avformat_close_input(&state->pFormatCtx); *ps = NULL; return FAILURE; } *ps = state; return SUCCESS; } const char* extractMetadata(State** ps, const char* key) { char* value = NULL; State *state = *ps; if (!state->pFormatCtx) { goto fail; } if (key) { if (av_dict_get(state->pFormatCtx->metadata, key, NULL, AV_DICT_IGNORE_SUFFIX)) { value = av_dict_get(state->pFormatCtx->metadata, key, NULL, AV_DICT_IGNORE_SUFFIX)->value; } } fail: return value; } int main(void) { setenv("http_proxy", "http://172.0.0.1:3128/", 1); unsetenv("no_proxy"); const char *proxy_path = getenv("http_proxy"); if (proxy_path) { printf("Proxy path: %s\n", proxy_path); } else { printf("No proxy specified\n"); } av_register_all(); avformat_network_init(); State * state = av_mallocz(sizeof(State)); int ret = setDataSource(&state, "http:///song.mp3"); if (ret == 0) { printf("setDataSource succedded!\n"); printf("Artist: %s\n", extractMetadata(&state, "artist")); } else { printf("setDataSource failed, rc is: %d\n", ret); } return EXIT_SUCCESS; } From nicolas.george at normalesup.org Fri May 3 12:32:19 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Fri, 3 May 2013 12:32:19 +0200 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: References: <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> Message-ID: <20130503103219.GC28705@phare.normalesup.org> Le duodi 12 flor?al, an CCXXI, Claudio Freire a ?crit?: > Ok... I had to forfeit my right to sleep, but here it is. Managed to > make both the fast and 2loop methods work reasonably well (albeit I > don't know why anyone would use fast, because it's not faster. I > assume it's an experiment?). > > I don't have access to AAC standards, though, since they're paywalled > (at least the ones I found), so most of the changes were done blind, > assuming from what I know of audio codecs, and by trial and error. > > In particular, fast has some magic numbers there that I got from trial > and error, and nothing more... profound. > > In any case, attached it is, git diff. Thanks for the patch. I believe you should submit it to ffmpeg-devel, as it will receive more attention. Also, you should use git format-patch rather than git diff, so that author information is included in the patch, and so would be the commit message, where you can explain the changes for future reference. A small style comment; I know nothing about AAC so I can not tell about the validity of changes. > + float lowlambda = av_clip(120.f / lambda, 0.25f, 1.f); > + float rlambda = av_clip(120.f / lambda, 0.3f, 2.f); > + const int minq = av_clip(2 * log2f(120.f / lambda) + 150, 100, 218 - SCALE_MAX_DIFF); > + const int maxq = minq + SCALE_MAX_DIFF - 1; Do you have a specific reason to use float instead of double? Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From gkinsey at ad-holdings.co.uk Fri May 3 12:32:56 2013 From: gkinsey at ad-holdings.co.uk (Gavin Kinsey) Date: Fri, 3 May 2013 11:32:56 +0100 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: <518129AC.7010205@cenatav.co.cu> References: <518129AC.7010205@cenatav.co.cu> Message-ID: <201305031132.56374.gkinsey@ad-holdings.co.uk> On Wednesday 01 May 2013 15:41:48 Dayana wrote: > Hi!!! Im developing an aplication using libavcodec, libavformat and > libavutil. Im trying to make a shared library and for that I have to get > libavs compiled with -fPIC ... I was trying to do it by setting > --enable-pic in the configure file, however Im still have the same error: > > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against > symbol `ff_pd_1' can not be used when making a shared object; recompile > with -fPIC If you are trying to combine several ffmpeg libraries into a single shared library as I have seen some apps try to do then you need to use the following linker flag on the final library build step. -shared -Wl,-Bsymbolic -- Gavin Kinsey AD Holdings Plc -------------------------------------------------------- This email and any files transmitted with it are CONFIDENTIAL and intended solely for the use of the individual or entity to whom they are addressed. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system; you may not copy this message or disclose its contents to anyone. The recipient should check this email and any attachments for the presence of viruses. The Company accepts no liability for any damage caused by any virus transmitted by this email. Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the Company. Contact Customer Services for details customerservices at dmicros.com From nicolas.george at normalesup.org Fri May 3 12:36:21 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Fri, 3 May 2013 12:36:21 +0200 Subject: [Libav-user] av_buffersink_get_frame() crashes In-Reply-To: References: Message-ID: <20130503103620.GD28705@phare.normalesup.org> Le tridi 13 flor?al, an CCXXI, Radu Robotin a ?crit?: > I'm using ffmpeg with libavcodec and libavfilters for a custom project. > I've recently upgraded to the latest version available from git and noticed > that my previous code has stopped working. I'm processing several streams, > each in his own thread in the following way: > > next sample is taken from the stream, decoded and then inserted in the > buffer source of the filtergraph using av_buffersrc_add_frame() > a frame is extracted from the buffer sink of the filtergraph using > av_buffersink_get_frame() > the filtered frame is copied in a buffer for further processing > > before upgrading to the latest version of ffmpeg I've been using ffmpeg 1.2 > and everything worked flawlessly. The filtered buffer was pulled from the > filtergraph using the av_buffersink_get_buffer_ref(). The change from buffer ref to frames was accompanied with a change in the lifetime of the frames. What you describe looks like a problem with that, but without seeing the code it is impossible to tell for sure. > The problem I'm encountering: at the first pass everything works fine, > however when I call the processing function for the second time (for > processing the next frame), it coredumps when I call > av_buffersink_get_frame() with the message " corrupted double-linked list ". > I tried further investigating the problem and have several > frames processed during the same call of this function: everything works > until the second call, then it coredumps at the same point. The "corrupted double-linked list" message seems to indicate corrupted memory: either you write to an invalid location, or you write to a location that was previously freed, but you do not get the error immediately. I suggest you use valgrind to get an error at the exact time of the problem. > To me it seems that something changes the structure of the filtergraph > between the calls to the processing function. I am rather sure that the structure of the filter graph is not supposed to change after it has been configured. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From radu.robotin at gmail.com Fri May 3 16:38:02 2013 From: radu.robotin at gmail.com (Radu Robotin) Date: Fri, 3 May 2013 17:38:02 +0300 Subject: [Libav-user] av_buffersink_get_frame() crashes In-Reply-To: <20130503103620.GD28705@phare.normalesup.org> References: <20130503103620.GD28705@phare.normalesup.org> Message-ID: Here is the some parts of the code that's causing trouble: the ffmpegFetchDecodeResampleNext() is called for fetching a frame form a stream, decoding and then filtering and putting the filtered frame in an internal buffer - then the process repeats. Before any call to ffmpegFetchDecodeResampleNext, the codec and the context for decoding are initialized, as well as the filtergraph. The first call to ffmpegFetchDecodeResampleNext() works as expected,. the second one fails (with coredump) when trying to get the filtered frame from the filtergraph. What has changed in the way filterghraph is handled? I had no issues working with version 1.2. Can you please help me and tell me what I'm doing wrong? Thanks a lot! refbuf_t * ffmpegFetchDecodeResampleNext(myFFmpegContext * ff, source_t *source){ refbuf_t * retRefBuff = NULL; AVPacket pPacket; AVFrame *frame = av_frame_alloc(); AVFrame *filt_frame = av_frame_alloc(); AVFrame *enc_frame = av_frame_alloc(); if (!frame || !filt_frame || !enc_frame) { ERROR0("Could not allocate frame(s)"); return NULL; } int ret; int localbuffering = 1; while(global.running == ICE_RUNNING && source->running && localbuffering) { ff->timeout = time(NULL); ret= av_read_frame(ff->pInputFormatCtx, &pPacket); if(ret == AVERROR(EAGAIN)){ WARN1("av_read_frame error EAGAIN, error reading frame, continuing %s",ff->localMount); av_free_packet(&pPacket); continue; } if(ret == EOF){ source->running = 0; ERROR1("av_read_frame error, EOF, exiting %s",ff->localMount); av_free_packet(&pPacket); break; } if (ret < 0) { WARN1("av_read_frame error, error reading frame, breaking %s",ff->localMount); av_free_packet(&pPacket); ff->failedReads++; if(ff->failedReads >= 10) source->running = 0; return NULL; } ff->failedReads = 0; time_t current = time (NULL); source->last_read = current; int got_frame = 0; avcodec_get_frame_defaults(frame); ret = avcodec_decode_audio4(ff->pInputCodecCtx, frame, &got_frame, &pPacket); if(ret < 0 ){ WARN1("avcodec_decode_audio3 unable to decode %s",ff->localMount); ff->failedDecodes++; if(ff->failedDecodes >= 500){ source->running = 0; ERROR1("avcodec_decode_audio3 unable to decode %s error limit reached, closing stream",ff->localMount); av_free_packet(&pPacket); return NULL; } } else if(got_frame == 0){ thread_sleep (delay*1000); } else{ ff->failedDecodes = 0; int resample_changed = ff->resample_sample_fmt != ff->pInputCodecCtx->sample_fmt || ff->resample_channels != ff->pInputCodecCtx->channels || ff->resample_sample_rate != ff->pInputCodecCtx->sample_rate; if (resample_changed) { if (resample_changed) { ff->resample_sample_fmt = ff->pInputCodecCtx->sample_fmt; ff->resample_channels = ff->pInputCodecCtx->channels; ff->resample_sample_rate = ff->pInputCodecCtx->sample_rate; } /*RESAMPLING parameters */ INFO3("resampling context ch:%d spl:%d %s",ff->pInputCodecCtx->channels, ff->pInputCodecCtx->sample_rate, ff->localMount); INFO2("volume for %s :%d",ff->localMount, ff->volume); if ((ret = init_filters(ff,source)) < 0) { ERROR1( "Error while init_filters %s",ff->localMount); av_free_packet(&pPacket); source->running = 0; return NULL; } } //feed the filter graph with the new frame if (av_buffersrc_add_frame_flags(ff->buffersrc_ctx, frame,0) < 0) { ERROR1( "Error while feeding the audio filtergraph %s",ff->localMount); } /* pull filtered audio from the filtergraph */ while (1) { // This is where the crash happens - initially it was something like: // AVFilterBufferRef *samplesref; // ret = av_buffersink_get_buffer_ref(ff->buffersink_ctx, &samplesref, 0); // ret = av_buffersink_get_frame(ff->buffersink_ctx, filt_frame); // At the second call of this function, we don't get to this point, as it crashes when trying to extract the frame from the filtergraph if(ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) break; if(ret < 0) WARN1("error av_buffersink_get_frame, %s",ff->localMount); if (ret>=0) { //print_samplesref(samplesref); char * resampleBuff = (char *)filt_frame->data[0]; size_out = filt_frame->nb_samples * av_get_channel_layout_nb_channels(av_frame_get_channel_layout(filt_frame)); //process the frame and put it in a circular buffer to be returned at exit ................................................ av_frame_unref(filt_frame); av_frame_unref(frame); } } av_frame_unref(filt_frame); av_frame_unref(frame); if(ret < 0) { av_free_packet(&pPacket); break; } } av_free_packet(&pPacket); } av_frame_free(&filt_frame); av_frame_free(&frame); av_frame_free(&enc_frame); return nextPreBuffer(source); } the decoder and the filtergraph are initialized prior calling this function. Here is a snippet with the function used for filter_init. It's pretty much standard as in the example file static int init_filters(myFFmpegContext * ff, source_t *source) { AVFormatContext *fmt_ctx = ff->pInputFormatCtx; AVCodecContext *dec_ctx = ff->pInputCodecCtx; int audio_stream_index = ff->audioStreamIndex; char args[512]; int ret; char *pcTemp_string1, *pcTemp_string2; char buffer[10]; AVFilter *abuffersrc = avfilter_get_by_name("abuffer"); AVFilter *abuffersink = avfilter_get_by_name("abuffersink"); AVFilterInOut *outputs = avfilter_inout_alloc(); AVFilterInOut *inputs = avfilter_inout_alloc(); const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, AV_SAMPLE_FMT_NONE }; AVABufferSinkParams *abuffersink_params; const AVFilterLink *outlink; AVRational time_base = fmt_ctx->streams[audio_stream_index]->time_base; if(ff->filter_graph) avfilter_graph_free(&ff->filter_graph); ff->filter_graph = avfilter_graph_alloc(); /* buffer audio source: the decoded frames from the decoder will be inserted here. */ if (!dec_ctx->channel_layout) dec_ctx->channel_layout = av_get_default_channel_layout(dec_ctx->channels); snprintf(args, sizeof(args), "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%"PRIx64, time_base.num, time_base.den, dec_ctx->sample_rate, av_get_sample_fmt_name(dec_ctx->sample_fmt), dec_ctx->channel_layout); ret = avfilter_graph_create_filter(&ff->buffersrc_ctx, abuffersrc, "in", args, NULL, ff->filter_graph); if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer source\n"); return ret; } /* buffer audio sink: to terminate the filter chain. */ //abuffersink_params = av_abuffersink_params_alloc(); //abuffersink_params->sample_fmts = sample_fmts; ret = avfilter_graph_create_filter(&ff->buffersink_ctx, abuffersink, "out", NULL, NULL, ff->filter_graph); //av_free(abuffersink_params); if (ret < 0) { av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n"); return ret; } /* Endpoints for the filter graph. */ outputs->name = av_strdup("in"); outputs->filter_ctx = ff->buffersrc_ctx; outputs->pad_idx = 0; outputs->next = NULL; inputs->name = av_strdup("out"); inputs->filter_ctx = ff->buffersink_ctx; inputs->pad_idx = 0; inputs->next = NULL; char *filter_descr = default_filter_descr; snprintf(args,sizeof(args), "%s,volume=%.2f",filter_descr , volume); INFO1("Filter string: %s",filter_descr); if ((ret = avfilter_graph_parse(ff->filter_graph, args, &inputs, &outputs, NULL)) < 0) return ret; if ((ret = avfilter_graph_config(ff->filter_graph, NULL)) < 0) return ret; av_log(NULL, AV_LOG_INFO, "%s\n", args); /* Print summary of the sink buffer * Note: args buffer is reused to store channel layout string */ outlink = ff->buffersink_ctx->inputs[0]; av_get_channel_layout_string(args, sizeof(args), -1, outlink->channel_layout); av_log(NULL, AV_LOG_INFO, "Output: srate:%dHz fmt:%s chlayout:%s\n", (int)outlink->sample_rate, (char *)av_x_if_null(av_get_sample_fmt_name((AVSampleFormat)outlink->format), "?"), args); return 0; } On Fri, May 3, 2013 at 1:36 PM, Nicolas George < nicolas.george at normalesup.org> wrote: > Le tridi 13 flor?al, an CCXXI, Radu Robotin a ?crit : > > I'm using ffmpeg with libavcodec and libavfilters for a custom project. > > I've recently upgraded to the latest version available from git and > noticed > > that my previous code has stopped working. I'm processing several > streams, > > each in his own thread in the following way: > > > > next sample is taken from the stream, decoded and then inserted in > the > > buffer source of the filtergraph using av_buffersrc_add_frame() > > a frame is extracted from the buffer sink of the filtergraph using > > av_buffersink_get_frame() > > the filtered frame is copied in a buffer for further processing > > > > before upgrading to the latest version of ffmpeg I've been using ffmpeg > 1.2 > > and everything worked flawlessly. The filtered buffer was pulled from > the > > filtergraph using the av_buffersink_get_buffer_ref(). > > The change from buffer ref to frames was accompanied with a change in the > lifetime of the frames. What you describe looks like a problem with that, > but without seeing the code it is impossible to tell for sure. > > > The problem I'm encountering: at the first pass everything works fine, > > however when I call the processing function for the second time (for > > processing the next frame), it coredumps when I call > > av_buffersink_get_frame() with the message " corrupted double-linked > list ". > > I tried further investigating the problem and have several > > frames processed during the same call of this function: everything works > > until the second call, then it coredumps at the same point. > > The "corrupted double-linked list" message seems to indicate corrupted > memory: either you write to an invalid location, or you write to a location > that was previously freed, but you do not get the error immediately. I > suggest you use valgrind to get an error at the exact time of the problem. > > > To me it seems that something changes the structure of the filtergraph > > between the calls to the processing function. > > I am rather sure that the structure of the filter graph is not supposed to > change after it has been configured. > > Regards, > > -- > Nicolas George > > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.12 (GNU/Linux) > > iEYEARECAAYFAlGDkyQACgkQsGPZlzblTJO/swCgkvXLQfnrP65ERswa1evJZSlp > jBgAoKLHeBMgtGqB9oAsjmpKL0eDVv5G > =0vJ2 > -----END PGP SIGNATURE----- > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Fri May 3 16:53:27 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Fri, 03 May 2013 11:53:27 -0300 Subject: [Libav-user] avcodec_decode_audio4() help In-Reply-To: <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> References: <5183003F.4080506@gmail.com> <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> Message-ID: <5183CF67.9000007@gmail.com> On 03/05/13 01:30, Kalileo wrote: > On May 3, 2013, at 07:09 , Gonzalo Garramuno wrote: > > It might help if you add more info, such as what kind of audio you're > working with (which shows the problem), and if there's any kind of > audio which does not show this effect. If you decode aac, then you > might get hit by the change to planar format, which happened November > 16, 2012 in the ffmpeg sources (although the effect is usually not a > 'frying pan noise'). _______________________________________________ > Libav-user mailing list Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user Yes, the audio is aac and ac3. All the other audio formats play fine. From klaussfreire at gmail.com Fri May 3 17:11:35 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Fri, 3 May 2013 12:11:35 -0300 Subject: [Libav-user] Audio quality loss while encoding In-Reply-To: <20130503103219.GC28705@phare.normalesup.org> References: <1F66D2B0-9114-4AD7-933E-414A5001AAF7@bighillsoftware.com> <20130503103219.GC28705@phare.normalesup.org> Message-ID: On Fri, May 3, 2013 at 7:32 AM, Nicolas George < nicolas.george at normalesup.org> wrote: > > + float lowlambda = av_clip(120.f / lambda, 0.25f, 1.f); > > + float rlambda = av_clip(120.f / lambda, 0.3f, 2.f); > > + const int minq = av_clip(2 * log2f(120.f / lambda) + 150, 100, 218 > - SCALE_MAX_DIFF); > > + const int maxq = minq + SCALE_MAX_DIFF - 1; > > Do you have a specific reason to use float instead of double? > lambda is a quality scaler, it's clipped to the range 0..65535, so double would be overkill IMO. Lambda's also a float everywhere else. Mixing float and double arithmetic creates unnecessary conversion steps, slowing things down. Here in particular, I don't think it's critical, but it's good practice to never mix them up - except, perhaps, on trig functions, where the float versions are rather imprecise. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Fri May 3 17:46:09 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Fri, 03 May 2013 12:46:09 -0300 Subject: [Libav-user] avcodec_decode_audio4() help In-Reply-To: <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> References: <5183003F.4080506@gmail.com> <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> Message-ID: <5183DBC1.8020207@gmail.com> On 03/05/13 01:30, Kalileo wrote: > > If you decode aac, then you might get hit by the change to planar format, which happened November 16, 2012 in the ffmpeg sources (although the effect is usually not a 'frying pan noise'). > _ The problem also shows with wmav2. From cmst at live.com Fri May 3 13:58:04 2013 From: cmst at live.com (Dolevo Jay) Date: Fri, 3 May 2013 11:58:04 +0000 Subject: [Libav-user] hardware acceleration for AMD Radeon graphics card Message-ID: Hi all, I have a pc on which openembedded is running. The task of this pc is to decode incoming live streams and show on the screen attached to it. This is sometimes 1 stream connected, sometimes 5, sometimes 10. I wrote the decoder related code by myself. The issue is, there is no hardware acceleration at the moment and desperately I am looking for how to implement it. The pc has AMD Radeon graphics card and I have already installed xvba-va-driver. I can run vainfo and get the following lines as return: root at dumdum-3048:~# vainfo libva: VA-API version 0.32.0 Xlib: extension "XFree86-DRI" missing on display ":0.0". libva: va_getDriverName() returns 0 libva: Trying to open /usr/lib/dri/fglrx_drv_video.so libva: va_openDriver() returns 0 vainfo: VA-API version: 0.32 (libva 1.0.15) vainfo: Driver version: Splitted-Desktop Systems XvBA backend for VA-API - 0.8.0 vainfo: Supported profile and entrypoints VAProfileH264High : VAEntrypointVLD VAProfileVC1Advanced : VAEntrypointVLD Since I get the Entypoints, I suppose that the driver side has already ready for the hardware acceleration. However, I know that this is not enough and I need to implement some code into my decoder software in order to tell the decoder to use the hardware acceleration. So, I end up with looking into VLC source code to find out how they have done this implementation. However, I couldn't get enough information. Then I end up here to ask you experts, hoping to get some help. Any help, any hint, any guidance would greatly be appreciated. Thank you very much, Regards, -------------- next part -------------- An HTML attachment was scrubbed... URL: From phuze9 at gmail.com Sat May 4 09:03:08 2013 From: phuze9 at gmail.com (mohM) Date: Sat, 4 May 2013 00:03:08 -0700 (PDT) Subject: [Libav-user] avcodec_encode_video2 problem Message-ID: <1367650988541-4657497.post@n4.nabble.com> I'm starting from a working encode very similar to examples/decoding_encoding.c but I'm now wanting to add sound, so I'm trying to get examples/muxing.c to work for my purposes but no luck as of yet. For some reason avcodec_encode_video2 is returning 0 (success according to documentation), yet giving me a blank got_packet pointer which means the packet data is blank. My AVFrame pointer has data in it (assuming it's correct because I'm using the same method to retrieve it as I was in my previously-working example). Could anyone point me in the right direction as to how to debug this? I'm using: zeranoe's ffmpeg-20130428-git-0fb64da -- View this message in context: http://libav-users.943685.n4.nabble.com/avcodec-encode-video2-problem-tp4657497.html Sent from the libav-users mailing list archive at Nabble.com. From nicolas.george at normalesup.org Sat May 4 09:53:08 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Sat, 4 May 2013 09:53:08 +0200 Subject: [Libav-user] avcodec_encode_video2 problem In-Reply-To: <1367650988541-4657497.post@n4.nabble.com> References: <1367650988541-4657497.post@n4.nabble.com> Message-ID: <20130504075308.GA19539@phare.normalesup.org> Le quintidi 15 flor?al, an CCXXI, mohM a ?crit?: > I'm starting from a working encode very similar to > examples/decoding_encoding.c but I'm now wanting to add sound, so I'm trying > to get examples/muxing.c to work for my purposes but no luck as of yet. For > some reason avcodec_encode_video2 is returning 0 (success according to > documentation), yet giving me a blank got_packet pointer which means the > packet data is blank. Depending on your setup, this may be perfectly normal: a lot of codecs want to wait for more frames before making encoding decisions. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From andrey.krieger.utkin at gmail.com Sun May 5 00:27:28 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Sun, 5 May 2013 01:27:28 +0300 Subject: [Libav-user] Seeking for libavfilter functionality: overlay of grid over image, invert colors Message-ID: As letter subject says, i seek for such pieces of functionality. Looking at filters list in docs i see there are no such filters. But i am also interested, is there any libraries rich for such and similar functionality, which are pluggable to libavfilter? Secondly, will libavfilter major developers agree with inclusion of such filters into upstream? -- Andrey Utkin From ggarra13 at gmail.com Sun May 5 00:39:47 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sat, 04 May 2013 19:39:47 -0300 Subject: [Libav-user] Regression problems with avcodec_decode_audio3 Message-ID: <51858E33.2070104@gmail.com> The call avcodec_decode_audio3 is deprecated. However it remains functional. After the change in code in ffmpeg, avcodec_decode_audio3 fails returning valid audio and returns a 'frying pan' noise. avcodec_decode_audio3 should be updated so that it works once again transparently. This would also allow users of the library such as myself the ability to port the code easily to avcodec_decode_audio4. From bjoern.drabeck at gmail.com Sun May 5 02:41:19 2013 From: bjoern.drabeck at gmail.com (Bjoern Drabeck) Date: Sun, 5 May 2013 08:41:19 +0800 Subject: [Libav-user] Seeking for libavfilter functionality: overlay of grid over image, invert colors In-Reply-To: References: Message-ID: > As letter subject says, i seek for such pieces of functionality. > Looking at filters list in docs i see there are no such filters. But i > am also interested, is there any libraries rich for such and similar > functionality, which are pluggable to libavfilter? Secondly, will > libavfilter major developers agree with inclusion of such filters into > upstream? > > -- > Andrey Utkin > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user For inverting of colors, check the 'negate' filter, that might be doing what you want... -Bjoern From andrey.krieger.utkin at gmail.com Sun May 5 09:37:56 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Sun, 5 May 2013 10:37:56 +0300 Subject: [Libav-user] Seeking for libavfilter functionality: overlay of grid over image, invert colors In-Reply-To: References: Message-ID: Thank you, i really missed that. From samhalligan15 at gmail.com Sun May 5 13:59:38 2013 From: samhalligan15 at gmail.com (yy-zed) Date: Sun, 5 May 2013 04:59:38 -0700 (PDT) Subject: [Libav-user] Encoding FLV gives green screen output Message-ID: <1367755178284-4657503.post@n4.nabble.com> I've written a piece of C++ code that can capture webcam video frame, decode them, convert them to YUV420P, encode them and then write them to a file. If I use the mpeg2 codec and write to a .mpg file, everything works perfectly. But, if I use flv, then the output produced is just a green screen. I'm not sure if there are different encoder settings I need to set for encoding flv video?Or maybe I'm doing something wrong in sws_scale? Here's my code(the relevant parts): Encoder settings: c->codec_id = codec_id; c->bit_rate = 400000; // Resolution must be a multiple of two. c->width = 352; c->height = 288; c->time_base.den = STREAM_FRAME_RATE; c->time_base.num = 1; //emit one intra frame every twelve frames at most c->gop_size = 12; c->pix_fmt = STREAM_PIX_FMT; Encoding a frame: int ret; uint8_t *buffer = NULL; static struct SwsContext *sws_ctx; //Setup the codec context, and set its width and height to be equal to the input video width and height AVCodecContext *c = st->codec; c->width = pCodecCtx->width; c->height = pCodecCtx->height; av_init_packet(&packet); frameYUV = avcodec_alloc_frame(); //Determine how big the buffer will need to be to store the captured frame numBytes = avpicture_get_size(STREAM_PIX_FMT,pCodecCtx->width,pCodecCtx->height); //Allocate the needed buffer size buffer = new uint8_t[numBytes]; sws_ctx = sws_getContext(pCodecCtx->width,pCodecCtx->height,pCodecCtx->pix_fmt, pCodecCtx->width,pCodecCtx->height, STREAM_PIX_FMT,SWS_BICUBIC,NULL,NULL,NULL); //Fill the output frame avpicture_fill((AVPicture *)frameYUV,buffer,STREAM_PIX_FMT,pCodecCtx->width,pCodecCtx->height); //Read a video frame in av_read_frame(pFormatCtx,&packet); //Decode the contents of packet into pFrame avcodec_decode_video2(pCodecCtx,pFrame,&frameFinished,&packet); //Scale pFrame into frameYUV, and convert to PIXFMTYUV420P sws_scale ( sws_ctx, (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, frameYUV->data, frameYUV->linesize ); av_init_packet(&samsPacket); //Encode frameYUV avcodec_encode_video2(c, &samsPacket, frameYUV, &gotSamsPacket); AVPacket pkt = { 0 }; int got_packet; av_init_packet(&pkt); // encode the image ret = avcodec_encode_video2(c, &pkt, frame, &got_packet); if (ret < 0){ debugLogStreamSave->debug("Error encoding video frame"); exit(1); } if (!ret && got_packet && pkt.size){ pkt.stream_index = st->index; // Write the compressed frame to our output ret = av_interleaved_write_frame(oc, &pkt); Really scratching my head over this one, any help would be really appreciated! -- View this message in context: http://libav-users.943685.n4.nabble.com/Encoding-FLV-gives-green-screen-output-tp4657503.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Sun May 5 17:15:16 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 5 May 2013 15:15:16 +0000 (UTC) Subject: [Libav-user] Seeking for libavfilter functionality: overlay of grid over image, invert colors References: Message-ID: Andrey Utkin gmail.com> writes: > But i am also interested, is there any libraries rich > for such and similar functionality, which are > pluggable to libavfilter? Some external libraries are supported, please see the fine documentation. (Adding more is probably welcome, see below.) > Secondly, will libavfilter major developers agree > with inclusion of such filters into upstream? A clean patch that implements grids is certainly welcome on ffmpeg-devel. Carl Eugen From ggarra13 at gmail.com Mon May 6 02:40:14 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Sun, 05 May 2013 21:40:14 -0300 Subject: [Libav-user] avcodec_decode_audio4() help In-Reply-To: <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> References: <5183003F.4080506@gmail.com> <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> Message-ID: <5186FBEE.8020703@gmail.com> On 03/05/13 01:30, Kalileo wrote: > If you decode aac, then you might get hit by the change to planar format, which happened November 16, 2012 in the ffmpeg sources (although the effect is usually not a 'frying pan noise'). > _______________________________________________ > The change happened between ffmpeg-1.0.6 (which works fine) and ffmpeg-1.1.4 (which does not). Alternatively, can anyone show me the smallest piece of code that they use for avcodec_decode_audio4. From brado at bighillsoftware.com Mon May 6 05:36:42 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Sun, 5 May 2013 20:36:42 -0700 Subject: [Libav-user] Encoding FLV gives green screen output In-Reply-To: <1367755178284-4657503.post@n4.nabble.com> References: <1367755178284-4657503.post@n4.nabble.com> Message-ID: <97EE45B3-1AC0-40D8-A9A6-6EA35D6115E7@bighillsoftware.com> Sam, Early on in my video encoding work I had encountered something similar. I don't know if this can help you or not -- while I'm capturing from QTKit, I am converting pixel formats and encoding to FLV. There's enough similarity there that I thought it might be worth taking a look-see at my code example. If it helps, great, if not, sorry about that, and I wish you the best of luck in figuring it out. Here's the code: https://github.com/BigHillSoftware/QTFFmpeg Hopefully there's something in the source that will help. Cheers, Brad On May 5, 2013, at 4:59 AM, yy-zed wrote: > I've written a piece of C++ code that can capture webcam video frame, decode > them, convert them to YUV420P, encode them and then write them to a file. If > I use the mpeg2 codec and write to a .mpg file, everything works perfectly. > But, if I use flv, then the output produced is just a green screen. I'm not > sure if there are different encoder settings I need to set for encoding flv > video?Or maybe I'm doing something wrong in sws_scale? Here's my code(the > relevant parts): > > Encoder settings: > > c->codec_id = codec_id; > c->bit_rate = 400000; > // Resolution must be a multiple of two. > c->width = 352; > c->height = 288; > c->time_base.den = STREAM_FRAME_RATE; > c->time_base.num = 1; > //emit one intra frame every twelve frames at most > c->gop_size = 12; > c->pix_fmt = STREAM_PIX_FMT; > > Encoding a frame: > > int ret; > uint8_t *buffer = NULL; > static struct SwsContext *sws_ctx; > > //Setup the codec context, and set its width and height to be equal to the > input video width and height > AVCodecContext *c = st->codec; > c->width = pCodecCtx->width; > c->height = pCodecCtx->height; > > av_init_packet(&packet); > frameYUV = avcodec_alloc_frame(); > > //Determine how big the buffer will need to be to store the captured frame > numBytes = > avpicture_get_size(STREAM_PIX_FMT,pCodecCtx->width,pCodecCtx->height); > > //Allocate the needed buffer size > buffer = new uint8_t[numBytes]; > sws_ctx = > sws_getContext(pCodecCtx->width,pCodecCtx->height,pCodecCtx->pix_fmt, > pCodecCtx->width,pCodecCtx->height, > STREAM_PIX_FMT,SWS_BICUBIC,NULL,NULL,NULL); > > //Fill the output frame > avpicture_fill((AVPicture > *)frameYUV,buffer,STREAM_PIX_FMT,pCodecCtx->width,pCodecCtx->height); > > //Read a video frame in > av_read_frame(pFormatCtx,&packet); > > //Decode the contents of packet into pFrame > avcodec_decode_video2(pCodecCtx,pFrame,&frameFinished,&packet); > > //Scale pFrame into frameYUV, and convert to PIXFMTYUV420P > sws_scale > ( > sws_ctx, > (uint8_t const * const *)pFrame->data, > pFrame->linesize, > 0, > pCodecCtx->height, > frameYUV->data, > frameYUV->linesize > ); > av_init_packet(&samsPacket); > //Encode frameYUV > avcodec_encode_video2(c, &samsPacket, frameYUV, &gotSamsPacket); > > AVPacket pkt = { 0 }; > int got_packet; > av_init_packet(&pkt); > // encode the image > ret = avcodec_encode_video2(c, &pkt, frame, &got_packet); > if (ret < 0){ > debugLogStreamSave->debug("Error encoding video frame"); > exit(1); > } > if (!ret && got_packet && pkt.size){ > pkt.stream_index = st->index; > > // Write the compressed frame to our output > ret = av_interleaved_write_frame(oc, &pkt); > > Really scratching my head over this one, any help would be really > appreciated! > > > > -- > View this message in context: http://libav-users.943685.n4.nabble.com/Encoding-FLV-gives-green-screen-output-tp4657503.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From lulebo at gmail.com Mon May 6 14:23:06 2013 From: lulebo at gmail.com (Carl Lindqvist) Date: Mon, 6 May 2013 14:23:06 +0200 Subject: [Libav-user] MPEG-2 NTSC video shows horizontal lines on the red color In-Reply-To: <1367157019.49851.YahooMailNeo@web15102.mail.cnb.yahoo.com> References: <1367157019.49851.YahooMailNeo@web15102.mail.cnb.yahoo.com> Message-ID: I suspect your issue is with resampling the 4:2:0 mpeg video to 4:2:2 feeding the decklink card. As 4:2:0 in interlaced is often poorly done or misunderstood, this is often an issue. And since we are pretty bad at noticing errors in color, it will only be obvious in very saturated colors. How do you handle the conversion now? Make sure you really specify that you are handling an interlaced source, since 4:2:0 is very different in interlaced vs progressive. 2013/4/28 nuo yang : > Hi everyone, > > Recently I use ffmpeg sdk to develop my own player, my video source is > MPEG-2 NTSC video, and I use ffmpeg sdk to decode the video, then use > BlackMagic DeckLink sdk to receive the video frame and display the video to > my CRT monitor through a DeckLink PCI card. Everything is okay but a little > defect, when the video contains some red color objects (like red clothes), > and if the red color objects moving fast, there are some horizontal lines on > red color. My video is interlaced, and I tried some methods, including > change the video field order, but I didn't make it. BTW, if I use ffdshow to > decode the video, it does not have the issue. > > Is there someone has the same issue like me, or can someone give me some > advice? Many thanks in advance! > > > - Nuo > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From praks411 at gmail.com Mon May 6 14:37:16 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Mon, 6 May 2013 05:37:16 -0700 (PDT) Subject: [Libav-user] Understanding planar data arrangement in AVFrame Message-ID: <1367843836071-4657508.post@n4.nabble.com> Hi, I'm trying to encode raw audio samples. Though encoding is working fine. I'm not able to understand some of the field of AVFrame specially related to planar data. Can someone explain what is the different between data and extended_data in AVFrame and how they are use during encoding. I got the linesize which says that it contains the size of each channel. But how the raw samples are stored in this structure. AVFrame { uint8_t *data[AV_NUM_DATA_POINTERS]; int linesize[AV_NUM_DATA_POINTERS]; uint8_t **extended_data; } Also do I need explicitly free memory buffers allocated during encoding? I'm getting memory leaks while encoding even though I'm doing proper clean-up. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Understanding-planar-data-arrangement-in-AVFrame-tp4657508.html Sent from the libav-users mailing list archive at Nabble.com. From nicolas.george at normalesup.org Mon May 6 15:10:55 2013 From: nicolas.george at normalesup.org (Nicolas George) Date: Mon, 6 May 2013 15:10:55 +0200 Subject: [Libav-user] Understanding planar data arrangement in AVFrame In-Reply-To: <1367843836071-4657508.post@n4.nabble.com> References: <1367843836071-4657508.post@n4.nabble.com> Message-ID: <20130506131055.GA16299@phare.normalesup.org> Le septidi 17 flor?al, an CCXXI, Pradeep Karosiya a ?crit?: > I'm trying to encode raw audio samples. Though encoding is working fine. I'm > not able to understand some of the field of AVFrame specially related to > planar data. > Can someone explain what is the different between data and extended_data in > AVFrame and how they are use during encoding. data serves when there are at most 8 channels, extended_data serves when there are more using a mallocated array of pointers. If in doubt, use extended_data, since it will always be a valid pointer, either to a mallocated or just to data. > I got the linesize which says that it contains the size of each channel. > But how the raw samples are stored in this structure. One after the other. Just cast the pointer to an arithmetic type of the correct size: "samples = (int16_t *)extended_data[channel]" for S16, etc. > Also do I need explicitly free memory buffers allocated during encoding? Depends how they were allocated. Using refcounted buffers is the preferred method nowadays. Regards, -- Nicolas George -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 198 bytes Desc: Digital signature URL: From dribas at cenatav.co.cu Mon May 6 15:18:58 2013 From: dribas at cenatav.co.cu (Dayana) Date: Mon, 06 May 2013 09:18:58 -0400 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: <201305031132.56374.gkinsey@ad-holdings.co.uk> References: <518129AC.7010205@cenatav.co.cu> <201305031132.56374.gkinsey@ad-holdings.co.uk> Message-ID: <5187ADC2.6000404@cenatav.co.cu> Hi Gavin!! I set -shared -Wl,-Bsymbolic in the linker flags of my library, that depends of libavcodec, libavutil, libavformat... However when Im going to call av_register_all(); I get the same error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC /////// I think that I have to set the flag -fPIC for compiling the libavcodec, libavutil, libavformat, so I added: enable pic , in the configure file of the ffmpeg project: # OS specific case $target_os in linux) add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 enable pic enable dv1394 Therefore when ffmpeg is compiled, libavcodec, libavutil, libavformat were compiled with -fPIC.... then when should be ok If I want to use them in my libx.so ... but It is not, I have the same error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC I dont know wish is the problem with ffmpeg and -fPIC... On 05/03/2013 06:32 AM, Gavin Kinsey wrote: > On Wednesday 01 May 2013 15:41:48 Dayana wrote: >> Hi!!! Im developing an aplication using libavcodec, libavformat and >> libavutil. Im trying to make a shared library and for that I have to get >> libavs compiled with -fPIC ... I was trying to do it by setting >> --enable-pic in the configure file, however Im still have the same error: >> >> /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against >> symbol `ff_pd_1' can not be used when making a shared object; recompile >> with -fPIC > If you are trying to combine several ffmpeg libraries into a single shared > library as I have seen some apps try to do then you need to use the > following linker flag on the final library build step. > > -shared -Wl,-Bsymbolic > From lulebo at gmail.com Mon May 6 16:12:28 2013 From: lulebo at gmail.com (Carl Lindqvist) Date: Mon, 6 May 2013 16:12:28 +0200 Subject: [Libav-user] MPEG-2 NTSC video shows horizontal lines on the red color In-Reply-To: References: <1367157019.49851.YahooMailNeo@web15102.mail.cnb.yahoo.com> Message-ID: Here is an article describing what is probably happening in your app, and will hopefully give you some idea what you need to correct: http://web.archive.org/web/20060719025947/http://www.hometheaterhifi.com/volume_8_2/dvd-benchmark-special-report-chroma-bug-4-2001.html 2013/5/6 Carl Lindqvist : > I suspect your issue is with resampling the 4:2:0 mpeg video to 4:2:2 > feeding the decklink card. > > As 4:2:0 in interlaced is often poorly done or misunderstood, this is > often an issue. And since we are pretty bad at noticing errors in > color, it will only be obvious in very saturated colors. > > How do you handle the conversion now? Make sure you really specify > that you are handling an interlaced source, since 4:2:0 is very > different in interlaced vs progressive. > > 2013/4/28 nuo yang : >> Hi everyone, >> >> Recently I use ffmpeg sdk to develop my own player, my video source is >> MPEG-2 NTSC video, and I use ffmpeg sdk to decode the video, then use >> BlackMagic DeckLink sdk to receive the video frame and display the video to >> my CRT monitor through a DeckLink PCI card. Everything is okay but a little >> defect, when the video contains some red color objects (like red clothes), >> and if the red color objects moving fast, there are some horizontal lines on >> red color. My video is interlaced, and I tried some methods, including >> change the video field order, but I didn't make it. BTW, if I use ffdshow to >> decode the video, it does not have the issue. >> >> Is there someone has the same issue like me, or can someone give me some >> advice? Many thanks in advance! >> >> >> - Nuo >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> From ggarra13 at gmail.com Mon May 6 16:51:57 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Mon, 06 May 2013 11:51:57 -0300 Subject: [Libav-user] avcodec_decode_audio4() help In-Reply-To: <5186FBEE.8020703@gmail.com> References: <5183003F.4080506@gmail.com> <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> <5186FBEE.8020703@gmail.com> Message-ID: <5187C38D.1000400@gmail.com> On 05/05/13 21:40, Gonzalo Garramuno wrote: > On 03/05/13 01:30, Kalileo wrote: >> If you decode aac, then you might get hit by the change to planar >> format, which happened November 16, 2012 in the ffmpeg sources >> (although the effect is usually not a 'frying pan noise'). >> _______________________________________________ >> > The change happened between ffmpeg-1.0.6 (which works fine) and > ffmpeg-1.1.4 (which does not). > > Alternatively, can anyone show me the smallest piece of code that they > use for avcodec_decode_audio4. Here is my code: int CMedia::decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) { AVFrame frame = { { 0 } }; int ret, got_frame = 0; if (avctx->get_buffer != avcodec_default_get_buffer) { avctx->get_buffer = avcodec_default_get_buffer; avctx->release_buffer = avcodec_default_release_buffer; } ret = avcodec_decode_audio4(avctx, &frame, &got_frame, avpkt); if (ret >= 0 && got_frame) { int ch, plane_size; int planar = av_sample_fmt_is_planar(avctx->sample_fmt); int data_size = av_samples_get_buffer_size(&plane_size, avctx->channels, frame.nb_samples, avctx->sample_fmt, 1); if (*frame_size_ptr < data_size) { IMG_ERROR( "decode_audio3 - Output buffer size is too small for " "the current frame (" << *frame_size_ptr << " < " << data_size << ")" ); return AVERROR(EINVAL); } memcpy(samples, frame.extended_data[0], plane_size); if (planar && avctx->channels > 1) { uint8_t *out = ((uint8_t *)samples) + plane_size; for (ch = 1; ch < avctx->channels; ch++) { memcpy(out, frame.extended_data[ch], plane_size); out += plane_size; } } *frame_size_ptr = data_size; } else { *frame_size_ptr = 0; } return ret; } /** * Given an audio packet, decode it * * @param ptsframe returned frame we decoded * @param frame frame we expect * @param pkt packet to decode * * @return status whether frame was decoded correctly or not. */ CMedia::DecodeStatus CMedia::decode_audio_packet( boost::int64_t& ptsframe, const boost::int64_t frame, const AVPacket& pkt ) AVStream* stream = get_audio_stream(); if ( !stream ) return kDecodeNoStream; // Get the audio codec context AVCodecContext* ctx = stream->codec; assert( !_audio_packets.is_seek( pkt ) ); assert( !_audio_packets.is_flush( pkt ) ); assert( !_audio_packets.is_preroll( pkt ) ); assert( !_audio_packets.is_loop_end( pkt ) ); assert( !_audio_packets.is_loop_start( pkt ) ); ptsframe = get_frame( stream, pkt ); // Make sure audio frames are continous during playback to // accomodate weird sample rates not evenly divisable by frame rate if ( _audio_buf_used != 0 && (!_audio.empty()) ) { ptsframe = _audio_last_frame + 1; // assert( ptsframe <= last_frame() ); } #ifdef DEBUG if ( _audio_buf_used + pkt.size >= _audio_max ) { IMG_ERROR( _("Too much audio used:") << _audio_buf_used ); } #endif AVPacket pkt_temp; av_init_packet(&pkt_temp); pkt_temp.data = pkt.data; pkt_temp.size = pkt.size; assert( pkt.data != NULL ); assert( _audio_buf != NULL ); assert( pkt.size + _audio_buf_used < _audio_max ); int audio_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; //< correct assert( pkt_temp.size <= audio_size ); while ( pkt_temp.size > 0 ) { // Decode the audio into the buffer assert( _audio_buf_used + pkt_temp.size <= _audio_max ); assert( pkt_temp.data != NULL ); assert( _audio_buf_used % 16 == 0 ); assert( audio_size > 0 ); int ret = decode_audio3( ctx, ( int16_t * )( (char*)_audio_buf + _audio_buf_used ), &audio_size, &pkt_temp ); // If no samples are returned, then break now if ( ret <= 0 ) { pkt_temp.size = 0; IMG_ERROR( _("Audio missed for frame: ") << ptsframe << _(" ret: ") << ret << _(" audio max: ") << _audio_max << _(" audio used: ") << _audio_buf_used ); return kDecodeMissingSamples; } assert( audio_size > 0 ); assert( ret <= pkt_temp.size ); assert( ret > 0 ); assert( audio_size + _audio_buf_used <= _audio_max ); // Decrement the length by the number of bytes parsed pkt_temp.data += ret; pkt_temp.size -= ret; if ( audio_size <= 0 ) continue; _audio_buf_used += audio_size; } if ( pkt_temp.size == 0 ) return kDecodeOK; IMG_ERROR( _("decode_audio - missed decoding some samples") ); return kDecodeMissingSamples; } From ratin3 at gmail.com Mon May 6 16:56:51 2013 From: ratin3 at gmail.com (Ratin) Date: Mon, 6 May 2013 07:56:51 -0700 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: <5187ADC2.6000404@cenatav.co.cu> References: <518129AC.7010205@cenatav.co.cu> <201305031132.56374.gkinsey@ad-holdings.co.uk> <5187ADC2.6000404@cenatav.co.cu> Message-ID: On Mon, May 6, 2013 at 6:18 AM, Dayana wrote: > Hi Gavin!! > > I set > > -shared -Wl,-Bsymbolic > > in the linker flags of my library, that depends of libavcodec, libavutil, > libavformat... > > However when Im going to call av_register_all(); I get the same error: > > /usr/local/lib/libavcodec.a(**lpc_mmx.o): relocation R_X86_64_PC32 against > symbol `ff_pd_1' can not be used when making a shared object; recompile > with -fPIC > > /////// > > I think that I have to set the flag -fPIC for compiling the libavcodec, > libavutil, libavformat, so I added: enable pic , in the configure file of > the ffmpeg project: > > # OS specific > case $target_os in > linux) > add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 > enable pic > enable dv1394 > > > Therefore when ffmpeg is compiled, libavcodec, libavutil, libavformat were > compiled with -fPIC.... then when should be ok If I want to use them in my > libx.so ... but It is not, I have the same error: > > > /usr/local/lib/libavcodec.a(**lpc_mmx.o): relocation R_X86_64_PC32 against > symbol `ff_pd_1' can not be used when making a shared object; recompile > with -fPIC > > > I dont know wish is the problem with ffmpeg and -fPIC... > > > > > I am a little confused, do you get this error when you are trying to use libavcodec.a into another of your projects or during compilation of libavcodec itself? In the latter case why are you building a static library (i.e. libavcodec.a instead of a libavcodec.so ) ? You need to build libavcodec as a shared object library by specifying --enable-shared --disable-static or something to that effect > > > > > > On 05/03/2013 06:32 AM, Gavin Kinsey wrote: > >> On Wednesday 01 May 2013 15:41:48 Dayana wrote: >> >>> Hi!!! Im developing an aplication using libavcodec, libavformat and >>> libavutil. Im trying to make a shared library and for that I have to get >>> libavs compiled with -fPIC ... I was trying to do it by setting >>> --enable-pic in the configure file, however Im still have the same error: >>> >>> /usr/local/lib/libavcodec.a(**lpc_mmx.o): relocation R_X86_64_PC32 >>> against >>> symbol `ff_pd_1' can not be used when making a shared object; recompile >>> with -fPIC >>> >> If you are trying to combine several ffmpeg libraries into a single shared >> library as I have seen some apps try to do then you need to use the >> following linker flag on the final library build step. >> >> -shared -Wl,-Bsymbolic >> >> > ______________________________**_________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/**listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From dribas at cenatav.co.cu Mon May 6 17:04:29 2013 From: dribas at cenatav.co.cu (Dayana) Date: Mon, 06 May 2013 11:04:29 -0400 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: References: <518129AC.7010205@cenatav.co.cu> <201305031132.56374.gkinsey@ad-holdings.co.uk> <5187ADC2.6000404@cenatav.co.cu> Message-ID: <5187C67D.3010202@cenatav.co.cu> I am a little confused, do you get this error when you are trying to use libavcodec.a into another of your projects or during compilation of libavcodec itself? In the latter case why are you building a static library (i.e. libavcodec.a instead of a libavcodec.so ) ? You need to build libavcodec as a shared object library by specifying --enable-shared --disable-static or something to that effect I get the error: /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against symbol `ff_pd_1' can not be used when making a shared object; recompile with -fPIC when Im trying to use the function av_register_all(), belonging to libavcodec, in a library that I am programing (libmylibrary.so) For compiling libavcodec, I am doing ./configure, make, make install in the directory of ffmpeg-0.11.1, wish contains libavcodec, libavutil, etc... the result of this is libavcodec.a, libavutil.a, etc... :) On 05/06/2013 10:56 AM, Ratin wrote: > > > > On Mon, May 6, 2013 at 6:18 AM, Dayana > wrote: > > Hi Gavin!! > > I set > > -shared -Wl,-Bsymbolic > > in the linker flags of my library, that depends of libavcodec, > libavutil, libavformat... > > However when Im going to call av_register_all(); I get the same > error: > > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 > against > symbol `ff_pd_1' can not be used when making a shared object; > recompile > with -fPIC > > /////// > > I think that I have to set the flag -fPIC for compiling the > libavcodec, libavutil, libavformat, so I added: enable pic , in > the configure file of the ffmpeg project: > > # OS specific > case $target_os in > linux) > add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 > enable pic > enable dv1394 > > > Therefore when ffmpeg is compiled, libavcodec, libavutil, > libavformat were compiled with -fPIC.... then when should be ok If > I want to use them in my libx.so ... but It is not, I have the > same error: > > > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 > against > symbol `ff_pd_1' can not be used when making a shared object; > recompile > with -fPIC > > > I dont know wish is the problem with ffmpeg and -fPIC... > > > > > > > I am a little confused, do you get this error when you are trying to > use libavcodec.a into another of your projects or during compilation > of libavcodec itself? In the latter case why are you building a static > library (i.e. libavcodec.a instead of a libavcodec.so ) ? You need to > build libavcodec as a shared object library by specifying > --enable-shared --disable-static or something to that effect > > > > > > > On 05/03/2013 06:32 AM, Gavin Kinsey wrote: > > On Wednesday 01 May 2013 15:41:48 Dayana wrote: > > Hi!!! Im developing an aplication using libavcodec, > libavformat and > libavutil. Im trying to make a shared library and for that > I have to get > libavs compiled with -fPIC ... I was trying to do it by > setting > --enable-pic in the configure file, however Im still have > the same error: > > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation > R_X86_64_PC32 against > symbol `ff_pd_1' can not be used when making a shared > object; recompile > with -fPIC > > If you are trying to combine several ffmpeg libraries into a > single shared > library as I have seen some apps try to do then you need to > use the > following linker flag on the final library build step. > > -shared -Wl,-Bsymbolic > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyrilapan at yahoo.fr Mon May 6 18:30:32 2013 From: cyrilapan at yahoo.fr (cyril apan) Date: Mon, 6 May 2013 17:30:32 +0100 (BST) Subject: [Libav-user] errors while processing tiff streams with image2pipe Message-ID: <1367857832.95867.YahooMailNeo@web28804.mail.ir2.yahoo.com> Hello there, I have an application that takes as input a bunch of streams, mostly coming from video files, but it also have to process some image files. I found out that png format is well supported, but it doesn't seem the case for tiff format. With tiff format, it uses "image2pipe" as AVInputFormat before decoding streams, but then it can encounter the following errors: - pixel format is wrong, e.g. http://www.filmform.com/logo/Filmform_gray-on-blank.tif > stream->codec->pix_fmt == AV_PIX_FMT_RGB24 instead of being AV_PIX_FMT_RGBA. - invalid data found when processing input, e.g. http://www.finehomesandliving.com/Media/%C2%A9%20FINE%20media%20group%20LLC%20Black%20Logo.tif > get the error while calling avcodec_decode_video2 () and stream->codec->pix_fmt / stream->codec->width / stream->codec->height all have wrong values by the way (respectively -1, 0, 0). I know that image format support isn't the primary focus of FFmpeg but maybe this issue should be reported nevertheless? Regards, Cyril APAN. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Mon May 6 18:33:29 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Mon, 06 May 2013 13:33:29 -0300 Subject: [Libav-user] avcodec_decode_audio4() help In-Reply-To: <5187C38D.1000400@gmail.com> References: <5183003F.4080506@gmail.com> <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> <5186FBEE.8020703@gmail.com> <5187C38D.1000400@gmail.com> Message-ID: <5187DB59.8040104@gmail.com> On 06/05/13 11:51, Gonzalo Garramuno wrote: > On 05/05/13 21:40, Gonzalo Garramuno wrote: >> On 03/05/13 01:30, Kalileo wrote: >>> If you decode aac, then you might get hit by the change to planar >>> format, which happened November 16, 2012 in the ffmpeg sources >>> (although the effect is usually not a 'frying pan noise'). >>> _______________________________________________ >>> >> The change happened between ffmpeg-1.0.6 (which works fine) and >> ffmpeg-1.1.4 (which does not). I placed a print statement with: const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); and the return value for 1.0.6 is s16, while for 1.1.4 is fltp, which I assume is float planar. Does this mean I need to use the swresample library to resample the sound to s16 which the audio card can play? From cleong at cal.berkeley.edu Mon May 6 18:42:12 2013 From: cleong at cal.berkeley.edu (Chung Leong) Date: Mon, 6 May 2013 12:42:12 -0400 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: <5187ADC2.6000404@cenatav.co.cu> References: <518129AC.7010205@cenatav.co.cu>, <201305031132.56374.gkinsey@ad-holdings.co.uk>, <5187ADC2.6000404@cenatav.co.cu> Message-ID: > Date: Mon, 6 May 2013 09:18:58 -0400 > From: dribas at cenatav.co.cu > To: libav-user at ffmpeg.org > Subject: Re: [Libav-user] compiling ffmpeg with -fPIC > > Hi Gavin!! > > I set > > -shared -Wl,-Bsymbolic > > in the linker flags of my library, that depends of libavcodec, libavutil, libavformat... > > However when Im going to call av_register_all(); I get the same error: > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against > symbol `ff_pd_1' can not be used when making a shared object; recompile > with -fPIC > > /////// > > I think that I have to set the flag -fPIC for compiling the libavcodec, libavutil, libavformat, so I added: enable pic , in the configure file of the ffmpeg project: > > # OS specific > case $target_os in > linux) > add_cppflags -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 > enable pic > enable dv1394 > > > Therefore when ffmpeg is compiled, libavcodec, libavutil, libavformat were compiled with -fPIC.... then when should be ok If I want to use them in my libx.so ... but It is not, I have the same error: > > /usr/local/lib/libavcodec.a(lpc_mmx.o): relocation R_X86_64_PC32 against > symbol `ff_pd_1' can not be used when making a shared object; recompile > with -fPIC > > > I dont know wish is the problem with ffmpeg and -fPIC... Hello, I'm new to the list. If you want to link objects in a static library into a shared library, I think you need to compile the static library using -mcmode=large. As .so can be loaded at an address above 4gig, 32-bit code pointers don't work. The linker can neither create 64-bit relocations from 32-bit relocations or change function calls from non-PIC to PIC. So it throws an error. Someone correct me if I'm wrong. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon May 6 19:34:29 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 6 May 2013 17:34:29 +0000 (UTC) Subject: [Libav-user] errors while processing tiff streams with image2pipe References: <1367857832.95867.YahooMailNeo@web28804.mail.ir2.yahoo.com> Message-ID: cyril apan writes: > http://www.filmform.com/logo/Filmform_gray-on-blank.tif > stream->codec->pix_fmt == AV_PIX_FMT_RGB24 instead of > being AV_PIX_FMT_RGBA. Looks like RGB24 to me, why do you think there is transparency information? The other sample is an unsupported format, feel free to open an enhancement request on trac. Since you used "image2pipe" in the subject: There is no tiff parser, so you cannot generally use input format image2pipe with tiff images, but this is unrelated to the samples. (Patch welcome.) Carl Eugen From cehoyos at ag.or.at Mon May 6 19:43:09 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 6 May 2013 17:43:09 +0000 (UTC) Subject: [Libav-user] errors while processing tiff streams with image2pipe References: <1367857832.95867.YahooMailNeo@web28804.mail.ir2.yahoo.com> Message-ID: Carl Eugen Hoyos writes: > The other sample is an unsupported format, feel free > to open an enhancement request on trac. The second sample uses separated channels iiuc, this is very unlikely to get supported (easily). Carl Eugen From cyrilapan at yahoo.fr Mon May 6 19:56:29 2013 From: cyrilapan at yahoo.fr (cyril apan) Date: Mon, 6 May 2013 18:56:29 +0100 (BST) Subject: [Libav-user] errors while processing tiff streams with image2pipe In-Reply-To: References: <1367857832.95867.YahooMailNeo@web28804.mail.ir2.yahoo.com> Message-ID: <1367862989.72853.YahooMailNeo@web28805.mail.ir2.yahoo.com> >cyril apan writes: >> http://www.filmform.com/logo/Filmform_gray-on-blank.tif >> stream->codec->pix_fmt == AV_PIX_FMT_RGB24 instead of >> being AV_PIX_FMT_RGBA. >Looks like RGB24 to me, why do you think there is >transparency information? Open it with Photoshop CS v12.0.4, and it displays a checkered background. With FFmpeg, I get a white background. >The other sample is an unsupported format, feel free >to open an enhancement request on trac. >The second sample uses separated channels iiuc, >this is very unlikely to get supported (easily). Well, I won't bother opening a request then. Tiff format seems quite complex to implement. If really needed, I'll probably use a specialized library. >Since you used "image2pipe" in the subject: >There is no tiff parser, so you cannot generally use >input format image2pipe with tiff images, but this is >unrelated to the samples. >(Patch welcome.) I'm not sure to understand. So, image2pipe shouldn't work with tiff files? So why I can still get something out from the 1st sample? >Carl Eugen -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon May 6 20:11:09 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 6 May 2013 18:11:09 +0000 (UTC) Subject: [Libav-user] errors while processing tiff streams with image2pipe References: <1367857832.95867.YahooMailNeo@web28804.mail.ir2.yahoo.com> <1367862989.72853.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: cyril apan writes: >>cyril apan ...> writes: >>> http://www.filmform.com/logo/Filmform_gray-on-blank.tif >> stream->codec->pix_fmt == AV_PIX_FMT_RGB24 instead of >> being AV_PIX_FMT_RGBA.>Looks like RGB24 to me, why do you >> think there is >transparency information? > Open it with Photoshop CS v12.0.4, and it displays a > checkered background. Both ImageMagick and gimp are not seeing the transparency either. I am not saying Photoshop is wrong, but I read it as "RGB" "8bit", so I don't know where to find the additional information. (It may be a Photoshop-specific tag and that is what gimp's warnings indicate.) >> Since you used "image2pipe" in the subject: >> There is no tiff parser, so you cannot generally use >> input format image2pipe with tiff images, but this is >> unrelated to the samples. >> (Patch welcome.) > > I'm not sure to understand. So, image2pipe shouldn't > work with tiff files? Not completely, no. > So why I can still get something out from the > 1st sample? Possibly because you are only feeding one image? The idea of image2pipe is usually to feed a series of images to ffmpeg, a parser is needed to find the beginning of the next image. Carl Eugen From alexcohn at netvision.net.il Mon May 6 20:51:28 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Mon, 6 May 2013 21:51:28 +0300 Subject: [Libav-user] Encoding FLV gives green screen output In-Reply-To: <1367755178284-4657503.post@n4.nabble.com> References: <1367755178284-4657503.post@n4.nabble.com> Message-ID: On Sun, May 5, 2013 at 2:59 PM, yy-zed wrote: I've written a piece of C++ code that can capture webcam video frame, decode > them, convert them to YUV420P, encode them and then write them to a file. > If > I use the mpeg2 codec and write to a .mpg file, everything works perfectly. > But, if I use flv, then the output produced is just a green screen. I'm not > sure if there are different encoder settings I need to set for encoding flv > video?Or maybe I'm doing something wrong in sws_scale? Here's my code(the > relevant parts): > > //Read a video frame in > av_read_frame(pFormatCtx,&packet); > > //Decode the contents of packet into pFrame > avcodec_decode_video2(pCodecCtx,pFrame,&frameFinished,&packet); > >From your snippet, it is not clear what pCodecCtx is, but anyways it's good practice to check the return code from avcodec_decode_video2() and frameFinished, before you pass pFrame to sws_scale(). BR, Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From brado at bighillsoftware.com Mon May 6 21:42:29 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Mon, 6 May 2013 12:42:29 -0700 Subject: [Libav-user] Flushing queued frames Message-ID: I am seeing the following output in the console upon trying to close a codec. [libmp3lame @ 0x10101fe00] 9 frames left in the queue on closing What is the proper convention for flushing the codec prior to closing it? Thanks, Brad From samhalligan15 at gmail.com Mon May 6 21:58:13 2013 From: samhalligan15 at gmail.com (Sam Halligan) Date: Mon, 6 May 2013 20:58:13 +0100 Subject: [Libav-user] Encoding FLV gives green screen output In-Reply-To: References: <1367755178284-4657503.post@n4.nabble.com> Message-ID: Solved it guys. I was calling av_codec_encode_video2 twice for some reason, and the second call was encoding a blank frame instead of the one that had data decoded into it. Silly mistake :p Thanks for the replies! On Mon, May 6, 2013 at 7:51 PM, Alex Cohn wrote: > On Sun, May 5, 2013 at 2:59 PM, yy-zed wrote: > > I've written a piece of C++ code that can capture webcam video frame, >> decode >> them, convert them to YUV420P, encode them and then write them to a file. >> If >> I use the mpeg2 codec and write to a .mpg file, everything works >> perfectly. >> But, if I use flv, then the output produced is just a green screen. I'm >> not >> sure if there are different encoder settings I need to set for encoding >> flv >> video?Or maybe I'm doing something wrong in sws_scale? Here's my code(the >> relevant parts): >> > > >> //Read a video frame in >> >> av_read_frame(pFormatCtx,&packet); >> >> //Decode the contents of packet into pFrame >> avcodec_decode_video2(pCodecCtx,pFrame,&frameFinished,&packet); >> > > From your snippet, it is not clear what pCodecCtx is, but anyways it's > good practice to check the return code from avcodec_decode_video2() and > frameFinished, before you pass pFrame to sws_scale(). > > BR, > Alex > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From samhalligan15 at gmail.com Mon May 6 22:03:50 2013 From: samhalligan15 at gmail.com (yy-zed) Date: Mon, 6 May 2013 13:03:50 -0700 (PDT) Subject: [Libav-user] RTMP output laggy Message-ID: <1367870630125-4657525.post@n4.nabble.com> Hi guys, I'm using av_write_frame() with the source destination being an RTMP server(twitch.tv in this case). My code is broadcasting to twitch ok, but frames stutter every couple of seconds, freeze for a second, and then start again. If I save the output to a local flv file it plays back perfectly. I suspected a multithreaded approach would solve this, having a thread for incoming frames and another for outgoing, but the problem stayed the same when I implemented it. Now I'm thinking it may be something to do with my encoder settings. Here they are: c->codec_id = codec_id; c->bit_rate = 600000; // Resolution must be a multiple of two. c->width = pCodecCtx->width; c->height = pCodecCtx->height; c->time_base.den = STREAM_FRAME_RATE; c->time_base.num = 1; //emit one intra frame every twelve frames at most c->gop_size = 40; c->pix_fmt = STREAM_PIX_FMT; if (codec_id == CODEC_ID_H264) { av_opt_set(c->priv_data, "preset", "fast", 0); av_opt_set(c->priv_data, "tune", "zerolatency", 0); } I've fiddled with these a lot, but nothing really makes a difference.(other than change output quality) This is the method i call to capture and write a frame to output: int ret; uint8_t *buffer = NULL; static struct SwsContext *sws_ctx; //Setup the codec context, and set its width and height to be equal to the input video width and height AVCodecContext *c = st->codec; c->width = pCodecCtx->width; c->height = pCodecCtx->height; av_init_packet(&packet); frameYUV = avcodec_alloc_frame(); //Determine how big the buffer will need to be to store the captured frame numBytes = avpicture_get_size(STREAM_PIX_FMT,pCodecCtx->width,pCodecCtx->height); //Allocate the needed buffer size buffer = new uint8_t[numBytes]; sws_ctx = sws_getContext(pCodecCtx->width,pCodecCtx->height,pCodecCtx->pix_fmt, pCodecCtx->width,pCodecCtx->height, STREAM_PIX_FMT,SWS_BICUBIC,NULL,NULL,NULL); //Fill the output frame avpicture_fill((AVPicture *)frameYUV,buffer,STREAM_PIX_FMT,pCodecCtx->width,pCodecCtx->height); //Read a video frame in av_read_frame(pFormatCtx,&packet); //Decode the contents of packet into pFrame avcodec_decode_video2(pCodecCtx,pFrame,&frameFinished,&packet); //Scale pFrame into frameYUV, and convert to PIXFMTYUV420P sws_scale ( sws_ctx, (uint8_t const * const *)pFrame->data, pFrame->linesize, 0, pCodecCtx->height, frameYUV->data, frameYUV->linesize ); AVPacket pkt = { 0 }; int got_packet; av_init_packet(&pkt); //encode the image ret = avcodec_encode_video2(c, &pkt, frameYUV, &got_packet); if (ret < 0){ debugLogStreamSave->debug("Error encoding video frame"); exit(1); } if (!ret && got_packet && pkt.size){ pkt.stream_index = st->index; // Write the compressed frame to our output ret = av_write_frame(oc, &pkt); //Free up any memory we used av_free_packet(&pkt); av_free_packet(&packet); avcodec_free_frame(&frameYUV); //avcodec_free_frame(&pFrame); delete[] buffer; } Any ideas would be appreciated! Sam -- View this message in context: http://libav-users.943685.n4.nabble.com/RTMP-output-laggy-tp4657525.html Sent from the libav-users mailing list archive at Nabble.com. From ggarra13 at gmail.com Tue May 7 00:47:08 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Mon, 06 May 2013 19:47:08 -0300 Subject: [Libav-user] avcodec_decode_audio4() help In-Reply-To: <5187DB59.8040104@gmail.com> References: <5183003F.4080506@gmail.com> <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> <5186FBEE.8020703@gmail.com> <5187C38D.1000400@gmail.com> <5187DB59.8040104@gmail.com> Message-ID: <518832EC.9000404@gmail.com> I placed a print statement with: > > const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); > > and the return value for 1.0.6 is s16, while for 1.1.4 is fltp, which > I assume is float planar. > > Does this mean I need to use the swresample library to resample the > sound to s16 which the audio card can play? > When I run the video under ffmpeg I got: Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, s16, 159 kb/s Stereo, s16. Why am I getting float data in the newer ffmpegs? From cleong at cal.berkeley.edu Tue May 7 04:00:15 2013 From: cleong at cal.berkeley.edu (Chung Leong) Date: Mon, 6 May 2013 22:00:15 -0400 Subject: [Libav-user] compiling ffmpeg with -fPIC In-Reply-To: References: <518129AC.7010205@cenatav.co.cu>, , <201305031132.56374.gkinsey@ad-holdings.co.uk>, , <5187ADC2.6000404@cenatav.co.cu>, Message-ID: Let me correct myself. The problematic symbol in the situation here is "ff_pd_1", a global variable. It's declared with the attribute visibility("hidden"). The symbol isn't exported. Knowing this, gcc apparently doesn't generate PIC code for accessing it even when you add -fPIC. By default, gcc assumes your executable isn't going to be larger than 2 gig. Executables are normally loaded within the first 2 gig of the address space, so any global variable ought to be reachable by a 32-bit address. This doesn't work for shared libraries. The address needs to be 64-bit. -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Tue May 7 09:16:57 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 7 May 2013 07:16:57 +0000 Subject: [Libav-user] Flushing queued frames In-Reply-To: References: Message-ID: On 5/6/13, Brad O'Hearne wrote: > I am seeing the following output in the console upon trying to close a > codec. > > [libmp3lame @ 0x10101fe00] 9 frames left in the queue on closing > > What is the proper convention for flushing the codec prior to closing it? Isn't it explained in documentation. You call relevant function with 0/zero/nada data and anything in queue will get flushed. > > Thanks, > > Brad > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From onemda at gmail.com Tue May 7 09:21:39 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 7 May 2013 07:21:39 +0000 Subject: [Libav-user] avcodec_decode_audio4() help In-Reply-To: <518832EC.9000404@gmail.com> References: <5183003F.4080506@gmail.com> <048A7E64-392A-4D6A-8DE0-EED1D6B0ED63@universalx.net> <5186FBEE.8020703@gmail.com> <5187C38D.1000400@gmail.com> <5187DB59.8040104@gmail.com> <518832EC.9000404@gmail.com> Message-ID: On 5/6/13, Gonzalo Garramuno wrote: > I placed a print statement with: >> >> const char *av_get_sample_fmt_name(enum AVSampleFormat sample_fmt); >> >> and the return value for 1.0.6 is s16, while for 1.1.4 is fltp, which >> I assume is float planar. >> >> Does this mean I need to use the swresample library to resample the >> sound to s16 which the audio card can play? >> > When I run the video under ffmpeg I got: > > Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 48000 Hz, stereo, > s16, 159 kb/s > > Stereo, s16. Why am I getting float data in the newer ffmpegs? Because that is native to what decoder decodes, use swresample if you need s16. From cyrilapan at yahoo.fr Tue May 7 10:09:35 2013 From: cyrilapan at yahoo.fr (cyril apan) Date: Tue, 7 May 2013 09:09:35 +0100 (BST) Subject: [Libav-user] errors while processing tiff streams with image2pipe In-Reply-To: References: <1367857832.95867.YahooMailNeo@web28804.mail.ir2.yahoo.com> <1367862989.72853.YahooMailNeo@web28805.mail.ir2.yahoo.com> Message-ID: <1367914175.99406.YahooMailNeo@web28806.mail.ir2.yahoo.com> >>> Since you used "image2pipe" in the subject: >>> There is no tiff parser, so you cannot generally use >>> input format image2pipe with tiff images, but this is >>> unrelated to the samples. >>> (Patch welcome.) >> >> I'm not sure to understand. So, image2pipe shouldn't >> work with tiff files? >Not completely, no. >> So why I can still get something out from the >> 1st sample? >Possibly because you are only feeding one image? >The idea of image2pipe is usually to feed a >series of images to ffmpeg, a parser is needed >to find the beginning of the next image. I see, I used image2pipe to be able to use custom I/O functions, something that image2 cannot handle. Well, at least I couldn't get image2 to use my custom I/O... Cyril APAN. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cyrilapan at yahoo.fr Tue May 7 10:17:18 2013 From: cyrilapan at yahoo.fr (cyril apan) Date: Tue, 7 May 2013 09:17:18 +0100 (BST) Subject: [Libav-user] issues with a wavepack file Message-ID: <1367914638.1338.YahooMailNeo@web28806.mail.ir2.yahoo.com> I tried to feed this hybrid wavepack file to ffmpeg: http://towerofbabel.free.fr/test/onemoretime-onemorechance.wv This is a lossy audio file but I also got the accompanying .wvc file to get back the full lossless version of the song album. The thing is that ffmpeg just can't handle it. For instance with "ffmpeg -i onemoretime-onemorechance.wv", I get this error: "Invalid data found when processing input". I opened ticket #2542 and got this reply (https://ffmpeg.org/trac/ffmpeg/ticket/2542#comment:1): "The sample is a Win32 executable, FFmpeg will not support such files." I don't understand how an audio file can be an executable. Can anyone explain this to me? Regards, Cyril APAN. -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Tue May 7 10:33:59 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 7 May 2013 08:33:59 +0000 Subject: [Libav-user] issues with a wavepack file In-Reply-To: <1367914638.1338.YahooMailNeo@web28806.mail.ir2.yahoo.com> References: <1367914638.1338.YahooMailNeo@web28806.mail.ir2.yahoo.com> Message-ID: On 5/7/13, cyril apan wrote: > I tried to feed this hybrid wavepack file to ffmpeg: > http://towerofbabel.free.fr/test/onemoretime-onemorechance.wv > This is a lossy audio file but I also got the accompanying .wvc file to get > back the full lossless version of the song album. > The thing is that ffmpeg just can't handle it. For instance with "ffmpeg -i > onemoretime-onemorechance.wv", I get this error: "Invalid data found when > processing input". > > I opened ticket #2542 and got this reply > (https://ffmpeg.org/trac/ffmpeg/ticket/2542#comment:1): "The sample is a > Win32 executable, FFmpeg will not support such files." > I don't understand how an audio file can be an executable. Can anyone > explain this to me? That file is not audio file, this is what file reported: onemoretime-onemorechance.wv: PE32 executable (console) Intel 80386, for MS Windows, UPX compressed Inspecting data in hex editor is looks like exectuable stuff was put at begining of wv data. If this is not some kind of trojan/virus than its probably feature that allows to auto decompress wv files on sytems without wavpack decoder. > > Regards, > > Cyril APAN. > From yangnuo0408 at yahoo.com.cn Tue May 7 12:20:51 2013 From: yangnuo0408 at yahoo.com.cn (nuo yang) Date: Tue, 7 May 2013 18:20:51 +0800 (CST) Subject: [Libav-user] =?utf-8?b?5Zue5aSN77yaICBNUEVHLTIgTlRTQyB2aWRlbyBz?= =?utf-8?q?hows_horizontal_lines_on_the_red_color?= In-Reply-To: References: <1367157019.49851.YahooMailNeo@web15102.mail.cnb.yahoo.com> Message-ID: <1367922051.16514.YahooMailNeo@web15105.mail.cnb.yahoo.com> Thank you,?Carl?! I will read the?article?and have a try, will update you later. ________________________________ From:?Carl Lindqvist To:?"This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." ? Sent:?2013-5-6 Subject:?Re: [Libav-user] MPEG-2 NTSC video shows horizontal lines on the red color Here is an article describing what is probably happening in your app, and will hopefully give you some idea what you need to correct: http://web.archive.org/web/20060719025947/http://www.hometheaterhifi.com/volume_8_2/dvd-benchmark-special-report-chroma-bug-4-2001.html 2013/5/6 Carl Lindqvist : > I suspect your issue is with resampling the 4:2:0 mpeg video to 4:2:2 > feeding the decklink card. > > As 4:2:0 in interlaced is often poorly done or misunderstood, this is > often an issue. And since we are pretty bad at noticing errors in > color, it will only be obvious in very saturated colors. > > How do you handle the conversion now? Make sure you really specify > that you are handling an interlaced source, since 4:2:0 is very > different in interlaced vs progressive. > > 2013/4/28 nuo yang : >> Hi everyone, >> >> Recently I use ffmpeg sdk to develop my own player, my video source is >> MPEG-2 NTSC video, and I use ffmpeg sdk to decode the video, then use >> BlackMagicDeckLinksdk to receive the video frame and display the video to >> my CRT monitor through a DeckLinkPCI card. Everything is okay but a little >> defect, when the video contains some red color objects (like red clothes), >> and if the red color objects moving fast, there are some horizontal lines on >> red color. My video is interlaced, and I tried some methods, including >> change the video field order, but I didn't make it. BTW, if I use ffdshow to >> decode the video, it does not have the issue. >> >> Is there someone has the same issue like me, or can someone give me some >> advice? Many thanks in advance! >> >> >> - Nuo >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Tue May 7 16:10:09 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Tue, 07 May 2013 11:10:09 -0300 Subject: [Libav-user] AVCodecTag tag In-Reply-To: <1367241559432-4657434.post@n4.nabble.com> References: <1367241559432-4657434.post@n4.nabble.com> Message-ID: <51890B41.6030506@gmail.com> On 29/04/13 10:19, Steffen wrote: > I want to provide a list of codesc that is supported by a file format. I try > to iterate over the codec_tag element in avoutputformat . But this is > impossible because it's private. What can I do? > > > > -- > View this message in context: http://libav-users.943685.n4.nabble.com/AVCodecTag-tag-tp4657434.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user From some I code I borrowed from ffmpeg. static void ffmpeg_codecs(fltk::Browser& browser, int type) { using namespace std; AVCodec *p, *p2; const char* last_name; std::ostringstream o; last_name= "000"; for(;;){ int decode=0; int encode=0; int cap=0; const char *type_str; p2=NULL; for(p = av_codec_next(NULL); p; p = av_codec_next(p) ) { if((p2==NULL || strcmp(p->name, p2->name)<0) && strcmp(p->name, last_name)>0){ p2= p; decode= encode= cap=0; } if(p2 && strcmp(p->name, p2->name)==0){ if(p->decode) decode=1; if(p->encode2) encode=1; cap |= p->capabilities; } } if(p2==NULL) break; last_name= p2->name; if ( p2->type != type ) continue; switch(p2->type) { case AVMEDIA_TYPE_VIDEO: type_str = "V"; break; case AVMEDIA_TYPE_AUDIO: type_str = "A"; break; case AVMEDIA_TYPE_SUBTITLE: type_str = "S"; break; default: type_str = "?"; break; } std::ostringstream o; o << ( decode ? "D\t" : " \t" ) << ( encode ? "E\t" : " \t" ) << "\t" << ( cap & CODEC_CAP_DRAW_HORIZ_BAND ? "S\t":" \t" ) << ( cap & CODEC_CAP_DR1 ? "D\t":" \t" ) << ( cap & CODEC_CAP_TRUNCATED ? "T\t":" \t" ) << p2->name; browser.add( o.str().c_str() ); From phuze9 at gmail.com Wed May 8 05:54:53 2013 From: phuze9 at gmail.com (mohM) Date: Tue, 7 May 2013 20:54:53 -0700 (PDT) Subject: [Libav-user] Output encode file audio/video plays too fast in ffplay Message-ID: <1367985293263-4657535.post@n4.nabble.com> Here's an example of the output file -- View this message in context: http://libav-users.943685.n4.nabble.com/Output-encode-file-audio-video-plays-too-fast-in-ffplay-tp4657535.html Sent from the libav-users mailing list archive at Nabble.com. From alexcohn at netvision.net.il Wed May 8 16:44:52 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 8 May 2013 17:44:52 +0300 Subject: [Libav-user] AMR codec/format, rfc3267 saved file Message-ID: I have a file exported from Wireshark for an audio RTP stream with an AMR codec. I cannot read it with ffmpeg -fmt amr -acodec amr-wb because rfc 3267 adds an extra byte ahead of the AMR "table of contents". It is very easy to write code that ignores this one byte, but that means recompiling for all platforms. The question is, maybe there already is a way to do that without recompiling the libraries? Best, if there is some advanced option for ffmpeg command line to skip one byte before parsing packets with amr format or codec. Thanks, Alex From praks411 at gmail.com Wed May 8 16:50:43 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Wed, 8 May 2013 07:50:43 -0700 (PDT) Subject: [Libav-user] Understanding planar data arrangement in AVFrame In-Reply-To: <20130506131055.GA16299@phare.normalesup.org> References: <1367843836071-4657508.post@n4.nabble.com> <20130506131055.GA16299@phare.normalesup.org> Message-ID: <1368024643571-4657537.post@n4.nabble.com> Thanks Nicolas for the brief explanation. It has helped me to understand better. -- View this message in context: http://libav-users.943685.n4.nabble.com/Understanding-planar-data-arrangement-in-AVFrame-tp4657508p4657537.html Sent from the libav-users mailing list archive at Nabble.com. From eric at teratorn.org Mon May 6 22:02:57 2013 From: eric at teratorn.org (Eric P. Mangold) Date: Mon, 6 May 2013 16:02:57 -0400 Subject: [Libav-user] Flushing queued frames In-Reply-To: References: Message-ID: <20130506200257.GW17803@ragnarok.teratorn.org> On Mon, May 06, 2013 at 12:42:29PM -0700, Brad O'Hearne wrote: > I am seeing the following output in the console upon trying to close a codec. > > [libmp3lame @ 0x10101fe00] 9 frames left in the queue on closing > > What is the proper convention for flushing the codec prior to closing it? > > Thanks, > > Brad I believe the normal convention is to "encode" an empty frame (NULL AVFrame pointer). If the codec returns a packet, that is a delayed (queued) packet from the encoder. Repeat until it stops returning packets. Cheers, -E From Jamal.Waseem at de.bosch.com Tue May 7 14:29:47 2013 From: Jamal.Waseem at de.bosch.com (Jamal Waseem (RBEI/ESD4)) Date: Tue, 7 May 2013 20:29:47 +0800 Subject: [Libav-user] Decoding H.264 from camera streams in Live mode Message-ID: I am currently trying to decode the Streams from a camera which uses the RTP protocol. The RTP payload has RFC6184 which contains H.264 video. I am able to decode a normal h.264 video but have no idea how to decode the Ethernet streams which has RTP data. Please guide me. -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjoern.drabeck at gmail.com Thu May 9 08:41:17 2013 From: bjoern.drabeck at gmail.com (Bjoern Drabeck) Date: Thu, 9 May 2013 14:41:17 +0800 Subject: [Libav-user] Reducing latency of file opening (when playing from http) Message-ID: Hi, I was wondering if there is a way that I can reduce the time it takes to open a file when I am playing it from online. The testfile I was using was taking around 15 sec inside avformat_open_input. I have tried to change the probesize to 1M or 500k, but seems to make no difference at all. Is there any way where I can effectively reduce the opening time of online files? Any other settings I can try? thanks, Bjoern -------------- next part -------------- An HTML attachment was scrubbed... URL: From nitinmittal84 at gmail.com Thu May 9 10:03:56 2013 From: nitinmittal84 at gmail.com (nitin mittal) Date: Thu, 9 May 2013 13:33:56 +0530 Subject: [Libav-user] FLV metadata does not update if IO type is customized to buffer Message-ID: Hi, I am trying to make an application to transcode from mov to flv. It is an file in stream out application which transcodes it on the fly. But only problem is flv metadata is not being updated properly by the flv encoder, so i am not able to pause and play again the flv video. So is there any way to update the flv metadata header at regular intervals. Nitin -------------- next part -------------- An HTML attachment was scrubbed... URL: From gedikmert89 at gmail.com Thu May 9 12:03:46 2013 From: gedikmert89 at gmail.com (Mert Gedik) Date: Thu, 9 May 2013 13:03:46 +0300 Subject: [Libav-user] I can not play mjpeg streams via ffplay Message-ID: I've tried to open below stream with both 1.0 ffplay and 1.2 ffplay. But both can not play that stream, there were shown below logs in terminal when try to play.. (ffplay tries to connect/get data for 15-20 seconds then it timeouts with below log.) mert-gediks-macbook-4:ffmpeg-1.2 Gedik$ ./ffplay http://88.53.197.250/axis-cgi/mjpg/video.cgi?resolution=320x240 ffplay version 1.2 Copyright (c) 2003-2013 the FFmpeg developers built on Apr 12 2013 09:55:51 with llvm-gcc 4.2.1 (LLVM build 2336.11.00) configuration: --disable-yasm --disable-encoders libavutil 52. 18.100 / 52. 18.100 libavcodec 54. 92.100 / 54. 92.100 libavformat 54. 63.104 / 54. 63.104 libavdevice 54. 3.103 / 54. 3.103 libavfilter 3. 42.103 / 3. 42.103 libswscale 2. 2.100 / 2. 2.100 libswresample 0. 17.102 / 0. 17.102 http://88.53.197.250/axis-cgi/mjpg/video.cgi?resolution=320x240: Invalid data found when processing input Actually, ffplay is a very advanced player which can play almost everything, so I did miss sth when trying to play a basic mjpeg stream, could someone guide me for this topic? If I did everything right, Is this a known situation or is a known bug ? Is this a bug, is there any patch or workaround to fix this issue? Regards, - Mert -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu May 9 19:25:30 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 9 May 2013 17:25:30 +0000 (UTC) Subject: [Libav-user] I can not play mjpeg streams via ffplay References: Message-ID: Mert Gedik writes: > (ffplay tries to connect/get data for 15-20 seconds then > it timeouts with below log.) > > > $ ./ffplay http://88.53.197.250/axis-cgi/mjpg/video.cgi?resolution=320x240 mjpeg cannot be autodetected (yet), you have to force the format: $ ffplay -f mjpeg http://88.53.197.250/axis-cgi/mjpg/video.cgi?resolution=320x240 To speed up playback, use -probesize 32 Carl Eugen From cehoyos at ag.or.at Thu May 9 19:26:21 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 9 May 2013 17:26:21 +0000 (UTC) Subject: [Libav-user] Reducing latency of file opening (when playing from http) References: Message-ID: Bjoern Drabeck writes: > I was wondering if there is a way that I can reduce the > time it takes to open a file when I am playing it from > online. Did you test the -probesize and -analyzeduration options? Carl Eugen From cehoyos at ag.or.at Thu May 9 19:27:33 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 9 May 2013 17:27:33 +0000 (UTC) Subject: [Libav-user] AMR codec/format, rfc3267 saved file References: Message-ID: Alex Cohn writes: > I have a file exported from Wireshark for an > audio RTP stream with an AMR codec. I cannot > read it with > > ffmpeg -fmt amr -acodec amr-wb Please provide a sample (and please send a patch to ffmpeg-devel). Carl Eugen From alexcohn at netvision.net.il Thu May 9 19:42:10 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 9 May 2013 20:42:10 +0300 Subject: [Libav-user] AMR codec/format, rfc3267 saved file In-Reply-To: References: Message-ID: On 9 May 2013 20:35, "Carl Eugen Hoyos" wrote: > > Alex Cohn writes: > > > I have a file exported from Wireshark for an > > audio RTP stream with an AMR codec. I cannot > > read it with > > > > ffmpeg -fmt amr -acodec amr-wb > > Please provide a sample (and please send a > patch to ffmpeg-devel). I haven't got a patch, and I am not sure yet what patch would be correct in this case. Since yesterday, I found more complicated cases. Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From ggarra13 at gmail.com Fri May 10 01:20:19 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Thu, 09 May 2013 20:20:19 -0300 Subject: [Libav-user] ctx->request_sample_fmt Message-ID: <518C2F33.7070403@gmail.com> I saw this codeccontext variable ctx->request_sample_fmt and I want to set it to AV_SAMPLE_FMT_S16. I did so, but I get FLTP samples in return. Is this supposed to work at all? From bjoern.drabeck at gmail.com Fri May 10 04:06:54 2013 From: bjoern.drabeck at gmail.com (Bjoern Drabeck) Date: Fri, 10 May 2013 10:06:54 +0800 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: Message-ID: > > > I was wondering if there is a way that I can reduce the > > time it takes to open a file when I am playing it from > > online. > > Did you test the -probesize and -analyzeduration options? > > Carl Eugen > Thanks for your reply, I briefly experimented with the -probesize option, it seems to default to 5000000, and I brought it down to 100000, without any noticeable effect, so I have the following questions for you: 1. What are the suggested settings for -probesize and -analyzeduration if I am playing files from online? 2. I noticed when I opened one of those online files, it took around 14 sec every time I tried yesterday, however if I seek deeply into that file, that is much faster, around 2 sec (I am under the (wrong?) assumption that the operations would be fairly similar, ie start reading from that location and build up a buffer, except when I am opening a file it would also need to read header information). So is there anything else I can do to help speed up the opening process, other than the above two options? Can I affect that buffering behavior ie how deep it buffers? 3. Like I mentioned in another mail to this list (but no reply), when I pause my player during playing an online file, after a while I always seem get get a bunch of AVERROR_INVALIDDATA errors, it recovers and later delivers correct packages again, but it results in a couple of frames with artifacts, which I would like to avoid. Is that some kind of disconnect inside ffmpeg? Maybe after some timeout or so? Can I affect that behavior? thanks, Bjoern From cehoyos at ag.or.at Fri May 10 07:40:39 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 10 May 2013 05:40:39 +0000 (UTC) Subject: [Libav-user] Reducing latency of file opening (when playing from http) References: Message-ID: Bjoern Drabeck writes: > > Did you test the -probesize and -analyzeduration options? > > Thanks for your reply, I briefly experimented with the > -probesize option, it seems to default to 5000000, and I > brought it down to 100000, without any noticeable effect What happens if you test smaller values? Carl Eugen From bjoern.drabeck at gmail.com Fri May 10 07:52:28 2013 From: bjoern.drabeck at gmail.com (Bjoern Drabeck) Date: Fri, 10 May 2013 13:52:28 +0800 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: Message-ID: >> > Did you test the -probesize and -analyzeduration options? >> >> Thanks for your reply, I briefly experimented with the >> -probesize option, it seems to default to 5000000, and I >> brought it down to 100000, without any noticeable effect > > What happens if you test smaller values? > > Carl Eugen > I haven't tried less than 100000 yet, because I wanted to find out first what are "sensible values", as according to the documentation it seems to increase the probe size internally anyway if it cannot find the info it needs. If I lower it a lot, and in the end it internally has to go up to say 100000 again anyway, then there would be no point for me lowering it, right? And I haven't changed the analyzeduration at all yet. Is there a suggested range of values for probing online files? -Bjoern From cehoyos at ag.or.at Fri May 10 07:38:45 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 10 May 2013 05:38:45 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?ctx-=3Erequest=5Fsample=5Ffmt?= References: <518C2F33.7070403@gmail.com> Message-ID: Gonzalo Garramuno writes: > I saw this codeccontext variable ctx->request_sample_fmt > and I want to set it to AV_SAMPLE_FMT_S16. Setting request_sample_fmt does in no way guarantee that you get what you want. If you think the documentation is unclear, please consider improving it for us. Carl Eugen From cehoyos at ag.or.at Fri May 10 08:11:28 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 10 May 2013 06:11:28 +0000 (UTC) Subject: [Libav-user] Reducing latency of file opening (when playing from http) References: Message-ID: Bjoern Drabeck writes: > Is there a suggested range of values The suggested range of values for probesize and analyzeduration is 32 to 2147483647. (32 does not always work.) > for probing online files? I don't think there are suggested values for online files, but if you read yesterdays messages on this mailing list, you will agree that 100000 is likely too much for some samples. Carl Eugen From bjoern.drabeck at gmail.com Fri May 10 08:33:18 2013 From: bjoern.drabeck at gmail.com (Bjoern Drabeck) Date: Fri, 10 May 2013 14:33:18 +0800 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: Message-ID: > >> Is there a suggested range of values > > The suggested range of values for probesize and > analyzeduration is 32 to 2147483647. > (32 does not always work.) > >> for probing online files? > > I don't think there are suggested values for online > files, but if you read yesterdays messages on this > mailing list, you will agree that 100000 is likely > too much for some samples. > > Carl Eugen > Does 100000 mean it will try to download the first 100000 bytes of the file? Or 100000 after the header data? And does it mean that probesize and analyzedduration should have the same or similar value? From gedikmert89 at gmail.com Fri May 10 09:10:30 2013 From: gedikmert89 at gmail.com (Mert Gedik) Date: Fri, 10 May 2013 10:10:30 +0300 Subject: [Libav-user] I can not play mjpeg streams via ffplay In-Reply-To: References: Message-ID: On Fri, May 10, 2013 at 10:07 AM, Murat Sudan wrote: > > mjpeg cannot be autodetected (yet), you have to force the format: >> > $ ffplay -f mjpeg >> > http://88.53.197.250/axis-cgi/mjpg/video.cgi?resolution=320x240 >> > >> > To speed up playback, use -probesize 32 >> > >> > Carl Eugen > > It works with that format, thank you Carl... - Mert -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjoern.drabeck at gmail.com Fri May 10 09:12:44 2013 From: bjoern.drabeck at gmail.com (Bjoern Drabeck) Date: Fri, 10 May 2013 15:12:44 +0800 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: Message-ID: >>> Is there a suggested range of values >> >> The suggested range of values for probesize and >> analyzeduration is 32 to 2147483647. >> (32 does not always work.) >> >>> for probing online files? >> >> I don't think there are suggested values for online >> files, but if you read yesterdays messages on this >> mailing list, you will agree that 100000 is likely >> too much for some samples. >> >> Carl Eugen >> > > Does 100000 mean it will try to download the first 100000 bytes of the > file? Or 100000 after the header data? > > And does it mean that probesize and analyzedduration should have the > same or similar value? I just tested some more, it seems to make no real difference whether I set probesize/analyzeduration to 5000000 or 5000, both take more or less the same time (on the test file I was using today it was around 10 sec).. if I go much lower than 5000 at some point I start encountering "-22" errors -Bjoern From gedikmert89 at gmail.com Fri May 10 09:42:12 2013 From: gedikmert89 at gmail.com (Mert Gedik) Date: Fri, 10 May 2013 10:42:12 +0300 Subject: [Libav-user] Force ffplay to play video for a given fps Message-ID: Hello team, I am working on a security application to show 16 cams at the same time. To be able to do that I think, reducing the fps is a good idea. (maybe it isn't, I am not sure...) I can do it this modifying my stream player to refresh it's video view for a specific time interval but this may cause to break my AV sync algorithm. So, best way to do that is tell the fps to ffplay via option method. 1-2 years ago someone tried to make a patch for this but it was rejected and I don't know what was happened later... does anyone here know about this ? Also, is the above idea the right way to show 16 cams at the same time..? - Mert -------------- next part -------------- An HTML attachment was scrubbed... URL: From praks411 at gmail.com Fri May 10 10:50:00 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Fri, 10 May 2013 01:50:00 -0700 (PDT) Subject: [Libav-user] ctx->request_sample_fmt In-Reply-To: References: <518C2F33.7070403@gmail.com> Message-ID: <1368175800023-4657557.post@n4.nabble.com> I think it also depend upon the codec which you are using. If codec support that particular then probably you may be able to set. Though I'm bit new to ffmpeg most of the codec support just on sample format. For example AAC supports AV_SAMPLE_FMT_FLTP. AC3 has two variant ac3 and ac3_fixed. ac3_fixed support AV_SAMPLE_FMT_S16. Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-ctx-request-sample-fmt-tp4657547p4657557.html Sent from the libav-users mailing list archive at Nabble.com. From praks411 at gmail.com Fri May 10 10:57:48 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Fri, 10 May 2013 01:57:48 -0700 (PDT) Subject: [Libav-user] Output encode file audio/video plays too fast in ffplay In-Reply-To: <1367985293263-4657535.post@n4.nabble.com> References: <1367985293263-4657535.post@n4.nabble.com> Message-ID: <1368176268207-4657558.post@n4.nabble.com> I've faced a similar problem before. I was just doing stream copy i.e changing the container format to avi. I think you care correct your pts and dts may not be correct. I too ended up playing with various combination. Try following. it worked for me. This is just for stream copy which involves no decoding outpkt.pts= av_rescale_q(inputpkt.pts, input_video_strm->time_base, output_video_strm->time_base); Similar rescaling for dts. Also you will need to do it for audio stream too. One thing to note it that if you are encoding decoded packet then you can forget about pts and dts. Encoder automatically does that for you. Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Output-encode-file-audio-video-plays-too-fast-in-ffplay-tp4657535p4657558.html Sent from the libav-users mailing list archive at Nabble.com. From me at renecalles.de Fri May 10 11:46:01 2013 From: me at renecalles.de (me at renecalles.de) Date: Fri, 10 May 2013 11:46:01 +0200 Subject: [Libav-user] =?utf-8?q?MP4_and_MPEGTS_output_in_Tee_Muxer=3F?= Message-ID: <69daca29fab3c8bd5d0a07ae1e700c3a@renecalles.de> Hi all, i'm wondering if there is a possibility to output MP4 and MPEG-TS video using the Tee Muxer. As MPEG-TS output needs the bitstream formatted according to Annex B in MPEG-TS spec, MP4 dos not support that and i couldn't apply a "pre-muxing" filter for that in the Tee Muxer context. Has anyone experience in this or could tell me if this is even possible? Is there a hidden trick? ;-) Best regards Ren? From praks411 at gmail.com Fri May 10 11:20:32 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Fri, 10 May 2013 02:20:32 -0700 (PDT) Subject: [Libav-user] Stream copy given start and end time Message-ID: <1368177632869-4657559.post@n4.nabble.com> Hi, I'm trying a small program which cuts clip from video file given start and end time. For this I'm doing a simple stream copy of both audio and video stream. I just copied the pts and dts from input packet to output with proper re-scaling. However the output which I'm getting is blank for some duration and then only for last few seconds it is displayed. I thought this could to problem of incorrent pts and dts. So I just manually set pts and dts using counter for each stream. Though I'm able to get the clip but video is very fast and audio goes fine. Please someone explain me how to set current pts and dts for both audio and video stream, when doing stream copy. Thanks and Regards, Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Stream-copy-given-start-and-end-time-tp4657559.html Sent from the libav-users mailing list archive at Nabble.com. From onemda at gmail.com Fri May 10 12:28:25 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 10 May 2013 10:28:25 +0000 Subject: [Libav-user] Force ffplay to play video for a given fps In-Reply-To: References: Message-ID: On 5/10/13, Mert Gedik wrote: > Hello team, > > I am working on a security application to show 16 cams at the same time. To > be able to do that I think, reducing the fps is a good idea. (maybe it > isn't, I am not sure...) > > I can do it this modifying my stream player to refresh it's video view for > a specific time interval but this may cause to break my AV sync algorithm. > So, best way to do that is tell the fps to ffplay via option method. > > 1-2 years ago someone tried to make a patch for this but it was rejected > and I don't know what was happened later... > > does anyone here know about this ? > Also, is the above idea the right way to show 16 cams at the same time..? With ffplay? Certainly not. ffplay is (currently) simple player that use SDL for video rendering. (Note that is IMHO just my opinion.) But perhaps you can use fps filter with ffplay. From phuze9 at gmail.com Fri May 10 12:44:03 2013 From: phuze9 at gmail.com (mohM) Date: Fri, 10 May 2013 03:44:03 -0700 (PDT) Subject: [Libav-user] Flushing Audio Frame Crash Message-ID: <1368182643857-4657562.post@n4.nabble.com> I saw another thread on here similar to this, but it didn't really solve my problem. Basically, I'm still working on getting my audio encoding to work, and I'm now having trouble getting a basic audio encode to work...What I'm trying to do is get a single frame of audio to encode. The first call to avcodec_encode_audio2() is successfull, and if I leave out the flush loop, the console output tells me: As far as I can understand from the documentation and my experience with video encoding, this is pretty normal. When I try to flush the frame by passing NULL into avcodec_encode_audio2(), however, the program crashes and says "Integer division by zero" in mlock.c. Am I doing something wrong here? Any ideas? -- View this message in context: http://libav-users.943685.n4.nabble.com/Flushing-Audio-Frame-Crash-tp4657562.html Sent from the libav-users mailing list archive at Nabble.com. From onemda at gmail.com Fri May 10 13:08:49 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 10 May 2013 11:08:49 +0000 Subject: [Libav-user] Flushing Audio Frame Crash In-Reply-To: <1368182643857-4657562.post@n4.nabble.com> References: <1368182643857-4657562.post@n4.nabble.com> Message-ID: On 5/10/13, mohM wrote: > I saw another thread on here similar to this, but it didn't really solve my > problem. Basically, I'm still working on getting my audio encoding to work, > and I'm now having trouble getting a basic audio encode to work...What I'm > trying to do is get a single frame of audio to encode. The first call to > avcodec_encode_audio2() is successfull, and if I leave out the flush loop, > the console output tells me: > > As far as I can understand from the documentation and my experience with > video encoding, this is pretty normal. When I try to flush the frame by > passing NULL into avcodec_encode_audio2(), however, the program crashes and > says "Integer division by zero" in mlock.c. Am I doing something wrong > here? > Any ideas? What codec? Note that only some encoders actually supports flushing. > > > > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/Flushing-Audio-Frame-Crash-tp4657562.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From phuze9 at gmail.com Fri May 10 14:29:50 2013 From: phuze9 at gmail.com (phuze koj) Date: Fri, 10 May 2013 07:29:50 -0500 Subject: [Libav-user] Flushing Audio Frame Crash In-Reply-To: References: <1368182643857-4657562.post@n4.nabble.com> Message-ID: well the data is PCM (int16_t*), the codec is aac (which will interlace with a h264 baseline video in an mp4 container) On Fri, May 10, 2013 at 6:08 AM, Paul B Mahol wrote: > On 5/10/13, mohM wrote: > > I saw another thread on here similar to this, but it didn't really solve > my > > problem. Basically, I'm still working on getting my audio encoding to > work, > > and I'm now having trouble getting a basic audio encode to work...What > I'm > > trying to do is get a single frame of audio to encode. The first call to > > avcodec_encode_audio2() is successfull, and if I leave out the flush > loop, > > the console output tells me: > > > > As far as I can understand from the documentation and my experience with > > video encoding, this is pretty normal. When I try to flush the frame by > > passing NULL into avcodec_encode_audio2(), however, the program crashes > and > > says "Integer division by zero" in mlock.c. Am I doing something wrong > > here? > > Any ideas? > > What codec? > > Note that only some encoders actually supports flushing. > > > > > > > > > > > > > -- > > View this message in context: > > > http://libav-users.943685.n4.nabble.com/Flushing-Audio-Frame-Crash-tp4657562.html > > Sent from the libav-users mailing list archive at Nabble.com. > > _______________________________________________ > > Libav-user mailing list > > Libav-user at ffmpeg.org > > http://ffmpeg.org/mailman/listinfo/libav-user > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From brado at bighillsoftware.com Fri May 10 19:15:12 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Fri, 10 May 2013 10:15:12 -0700 Subject: [Libav-user] Flushing Audio Frame Crash In-Reply-To: <1368182643857-4657562.post@n4.nabble.com> References: <1368182643857-4657562.post@n4.nabble.com> Message-ID: On May 10, 2013, at 3:44 AM, mohM wrote: > I saw another thread on here similar to this, but it didn't really solve my > problem. Basically, I'm still working on getting my audio encoding to work, > and I'm now having trouble getting a basic audio encode to work...What I'm > trying to do is get a single frame of audio to encode. The first call to > avcodec_encode_audio2() is successfull, and if I leave out the flush loop, > the console output tells me: > > As far as I can understand from the documentation and my experience with > video encoding, this is pretty normal. When I try to flush the frame by > passing NULL into avcodec_encode_audio2(), however, the program crashes and > says "Integer division by zero" in mlock.c. Am I doing something wrong here? > Any ideas? Hey there...I assume the "another thread" you are referring to is mine that was posted a few days ago on the same topic. I can identify where you are coming from. This issue, its proper handling, and surrounding implications are not outright documented as a whole in a single place, and where it is referred to in documentation (several places), there seems to be details that have to be inferred. Disclaimer -- I am no expert on this, and don't know if what I put here will help solve your problem, but it's the best of what I understand about it, for better or worse. Hopefully it will help. Here's where you can find some references to discussion of this: - avcodec.h, line 4014, frame parameter. Here it mentions using NULL to flush. It doesn't mention exactly whether flushing is a bulk or repeated operation, nor the implications for pts or dts for flushed frames here. But it does reference CODEC_CAP_DELAY, and if you follow to to that parameter's doc, there's much more helpful info. - avcodec.h, line 737, CODEC_CAP_DELAY define. Explains that encoding needs to end with flushing, and says in so many words that you need to repeat the process of passing a NULL parameter until the encoder has no more frames. Make sure to read the NOTE, as it gives some important information about pts and dts. - decoding_encoding.h, line 447, flush loop -- it says "get the delayed frames" -- that's essentially flushing the encoder. It doesn't do anything with pts and dts (nor did it for anywhere in this example, but see the CODEC_CAP_DELAY doc for that detail). As I understand it, the general idea is this: when you execute avcodec_encode_audio2, you are giving the encoder an audio buffer of samples to encode. The encoder may optionally populate and output a packet for you to do further processing (presumably stream or write to drive). That part you probably know and have working. In the case where the encoder does not populate and output a packet in that call, it may have decided for some encoding reason to hold the data. What that means is that after you send the last of your sample data to the encoder in your last normal avcodec_encode_audio2 call, the encoder may still be holding on to data that you previously sent it. You need to flush this data out of the encoder so that you can process it like the rest of the encoded data by repeating calls to avcodec_encode_audio2 with NULL as the frame parameter to tell the codec to release a single buffered frame. That's important -- this isn't a single call, it may be several. Repeat the process until got_packet_ptr returns a 0 value, indicating that no packet has been returned. Note that the decoding_encoding.c example references a use case where all of the data is known at the time of encoding -- in a streaming scenario, it will usually be the input's attempt to close the stream which should trigger the flushing of the codec. Note there are a number of unknowns still for me: - I do not know what codecs support CODEC_CAP_DELAY, or if there's something significant which determines if a codec supports it, or if it is entirely arbitrary. - I do not know whether you can or what determines if you can change the CODEC_CAP_DELAY value for an encoder from what it is set at after you create the encoder. - I do not know if a codec without CODEC_CAP_DELAY set can still buffer frames, and if so, how it would be flushed. That's the best I've pieced together. I hope it helps. If not, I wish you the best of success solving the problem. If I encounter anything which might seem relevant, I'll post it. Cheers, Brad From onemda at gmail.com Fri May 10 19:23:53 2013 From: onemda at gmail.com (Paul B Mahol) Date: Fri, 10 May 2013 17:23:53 +0000 Subject: [Libav-user] Flushing Audio Frame Crash In-Reply-To: References: <1368182643857-4657562.post@n4.nabble.com> Message-ID: On 5/10/13, Brad O'Hearne wrote: > On May 10, 2013, at 3:44 AM, mohM wrote: > >> I saw another thread on here similar to this, but it didn't really solve >> my >> problem. Basically, I'm still working on getting my audio encoding to >> work, >> and I'm now having trouble getting a basic audio encode to work...What >> I'm >> trying to do is get a single frame of audio to encode. The first call to >> avcodec_encode_audio2() is successfull, and if I leave out the flush >> loop, >> the console output tells me: >> >> As far as I can understand from the documentation and my experience with >> video encoding, this is pretty normal. When I try to flush the frame by >> passing NULL into avcodec_encode_audio2(), however, the program crashes >> and >> says "Integer division by zero" in mlock.c. Am I doing something wrong >> here? >> Any ideas? > > Hey there...I assume the "another thread" you are referring to is mine that > was posted a few days ago on the same topic. I can identify where you are > coming from. This issue, its proper handling, and surrounding implications > are not outright documented as a whole in a single place, and where it is > referred to in documentation (several places), there seems to be details > that have to be inferred. Disclaimer -- I am no expert on this, and don't > know if what I put here will help solve your problem, but it's the best of > what I understand about it, for better or worse. Hopefully it will help. > > Here's where you can find some references to discussion of this: > > - avcodec.h, line 4014, frame parameter. Here it mentions using NULL to > flush. It doesn't mention exactly whether flushing is a bulk or repeated > operation, nor the implications for pts or dts for flushed frames here. But > it does reference CODEC_CAP_DELAY, and if you follow to to that parameter's > doc, there's much more helpful info. > > - avcodec.h, line 737, CODEC_CAP_DELAY define. Explains that encoding needs > to end with flushing, and says in so many words that you need to repeat the > process of passing a NULL parameter until the encoder has no more frames. > Make sure to read the NOTE, as it gives some important information about pts > and dts. > > - decoding_encoding.h, line 447, flush loop -- it says "get the delayed > frames" -- that's essentially flushing the encoder. It doesn't do anything > with pts and dts (nor did it for anywhere in this example, but see the > CODEC_CAP_DELAY doc for that detail). > > As I understand it, the general idea is this: when you execute > avcodec_encode_audio2, you are giving the encoder an audio buffer of samples > to encode. The encoder may optionally populate and output a packet for you > to do further processing (presumably stream or write to drive). That part > you probably know and have working. In the case where the encoder does not > populate and output a packet in that call, it may have decided for some > encoding reason to hold the data. What that means is that after you send the > last of your sample data to the encoder in your last normal > avcodec_encode_audio2 call, the encoder may still be holding on to data that > you previously sent it. > > You need to flush this data out of the encoder so that you can process it > like the rest of the encoded data by repeating calls to > avcodec_encode_audio2 with NULL as the frame parameter to tell the codec to > release a single buffered frame. That's important -- this isn't a single > call, it may be several. Repeat the process until got_packet_ptr returns a 0 > value, indicating that no packet has been returned. Note that the > decoding_encoding.c example references a use case where all of the data is > known at the time of encoding -- in a streaming scenario, it will usually be > the input's attempt to close the stream which should trigger the flushing of > the codec. > > Note there are a number of unknowns still for me: > > - I do not know what codecs support CODEC_CAP_DELAY, or if there's something > significant which determines if a codec supports it, or if it is entirely > arbitrary. Look at encoder AVCodec .capabilities that holds flags. > - I do not know whether you can or what determines if you can change the > CODEC_CAP_DELAY value for an encoder from what it is set at after you create > the encoder. No. that flag means encoder is capable of that. you can not change it. > - I do not know if a codec without CODEC_CAP_DELAY set can still buffer > frames, and if so, how it would be flushed. It should not buffer frames. > > That's the best I've pieced together. I hope it helps. If not, I wish you > the best of success solving the problem. If I encounter anything which might > seem relevant, I'll post it. > > Cheers, > > Brad > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From phuze9 at gmail.com Fri May 10 23:23:06 2013 From: phuze9 at gmail.com (phuze koj) Date: Fri, 10 May 2013 16:23:06 -0500 Subject: [Libav-user] Flushing Audio Frame Crash In-Reply-To: References: <1368182643857-4657562.post@n4.nabble.com> Message-ID: Thanks for that response Brad, it was your question that I found. Yeah I've found most of the same information from my digging as well and I'm also unsure if AAC supports CODEC_CAP_DELAY (thanks for the tip Paul, I'll check it when I get a chance). I've tried to simplify my audio writing to the absolute simplest case (encoding a single, albeit large frame) which is why I'm doing this test that's leading to this problem. I'm not sure if the code I posted in the OP is showing up or not, but I am looping the flush although it's crashing on the first NULL encode saying 'Integer division by zero', even though there's clearly still a frame to be flushed out. The only thing that makes sense to me at this point is that AAC doesn't have CODEC_CAP_DELAY capabilities and that's causing the run-time error...Hopefully I can update with more information about that later. for(got_packet = 1;got_packet;) { fflush(stdout); if(avcodec_encode_audio2(c,&pkt,NULL,&got_packet) || !got_packet) { fprintf(stderr,"Error encoding frame\n"); } else { av_write_frame(oc,&pkt); av_free_packet(&pkt); } } On Fri, May 10, 2013 at 12:15 PM, Brad O'Hearne wrote: > On May 10, 2013, at 3:44 AM, mohM wrote: > > > I saw another thread on here similar to this, but it didn't really solve > my > > problem. Basically, I'm still working on getting my audio encoding to > work, > > and I'm now having trouble getting a basic audio encode to work...What > I'm > > trying to do is get a single frame of audio to encode. The first call to > > avcodec_encode_audio2() is successfull, and if I leave out the flush > loop, > > the console output tells me: > > > > As far as I can understand from the documentation and my experience with > > video encoding, this is pretty normal. When I try to flush the frame by > > passing NULL into avcodec_encode_audio2(), however, the program crashes > and > > says "Integer division by zero" in mlock.c. Am I doing something wrong > here? > > Any ideas? > > Hey there...I assume the "another thread" you are referring to is mine > that was posted a few days ago on the same topic. I can identify where you > are coming from. This issue, its proper handling, and surrounding > implications are not outright documented as a whole in a single place, and > where it is referred to in documentation (several places), there seems to > be details that have to be inferred. Disclaimer -- I am no expert on this, > and don't know if what I put here will help solve your problem, but it's > the best of what I understand about it, for better or worse. Hopefully it > will help. > > Here's where you can find some references to discussion of this: > > - avcodec.h, line 4014, frame parameter. Here it mentions using NULL to > flush. It doesn't mention exactly whether flushing is a bulk or repeated > operation, nor the implications for pts or dts for flushed frames here. But > it does reference CODEC_CAP_DELAY, and if you follow to to that parameter's > doc, there's much more helpful info. > > - avcodec.h, line 737, CODEC_CAP_DELAY define. Explains that encoding > needs to end with flushing, and says in so many words that you need to > repeat the process of passing a NULL parameter until the encoder has no > more frames. Make sure to read the NOTE, as it gives some important > information about pts and dts. > > - decoding_encoding.h, line 447, flush loop -- it says "get the delayed > frames" -- that's essentially flushing the encoder. It doesn't do anything > with pts and dts (nor did it for anywhere in this example, but see the > CODEC_CAP_DELAY doc for that detail). > > As I understand it, the general idea is this: when you execute > avcodec_encode_audio2, you are giving the encoder an audio buffer of > samples to encode. The encoder may optionally populate and output a packet > for you to do further processing (presumably stream or write to drive). > That part you probably know and have working. In the case where the encoder > does not populate and output a packet in that call, it may have decided for > some encoding reason to hold the data. What that means is that after you > send the last of your sample data to the encoder in your last normal > avcodec_encode_audio2 call, the encoder may still be holding on to data > that you previously sent it. > > You need to flush this data out of the encoder so that you can process it > like the rest of the encoded data by repeating calls to > avcodec_encode_audio2 with NULL as the frame parameter to tell the codec to > release a single buffered frame. That's important -- this isn't a single > call, it may be several. Repeat the process until got_packet_ptr returns a > 0 value, indicating that no packet has been returned. Note that the > decoding_encoding.c example references a use case where all of the data is > known at the time of encoding -- in a streaming scenario, it will usually > be the input's attempt to close the stream which should trigger the > flushing of the codec. > > Note there are a number of unknowns still for me: > > - I do not know what codecs support CODEC_CAP_DELAY, or if there's > something significant which determines if a codec supports it, or if it is > entirely arbitrary. > - I do not know whether you can or what determines if you can change the > CODEC_CAP_DELAY value for an encoder from what it is set at after you > create the encoder. > - I do not know if a codec without CODEC_CAP_DELAY set can still buffer > frames, and if so, how it would be flushed. > > That's the best I've pieced together. I hope it helps. If not, I wish you > the best of success solving the problem. If I encounter anything which > might seem relevant, I'll post it. > > Cheers, > > Brad > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From wprice at cyphers.net Sat May 11 05:47:39 2013 From: wprice at cyphers.net (Will Price) Date: Fri, 10 May 2013 20:47:39 -0700 Subject: [Libav-user] Reference app with ffmpeg n1.2 libs that works on IOS ? Message-ID: The gas linked below from the mansr github fork did not resolve this error that occurs throughout the build process for ffmpeg for iOS: Unable to identify target architecture at /usr/bin/gas-preprocessor.pl line 82. AS libavcodec/arm/dsputil_arm.o [and hundreds more like that afterwards...] Yet, it sounds like Lars has gotten past that error somehow. I put the mansr version of gas into both /usr/bin and /usr/local/bin just to be safe, but no luck. I am sure that is the gas being used because if I introduce intentional bugs in that script everything fails immediately. It sure feels like a remaining bug in the gas script itself, but perhaps I'm missing something? The build completes even with those errors. The errors occur when building armv7 and armv7s architectures, but not i386. It feels like this gas may not understand armv7 vs armv7s? > 2013/4/5 Alexey Belkevich > > > > On Friday, April 5, 2013 at 4:26 PM, Lars Hammarstrand wrote: > > > > > Got some new errors with the new gas-preprocessor. Full log at: > > http://pastebin.com/wF4aZGis. Brief summary: > > > > > Version info - ffmpeg e820e3a (n1.2), gas-preprocessor > > f4a42dc077 (Oct 03, 2012) > > > > > 1. LD ffmpeg_g ld: warning: ARM function not 4-byte aligned: > > empty_row from libavcodec/libavcodec.a(jrevdct_arm.o) ld: > > warning: ARM function not 4-byte aligned: end_of_row_loop from > > libavcodec/libavcodec.a(jrevdct_arm.o) ld: warning: ARM > > function not 4-byte aligned: start_column_loop from > > libavcodec/libavcodec.a(jrevdct_arm.o) ld: warning: ARM > > function not 4-byte aligned: column_loop from > > libavcodec/libavcodec.a(jrevdct_arm.o) ld: warning: ARM > > function not 4-byte aligned: empty_odd_column from > > libavcodec/libavcodec.a(jrevdct_arm.o) ld: warning: ARM > > function not 4-byte aligned: the_end from > > libavcodec/libavcodec.a(jrevdct_arm.o) ld: warning: ARM > > function not 4-byte aligned: __b_evaluation from > > libavcodec/libavcodec.a(simple_idct_arm.o) ld: warning: ARM > > function not 4-byte aligned: __end_b_evaluation from > > libavcodec/libavcodec.a(simple_idct_arm.o) ld: warning: ARM > > function not 4-byte aligned: __a_evaluation from > > libavcodec/libavcodec.a(simple_idct_arm.o) ld: warning: ARM > > function not 4-byte aligned: __almost_empty_row from > > libavcodec/libavcodec.a(simple_idct_arm.o) ld: warning: ARM > > function not 4-byte aligned: __end_row_loop from > > libavcodec/libavcodec.a(simple_idct_arm.o) ld: warning: ARM > > function not 4-byte aligned: __end_b_evaluation2 from > > libavcodec/libavcodec.a(simple_idct_arm.o) ld: warning: ARM > > function not 4-byte aligned: __a_evaluation2 from > > libavcodec/libavcodec.a(simple_idct_arm.o) ld: warning: ARM > > function not 4-byte aligned: __end_simple_idct_arm from > > libavcodec/libavcodec.a(simple_idct_arm.o) ld: in > > libavcodec/libavcodec.a(h264qpel_neon.o), in section > > __TEXT,__text reloc 12: R_ABS reloc but no absolute symbol at > > target address for architecture armv7 collect2: ld returned 1 > > exit status make: *** [ffmpeg_g] Error 1 > > > > > Try updated gas-preprocessor - > > https://github.com/mansr/gas-preprocessor.git It should fix > > error with "R_ABS reloc" > > > > Success!! Finally is the last piece of the root cause identified > and solved :D *Big Smile*. I'm pretty sure this will solve the > xbmc problem as well but let me come back with a final > confirmation later on. Found also this link regarding the same > error: > http://ffmpeg.org/pipermail/ffmpeg-user/2012-December/012307.html > . May I suggest one of the following changes regarding the > gas-processor.pl: 1) Distribute a prepackaged version of > gas-processor.pl that works, together with ffmpeg. 2) At the very > least, update the docs (docs/platform.texi) regarding the > gas-processor.p referense to > "https://github.com/mansr/gas-preprocessor" and also add some > controls to "Configure" that verifies that the correct version of > gas-processor.pl is used. Personally, I would prefer point nr 1. > And finally, many Big Thanks to all who helped and assisted with > this problem, especially to Carl that came up with a lot of > different ideas and managed to find the right track > (gas-processor.pl) and to Alexey that found a solution to the > last error. /Regards, Lars. -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sat May 11 08:46:43 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sat, 11 May 2013 06:46:43 +0000 (UTC) Subject: [Libav-user] Reference app with ffmpeg n1.2 libs that works on IOS ? References: Message-ID: Will Price writes: > The gas linked below [...] Allow me to repeat: The only supported version of gas-preprocessor.pl is the one mentioned on http://ffmpeg.org/platform.html You are on your own with any other version. If you have a compilation problem, please provide the following information: Your configure line, (your FFmpeg version,) if (and only if) compilation fails completely: Run make several times, always see the same error, run "make V=1" and post the console output for that last run (do not post the complete make output from an earlier run). If compilation does succeed, but you are unhappy with the output of make, I suggest you run "make V=1 ffmpeg.o" and post the output here. Carl Eugen From mike at mikeversteeg.com Sat May 11 17:14:38 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Sat, 11 May 2013 17:14:38 +0200 Subject: [Libav-user] flv/h264/rtmp live video streaming Message-ID: Is x264 capable of live video streaming, i.e. constant bitrate? I'm asking because I cannot get any acceptable quality from it when using bitrates < 1 Mbps, not even for static images. Only if I set qcompress to a very low value does the quality improve, but it also seems to skyrocket the bitrate considering the buffering I see in the downstream. Mike From mrfun.china at gmail.com Sun May 12 07:46:43 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Sun, 12 May 2013 15:46:43 +1000 Subject: [Libav-user] Hwo to use libtheora and libvorbis programatically Message-ID: Hi friends, I'v successfully built Ffmpeg with --enable-libtheora --enable-libvorbis, I know in command line mode, we can specify -vcode libtheora -acodec libvorbis to use these codecs. But when I'm using Ffmpeg interface in my application, how can I specify the codecs I want to use? Say, if I want to use theora encoder provided by libtheora , I just need to open corresponding codecid? how about vorbis then? Because Ffmpeg has native codec support fot vorbis, if I just pass in the codec id, which codec (native or libvorbis) will be used? Great thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Sun May 12 10:12:17 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 12 May 2013 08:12:17 +0000 (UTC) Subject: [Libav-user] Hwo to use libtheora and libvorbis programatically References: Message-ID: YIRAN LI writes: > But when I'm using Ffmpeg interface in my application, > how can I specify the codecs I want to use? Did you look at avcodec_find_encoder_by_name()? Carl Eugen From kalileo at universalx.net Sun May 12 14:16:29 2013 From: kalileo at universalx.net (Kalileo) Date: Sun, 12 May 2013 19:16:29 +0700 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: Message-ID: On May 10, 2013, at 14:12 , Bjoern Drabeck wrote: >> > I just tested some more, it seems to make no real difference whether I > set probesize/analyzeduration to 5000000 or 5000, both take more or > less the same time (on the test file I was using today it was around > 10 sec).. if I go much lower than 5000 at some point I start > encountering "-22" errors > > This is also what I noticed, when playing with probesize and analyzeduration trying to get the player to start more quickly (using mpegts (h264/aac) streams served through a memory buffer). This leads to the question why does a known stream need to get probed / analyzed at all? If all values are known, they could be set before, and decoding / playing should start right away, skipping the step of av_find_stream_info. Unfortunately so far I did not manage to get this to work, av_find_stream_info seems to set something which is required for decoding to work. I looked though the av_find_stream_info source code and did not find anything special happening there, or I did not recognize it. So, to reduce latency, what has to be set for a codec / context to allow to skip the time-consuming step of av_find_stream_info? From cehoyos at ag.or.at Sun May 12 17:43:46 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Sun, 12 May 2013 15:43:46 +0000 (UTC) Subject: [Libav-user] Reducing latency of file opening (when playing from http) References: Message-ID: Kalileo writes: > This is also what I noticed, when playing with > probesize and analyzeduration trying to get the > player to start more quickly (using mpegts > (h264/aac) streams served through a memory buffer). Since I did not really understand the paragraph I cut: Do you mean that although you used -probesize and -analyzeduration, the time to probe a file did not change? If yes, this sounds like a serious bug that should be investigated. (Needs command line, console output etc.) > This leads to the question why does a known stream (What is a "known" stream?) > need to get probed / analyzed at all? I may miss something but I wonder how you want to demux a transport stream without some probing / there are many tickets from people who miss their subtitle streams when opening their file... Additionally, user streams without PAT and/or PMT are not unusual (there used to be a bug in *zap for many years), so careful probing in transport streams is particularly important afaict. Carl Eugen From nfxjfg at googlemail.com Sun May 12 18:36:49 2013 From: nfxjfg at googlemail.com (wm4) Date: Sun, 12 May 2013 18:36:49 +0200 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: Message-ID: <20130512183649.20b6f30f@debian> On Sun, 12 May 2013 15:43:46 +0000 (UTC) Carl Eugen Hoyos wrote: > I may miss something but I wonder how you want to > demux a transport stream without some probing / > there are many tickets from people who miss their > subtitle streams when opening their file... > > Additionally, user streams without PAT and/or PMT > are not unusual (there used to be a bug in *zap > for many years), so careful probing in transport > streams is particularly important afaict. So why is this sort of extensive probing not only done for transport streams and similar "fuzzy" formats? Or are users expected to implement format-specific hacks working around libavformat default behavior in order to get reasonable overall behavior? Maybe some sort of option to hint optimizating behavior for streaming (as opposed to files on disk) would be useful? And why is the "max_analyze_duration 5000000 reached" warning a warning? It should be lower priority. From kalileo at universalx.net Sun May 12 22:17:45 2013 From: kalileo at universalx.net (Kalileo) Date: Mon, 13 May 2013 03:17:45 +0700 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: Message-ID: <1656E463-BB2E-480D-80C7-5D89A2D327A5@universalx.net> On May 12, 2013, at 22:43 , Carl Eugen Hoyos wrote: > Kalileo writes: > >> This is also what I noticed, when playing with >> probesize and analyzeduration trying to get the >> player to start more quickly (using mpegts >> (h264/aac) streams served through a memory buffer). > > Since I did not really understand the paragraph I cut: > Do you mean that although you used -probesize and > -analyzeduration, the time to probe a file did not > change? That was my impression, yes. > If yes, this sounds like a serious bug that should be > investigated. > (Needs command line, console output etc.) I'm not talking about ffmpeg command line, but about using the ffmpeg libraries in own code. > >> This leads to the question why does a known stream > > (What is a "known" stream?) That is a stream from which I know exactly all parameters, codecs, container, all details. Which means I should be able to set these details, instead of probing them. > >> need to get probed / analyzed at all? > > I may miss something but I wonder how you want to > demux a transport stream without some probing / > there are many tickets from people who miss their > subtitle streams when opening their file? Sure, however if it is a stream which I created, encoded, then I should not need to probe, I know already how I encoded it. > > Additionally, user streams without PAT and/or PMT > are not unusual (there used to be a bug in *zap > for many years), so careful probing in transport > streams is particularly important afaict. Yes, understood. The streams I'm using do have PAT/PMT, and the first chunk of the stream which I feed to the player always starts with PAT/PMT, and the first video frame after that is a key frame. Therefore I think it should be possible to manually set all what avformat_find_stream_info is setting, and to skip feeding the stream to avformat_find_stream_info. In my case the input is mpegts in chunks starting with PAT/PMT, which I encode myself, so I know all encoding details. The steps are: avio_alloc_context() av_find_input_format() avformat_alloc_context() avformat_open_input() avformat_find_stream_info() <== this should be not needed if I set all required codec params. and then for video and again for audio: avcodec_find_decoder() avcodec_open2() However if I don't run avformat_find_stream_info() it sometimes works and sometimes not. Obviously I miss something what avformat_find_stream_info() is doing. Just to avoid any misunderstanding, it all works fine, and now I try to optimize it, to speed it up, and to avoid the delay caused by avformat_find_stream_info() by removing the requirement to run it. From mrfun.china at gmail.com Mon May 13 08:49:07 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Mon, 13 May 2013 16:49:07 +1000 Subject: [Libav-user] How to add webm demuxer support into ffmpeg? Message-ID: Hi All, Could anyone kindly tell me how to add muxer support in ffmpeg (since there's only demuxer natively supported in ffmpeg). Thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.Roeber at hella.com Mon May 13 12:37:34 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Mon, 13 May 2013 03:37:34 -0700 (PDT) Subject: [Libav-user] Making a static lib with -MD option Message-ID: <1368441454747-4657578.post@n4.nabble.com> In Windows it is quite common to have a static library which itself depends on dynamic runtime libraries. For this purpose I configure ffmpeg to be built with -MD option. In this case I get many linker error of avpriv_sprintf or avpriv_strtod. libavformat.lib(gopher.o) : error LNK2001: unresolved external symbol __imp__avpriv_snprintf libavutil.lib(eval.o) : error LNK2001: unresolved external symbol __imp__avpriv_strtod Did anybody do something like this? -- View this message in context: http://libav-users.943685.n4.nabble.com/Making-a-static-lib-with-MD-option-tp4657578.html Sent from the libav-users mailing list archive at Nabble.com. From h.leppkes at gmail.com Mon May 13 14:38:59 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Mon, 13 May 2013 14:38:59 +0200 Subject: [Libav-user] Making a static lib with -MD option In-Reply-To: <1368441454747-4657578.post@n4.nabble.com> References: <1368441454747-4657578.post@n4.nabble.com> Message-ID: On Mon, May 13, 2013 at 12:37 PM, Steffen wrote: > In Windows it is quite common to have a static library which itself depends > on dynamic runtime libraries. > For this purpose I configure ffmpeg to be built with -MD option. > In this case I get many linker error of avpriv_sprintf or avpriv_strtod. > libavformat.lib(gopher.o) : error LNK2001: unresolved external symbol > __imp__avpriv_snprintf > libavutil.lib(eval.o) : error LNK2001: unresolved external symbol > __imp__avpriv_strtod > > Did anybody do something like this? > > > This should be fixed in latest git head, please try again with an up to date version. From radu.robotin at gmail.com Mon May 13 18:48:32 2013 From: radu.robotin at gmail.com (Radu Robotin) Date: Mon, 13 May 2013 19:48:32 +0300 Subject: [Libav-user] av_buffersink_get_frame() crashes In-Reply-To: References: <20130503103620.GD28705@phare.normalesup.org> Message-ID: Here is a little update: I haven't found the problem yet :) To summaries the issue: I'm trying to migrate from ffmpeg 1.2 to the latest build. With version 1.2 everything is working. I am decoding and filtering several streams, each stream is processed in it's own thread, a frame is taken and decoded, inserted in a filtergraph for filtering, pulled out the filtered frame and inserted into a local buffer. This process loops as long as the input stream is valid. The issue is, with the new API I have av_buffersink_get_frame() that I'd like to use to get the filtered frame out of buffersink. At the first run of this decode-filter loop, everything works fine, but at the second pass (i.e. for the second frame) it crashes - most of the time is segfault, sometimes I get a glibc message detecting a corrupted double linked list. Gdb points me inside of av_buffersink_get_frame() where some pointers are zero when trying to read a fifo buffer. The strangest thing is that under valgrind everything works fine. Tested several times, under valgrind it just works. What am I missing here? Why is it working under valgrind and crashes during normal running? I really need help with this one!! Thank you guys, for any suggestions and help! Best, Radu On Fri, May 3, 2013 at 5:38 PM, Radu Robotin wrote: > Here is the some parts of the code that's causing trouble: the > ffmpegFetchDecodeResampleNext() is called for fetching a frame form a > stream, decoding and then filtering and putting the filtered frame in an > internal buffer - then the process repeats. Before any call to > ffmpegFetchDecodeResampleNext, the codec and the context for decoding are > initialized, as well as the filtergraph. > > The first call to ffmpegFetchDecodeResampleNext() works as expected,. the > second one fails (with coredump) when trying to get the filtered frame from > the filtergraph. > > What has changed in the way filterghraph is handled? I had no issues > working with version 1.2. Can you please help me and tell me what I'm doing > wrong? > > > Thanks a lot! > > refbuf_t * ffmpegFetchDecodeResampleNext(myFFmpegContext * ff, source_t > *source){ > refbuf_t * retRefBuff = NULL; > AVPacket pPacket; > AVFrame *frame = av_frame_alloc(); > AVFrame *filt_frame = av_frame_alloc(); > AVFrame *enc_frame = av_frame_alloc(); > > if (!frame || !filt_frame || !enc_frame) { > ERROR0("Could not allocate frame(s)"); > return NULL; > } > int ret; > int localbuffering = 1; > while(global.running == ICE_RUNNING && source->running && > localbuffering) > { > ff->timeout = time(NULL); > ret= av_read_frame(ff->pInputFormatCtx, &pPacket); > if(ret == AVERROR(EAGAIN)){ > WARN1("av_read_frame error EAGAIN, error reading frame, > continuing %s",ff->localMount); > av_free_packet(&pPacket); > continue; > } > if(ret == EOF){ > source->running = 0; > ERROR1("av_read_frame error, EOF, exiting %s",ff->localMount); > av_free_packet(&pPacket); > break; > } > if (ret < 0) { > WARN1("av_read_frame error, error reading frame, breaking > %s",ff->localMount); > av_free_packet(&pPacket); > ff->failedReads++; > if(ff->failedReads >= 10) > source->running = 0; > return NULL; > } > > ff->failedReads = 0; > > time_t current = time (NULL); > source->last_read = current; > int got_frame = 0; > avcodec_get_frame_defaults(frame); > ret = avcodec_decode_audio4(ff->pInputCodecCtx, frame, &got_frame, > &pPacket); > > if(ret < 0 ){ > WARN1("avcodec_decode_audio3 unable to decode %s",ff->localMount); > ff->failedDecodes++; > if(ff->failedDecodes >= 500){ > source->running = 0; > ERROR1("avcodec_decode_audio3 unable to decode %s error limit reached, > closing stream",ff->localMount); > av_free_packet(&pPacket); > return NULL; > } > } > > else if(got_frame == 0){ > thread_sleep (delay*1000); > } > > else{ > > ff->failedDecodes = 0; > int resample_changed = ff->resample_sample_fmt != > ff->pInputCodecCtx->sample_fmt || ff->resample_channels != > ff->pInputCodecCtx->channels || ff->resample_sample_rate != > ff->pInputCodecCtx->sample_rate; > if (resample_changed) { > if (resample_changed) { > ff->resample_sample_fmt = ff->pInputCodecCtx->sample_fmt; > ff->resample_channels = ff->pInputCodecCtx->channels; > ff->resample_sample_rate = ff->pInputCodecCtx->sample_rate; > } > /*RESAMPLING parameters */ > INFO3("resampling context ch:%d spl:%d %s",ff->pInputCodecCtx->channels, > ff->pInputCodecCtx->sample_rate, ff->localMount); > INFO2("volume for %s :%d",ff->localMount, ff->volume); > if ((ret = init_filters(ff,source)) < 0) { > ERROR1( "Error while init_filters %s",ff->localMount); > av_free_packet(&pPacket); > source->running = 0; > return NULL; > } > > > } > > //feed the filter graph with the new frame > > if (av_buffersrc_add_frame_flags(ff->buffersrc_ctx, frame,0) > < 0) { > ERROR1( "Error while feeding the audio filtergraph %s",ff->localMount); > } > > /* pull filtered audio from the filtergraph */ > while (1) { > > // This is where the crash happens - initially it was something like: > // AVFilterBufferRef *samplesref; // ret = > av_buffersink_get_buffer_ref(ff->buffersink_ctx, &samplesref, 0); > // > > ret = av_buffersink_get_frame(ff->buffersink_ctx, > filt_frame); > > // At the second call of this function, we don't get to this point, as it > crashes when trying to extract the frame from the filtergraph > > if(ret == AVERROR(EAGAIN) || ret == AVERROR_EOF) > break; > if(ret < 0) > WARN1("error av_buffersink_get_frame, %s",ff->localMount); > if (ret>=0) { > //print_samplesref(samplesref); > char * resampleBuff = (char *)filt_frame->data[0]; > size_out = filt_frame->nb_samples * > av_get_channel_layout_nb_channels(av_frame_get_channel_layout(filt_frame)); > > //process the frame and put it in a circular buffer to > be returned at exit > ................................................ > > av_frame_unref(filt_frame); > av_frame_unref(frame); > } > > } > av_frame_unref(filt_frame); > av_frame_unref(frame); > if(ret < 0) { > av_free_packet(&pPacket); > break; > } > } > av_free_packet(&pPacket); > } > av_frame_free(&filt_frame); > av_frame_free(&frame); > av_frame_free(&enc_frame); > > return nextPreBuffer(source); > } > > > the decoder and the filtergraph are initialized prior calling this > function. Here is a snippet with the function used for filter_init. It's > pretty much standard as in the example file > > > static int init_filters(myFFmpegContext * ff, source_t *source) > { > AVFormatContext *fmt_ctx = ff->pInputFormatCtx; > AVCodecContext *dec_ctx = ff->pInputCodecCtx; > int audio_stream_index = ff->audioStreamIndex; > > char args[512]; > int ret; > char *pcTemp_string1, *pcTemp_string2; > char buffer[10]; > > AVFilter *abuffersrc = avfilter_get_by_name("abuffer"); > AVFilter *abuffersink = avfilter_get_by_name("abuffersink"); > AVFilterInOut *outputs = avfilter_inout_alloc(); > AVFilterInOut *inputs = avfilter_inout_alloc(); > const enum AVSampleFormat sample_fmts[] = { AV_SAMPLE_FMT_S16, > AV_SAMPLE_FMT_NONE }; > AVABufferSinkParams *abuffersink_params; > > > const AVFilterLink *outlink; > AVRational time_base = fmt_ctx->streams[audio_stream_index]->time_base; > > if(ff->filter_graph) > avfilter_graph_free(&ff->filter_graph); > ff->filter_graph = avfilter_graph_alloc(); > > /* buffer audio source: the decoded frames from the decoder will be > inserted here. */ > if (!dec_ctx->channel_layout) > dec_ctx->channel_layout = > av_get_default_channel_layout(dec_ctx->channels); > snprintf(args, sizeof(args), > "time_base=%d/%d:sample_rate=%d:sample_fmt=%s:channel_layout=0x%"PRIx64, > time_base.num, time_base.den, dec_ctx->sample_rate, > av_get_sample_fmt_name(dec_ctx->sample_fmt), dec_ctx->channel_layout); > ret = avfilter_graph_create_filter(&ff->buffersrc_ctx, abuffersrc, > "in", args, NULL, ff->filter_graph); > if (ret < 0) { > av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer source\n"); > return ret; > } > > /* buffer audio sink: to terminate the filter chain. */ > //abuffersink_params = av_abuffersink_params_alloc(); > //abuffersink_params->sample_fmts = sample_fmts; > ret = avfilter_graph_create_filter(&ff->buffersink_ctx, abuffersink, > "out", NULL, NULL, ff->filter_graph); > //av_free(abuffersink_params); > if (ret < 0) { > av_log(NULL, AV_LOG_ERROR, "Cannot create audio buffer sink\n"); > return ret; > } > > > > /* Endpoints for the filter graph. */ > outputs->name = av_strdup("in"); > outputs->filter_ctx = ff->buffersrc_ctx; > outputs->pad_idx = 0; > outputs->next = NULL; > > inputs->name = av_strdup("out"); > inputs->filter_ctx = ff->buffersink_ctx; > inputs->pad_idx = 0; > inputs->next = NULL; > > char *filter_descr = default_filter_descr; > > snprintf(args,sizeof(args), "%s,volume=%.2f",filter_descr , volume); > INFO1("Filter string: %s",filter_descr); > > if ((ret = avfilter_graph_parse(ff->filter_graph, args, &inputs, > &outputs, NULL)) < 0) > return ret; > > if ((ret = avfilter_graph_config(ff->filter_graph, NULL)) < 0) > return ret; > > av_log(NULL, AV_LOG_INFO, "%s\n", args); > /* Print summary of the sink buffer > * Note: args buffer is reused to store channel layout string */ > outlink = ff->buffersink_ctx->inputs[0]; > av_get_channel_layout_string(args, sizeof(args), -1, > outlink->channel_layout); > av_log(NULL, AV_LOG_INFO, "Output: srate:%dHz fmt:%s chlayout:%s\n", > (int)outlink->sample_rate, (char > *)av_x_if_null(av_get_sample_fmt_name((AVSampleFormat)outlink->format), > "?"), args); > > return 0; > } > > > > On Fri, May 3, 2013 at 1:36 PM, Nicolas George < > nicolas.george at normalesup.org> wrote: > >> Le tridi 13 flor?al, an CCXXI, Radu Robotin a ?crit : >> > I'm using ffmpeg with libavcodec and libavfilters for a custom project. >> > I've recently upgraded to the latest version available from git and >> noticed >> > that my previous code has stopped working. I'm processing several >> streams, >> > each in his own thread in the following way: >> > >> > next sample is taken from the stream, decoded and then inserted in >> the >> > buffer source of the filtergraph using av_buffersrc_add_frame() >> > a frame is extracted from the buffer sink of the filtergraph using >> > av_buffersink_get_frame() >> > the filtered frame is copied in a buffer for further processing >> > >> > before upgrading to the latest version of ffmpeg I've been using ffmpeg >> 1.2 >> > and everything worked flawlessly. The filtered buffer was pulled from >> the >> > filtergraph using the av_buffersink_get_buffer_ref(). >> >> The change from buffer ref to frames was accompanied with a change in the >> lifetime of the frames. What you describe looks like a problem with that, >> but without seeing the code it is impossible to tell for sure. >> >> > The problem I'm encountering: at the first pass everything works fine, >> > however when I call the processing function for the second time (for >> > processing the next frame), it coredumps when I call >> > av_buffersink_get_frame() with the message " corrupted double-linked >> list ". >> > I tried further investigating the problem and have several >> > frames processed during the same call of this function: everything works >> > until the second call, then it coredumps at the same point. >> >> The "corrupted double-linked list" message seems to indicate corrupted >> memory: either you write to an invalid location, or you write to a >> location >> that was previously freed, but you do not get the error immediately. I >> suggest you use valgrind to get an error at the exact time of the problem. >> >> > To me it seems that something changes the structure of the filtergraph >> > between the calls to the processing function. >> >> I am rather sure that the structure of the filter graph is not supposed to >> change after it has been configured. >> >> Regards, >> >> -- >> Nicolas George >> >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.12 (GNU/Linux) >> >> iEYEARECAAYFAlGDkyQACgkQsGPZlzblTJO/swCgkvXLQfnrP65ERswa1evJZSlp >> jBgAoKLHeBMgtGqB9oAsjmpKL0eDVv5G >> =0vJ2 >> -----END PGP SIGNATURE----- >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From martinber764 at yahoo.com Mon May 13 19:50:34 2013 From: martinber764 at yahoo.com (Martin Ber) Date: Mon, 13 May 2013 10:50:34 -0700 (PDT) Subject: [Libav-user] encoding ProRES - not sure how to configure some settings Message-ID: <1368467434.1938.YahooMailNeo@web142502.mail.bf1.yahoo.com> I have modified decoding_encoding.c sample code to create a ProRES stream, which I can verify is working properly by decoding the output file with ffmpeg.? However encoding is fairly slow and there are some settings that I don't know how to configure. There are 3 different ProRES encoders and I'm using prores_kostya encoder. According to this link: http://codecs.multimedia.cx/?p=388 to speed up encoding I should set qscale (recommended value of 4).? The other important settings are profile, quant_mat, bits_per_mb, mbs_per_slice and vendor.? I don't see where any of those can be configured with the structures I have access to (AVCodecContext, AVCodec).? Are these to be set on the 'private data' like in that example for H.264 in encoding_decoding.c: ?av_opt_set(c->priv_data, "preset", "slow", 0); -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon May 13 23:35:53 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 13 May 2013 21:35:53 +0000 (UTC) Subject: [Libav-user] encoding ProRES - not sure how to configure some settings References: <1368467434.1938.YahooMailNeo@web142502.mail.bf1.yahoo.com> Message-ID: Martin Ber writes: > However encoding is fairly slow and there are some > settings that I don't know how to configure.There are > 3 different ProRES encoders and I'm using > prores_kostya encoder. There are two encoders, the other one ("prores", "prores_aw", the first is an alias) is faster. Carl Eugen From martinber764 at yahoo.com Tue May 14 02:24:43 2013 From: martinber764 at yahoo.com (Martin Ber) Date: Mon, 13 May 2013 17:24:43 -0700 (PDT) Subject: [Libav-user] encoding ProRES - not sure how to configure some settings In-Reply-To: References: <1368467434.1938.YahooMailNeo@web142502.mail.bf1.yahoo.com> Message-ID: <1368491083.67531.YahooMailNeo@web142506.mail.bf1.yahoo.com> Thank you, I tested the other encoder and it is indeed quite a bit faster. Any other pros/cons of the other one vs the kostya encoder? ________________________________ From: Carl Eugen Hoyos To: libav-user at ffmpeg.org Sent: Monday, May 13, 2013 2:35 PM Subject: Re: [Libav-user] encoding ProRES - not sure how to configure some settings Martin Ber writes: > However encoding is fairly slow and there are some > settings that I don't know how to configure.There are > 3 different ProRES encoders and I'm using > prores_kostya encoder. There are two encoders, the other one ("prores", "prores_aw", the first is an alias) is faster. Carl Eugen _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.Roeber at hella.com Tue May 14 07:38:31 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Mon, 13 May 2013 22:38:31 -0700 (PDT) Subject: [Libav-user] Making a static lib with -MD option In-Reply-To: References: <1368441454747-4657578.post@n4.nabble.com> Message-ID: <1368509911028-4657584.post@n4.nabble.com> i'm using FFmpeg 1.2 from March 15, 2013. Which files or changes were applied to remove this failure in git head? -- View this message in context: http://libav-users.943685.n4.nabble.com/Making-a-static-lib-with-MD-option-tp4657578p4657584.html Sent from the libav-users mailing list archive at Nabble.com. From cehoyos at ag.or.at Tue May 14 09:39:04 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 14 May 2013 07:39:04 +0000 (UTC) Subject: [Libav-user] Making a static lib with -MD option References: <1368441454747-4657578.post@n4.nabble.com> <1368509911028-4657584.post@n4.nabble.com> Message-ID: Steffen writes: > i'm using FFmpeg 1.2 from March 15, 2013. If you are not a distributor, please always use current git head. Carl Eugen From praks411 at gmail.com Tue May 14 11:23:27 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 14 May 2013 02:23:27 -0700 (PDT) Subject: [Libav-user] Seeking video using av_seek_frame() Message-ID: <1368523407507-4657586.post@n4.nabble.com> Hi, I'm currently writing a small program to copy a clip from video file. The input from user is start and end time of clip. I'm converting the start time to frame number and then I'm seeking both audio and video stream. Though video seek is passing but audio seek is failing. I'm trying to seek a video file using av_seek_frame(). The file contains both audio and video streams. I would like to know when I seek one of the streams what happens to other. For example if I seek video stream to a particular frame. Does audio stream also advances to that frame. or do I need to seek audio stream separately. Please share your thoughts. Thanks and Regards, Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Seeking-video-using-av-seek-frame-tp4657586.html Sent from the libav-users mailing list archive at Nabble.com. From praks411 at gmail.com Tue May 14 16:51:17 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 14 May 2013 07:51:17 -0700 (PDT) Subject: [Libav-user] Memory leak while opening encoders. Message-ID: <1368543076981-4657587.post@n4.nabble.com> Hi, I'm getting memory leaks in avcodec_find_encoder. Although I'm cleaning the resources properly still I'm not able to get rid of the leak. By successive commenting the code I found that memory leaks happen only after the call of avcodec_find_encoder(). I've tried my code with different video files and I found that memory leaks blocks are always same. Also if I open only audio or video then I get just one memory leaks block. Below is the part of Init and Clean-up code from the application. AVFormatContext *m_informat; AVFormatContext *m_outformat; AVStream *m_in_vid_strm, *m_out_vid_strm; AVStream *m_in_aud_strm, *m_out_aud_strm; int VideoClipper::Init(const wxString& filename) { int ret = 0; char errbuf[64]; av_register_all(); if ((ret = avformat_open_input( &m_informat, filename.mb_str(), 0, 0)) != 0 ) { av_strerror(ret,errbuf,sizeof(errbuf)); PRINT_VAL("Not able to Open file;; ", errbuf) ret = -1; return ret; } else { PRINT_MSG("Opened File ") } if ((ret = avformat_find_stream_info(m_informat, 0))< 0 ) { av_strerror(ret,errbuf,sizeof(errbuf)); PRINT_VAL("Not Able to find stream info:: ", errbuf) ret = -1; return ret; } else { PRINT_MSG("Got stream Info ") } for(unsigned int i = 0; inb_streams; i++) { if(m_informat->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { PRINT_MSG("Found Video Stream ") m_in_vid_strm_idx = i; m_in_vid_strm = m_informat->streams[i]; } if(m_informat->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { PRINT_MSG("Found Audio Stream ") m_in_aud_strm_idx = i; m_in_aud_strm = m_informat->streams[i]; } } AVOutputFormat *outfmt = NULL; std::string outfile = std::string(filename) + "clip_out.avi"; outfmt = av_guess_format(NULL,outfile.c_str(),NULL); if(outfmt == NULL) { ret = -1; return ret; } else { m_outformat = avformat_alloc_context(); if(m_outformat) { m_outformat->oformat = outfmt; _snprintf(m_outformat->filename, sizeof(m_outformat->filename), "%s", outfile.c_str()); } else { ret = -1; return ret; } } AVCodec *out_vid_codec,*out_aud_codec; out_vid_codec = out_aud_codec = NULL; if(outfmt->video_codec != AV_CODEC_ID_NONE && m_in_vid_strm != NULL) { out_vid_codec = avcodec_find_encoder(outfmt->video_codec); if(NULL == out_vid_codec) { PRINT_MSG("Could Not Find Vid Encoder") ret = -1; return ret; } else { PRINT_MSG("Found Out Vid Encoder ") m_out_vid_strm = avformat_new_stream(m_outformat, out_vid_codec); if(NULL == m_out_vid_strm) { PRINT_MSG("Failed to Allocate Output Vid Strm ") ret = -1; return ret; } else { PRINT_MSG("Allocated Video Stream ") if(avcodec_copy_context(m_out_vid_strm->codec, m_informat->streams[m_in_vid_strm_idx]->codec) != 0) { PRINT_MSG("Failed to Copy Context ") ret = -1; return ret; } } } } if(outfmt->audio_codec != AV_CODEC_ID_NONE && m_in_aud_strm != NULL) { out_aud_codec = avcodec_find_encoder(outfmt->audio_codec); if(NULL == out_aud_codec) { PRINT_MSG("Could Not Find Out Aud Encoder ") ret = -1; return ret; } else { PRINT_MSG("Found Out Aud Encoder ") m_out_aud_strm = avformat_new_stream(m_outformat, out_aud_codec); if(NULL == m_out_aud_strm) { PRINT_MSG("Failed to Allocate Out Vid Strm ") ret = -1; return ret; } else { if(avcodec_copy_context(m_out_aud_strm->codec, m_informat->streams[m_in_aud_strm_idx]->codec) != 0) { PRINT_MSG("Failed to Copy Context ") ret = -1; return ret; } } } } if (!(outfmt->flags & AVFMT_NOFILE)) { if (avio_open2(&m_outformat->pb, outfile.c_str(), AVIO_FLAG_WRITE,NULL, NULL) < 0) { PRINT_VAL("Could Not Open File ", outfile) ret = -1; return ret; } } /* Write the stream header, if any. */ if (avformat_write_header(m_outformat, NULL) < 0) { PRINT_VAL("Error Occurred While Writing Header ", outfile) ret = -1; return ret; } else { PRINT_MSG("Written Output header ") m_init_done = true; } return ret; } void VideoClipper::ReleaseResource(void) { if(m_in_aud_strm && m_in_aud_strm->codec) { avcodec_close(m_in_aud_strm->codec); PRINT_MSG("Closed Input Audio Codec ") } if(m_in_vid_strm && m_in_vid_strm->codec) { avcodec_close(m_in_vid_strm->codec); PRINT_MSG("Closed Input Video Codec ") } if(m_informat) { avformat_close_input(&m_informat); PRINT_MSG("Freed Input Format Contex ") } if(m_out_aud_strm && m_out_aud_strm->codec) { avcodec_close(m_out_aud_strm->codec); PRINT_MSG("Closed Output Audio Codec ") } if(m_out_vid_strm && m_out_vid_strm->codec) { avcodec_close(m_out_vid_strm->codec); PRINT_MSG("Closed Output Audio Codec ") } if(m_outformat) { avformat_close_input(&m_outformat); m_outformat = NULL; PRINT_MSG("Closed Output Format ") } } /***************Detect Leaks**********************/ Detected memory leaks! Dumping objects -> {13691} normal block at 0x01046A60, 4479 bytes long. Data: < > CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD CD {13685} normal block at 0x01043FD0, 10831 bytes long. Data: < ? > CD CD CD CD CD CD CD CD D0 3F 04 01 ED ED ED ED Object dump complete. I'm using latest version of ffmpeg on Visual Studio 2012. Please suggest. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Memory-leak-while-opening-encoders-tp4657587.html Sent from the libav-users mailing list archive at Nabble.com. From bjoern.drabeck at gmail.com Wed May 15 04:36:58 2013 From: bjoern.drabeck at gmail.com (Bjoern Drabeck) Date: Wed, 15 May 2013 10:36:58 +0800 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: Message-ID: > > This is also what I noticed, when playing with probesize and analyzeduration trying to get the player to start more quickly (using mpegts (h264/aac) streams served through a memory buffer). > > This leads to the question why does a known stream need to get probed / analyzed at all? If all values are known, they could be set before, and decoding / playing should start right away, skipping the step of av_find_stream_info. Unfortunately so far I did not manage to get this to work, av_find_stream_info seems to set something which is required for decoding to work. > > I looked though the av_find_stream_info source code and did not find anything special happening there, or I did not recognize it. > > So, to reduce latency, what has to be set for a codec / context to allow to skip the time-consuming step of av_find_stream_info? Just one thing I wanted to mention: When I am opening a file I call avformat_open_input, then after that I call avformat_find_stream_info, and I am timing those calls: 'avformat_open_input': 9.7970 seconds 'avformat_find_stream_info': 0.1080 seconds So for me the problem seems to be avformat_open_input. My testfiles are all around that range, maybe +-2 sec As I mentioned before, changine probesize/analyzeduration from 5000000 to 5000 doesn't seem show any visible effect (just ranging within the usual fluctuations of the above timings) Is that what you experienced too? -Bjoern From kalileo at universalx.net Wed May 15 05:20:03 2013 From: kalileo at universalx.net (Kalileo) Date: Wed, 15 May 2013 10:20:03 +0700 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: Message-ID: <61F841FD-5D07-4510-B06C-7FE9BF3D27EA@universalx.net> On May 15, 2013, at 09:36 , Bjoern Drabeck wrote: >> >> This is also what I noticed, when playing with probesize and analyzeduration trying to get the player to start more quickly (using mpegts (h264/aac) streams served through a memory buffer). >> >> This leads to the question why does a known stream need to get probed / analyzed at all? If all values are known, they could be set before, and decoding / playing should start right away, skipping the step of av_find_stream_info. Unfortunately so far I did not manage to get this to work, av_find_stream_info seems to set something which is required for decoding to work. >> >> I looked though the av_find_stream_info source code and did not find anything special happening there, or I did not recognize it. >> >> So, to reduce latency, what has to be set for a codec / context to allow to skip the time-consuming step of av_find_stream_info? > > > Just one thing I wanted to mention: > > When I am opening a file I call avformat_open_input, then after that I > call avformat_find_stream_info, and I am timing those calls: > > 'avformat_open_input': 9.7970 seconds > 'avformat_find_stream_info': 0.1080 seconds > > So for me the problem seems to be avformat_open_input. My testfiles > are all around that range, maybe +-2 sec You mentioned that you read the files using http urls, so isn't there the download time included in the values you measure for avformat_open_input? In my case I fill a memory buffer first and then feed that to the avformat functions. Nevertheless I will time these two functions again. I always assumed that the time is lost in avformat_find_stream_info and not in avformat_open_input, but may be my assumption was wrong. > > As I mentioned before, changine probesize/analyzeduration from 5000000 > to 5000 doesn't seem show any visible effect (just ranging within the > usual fluctuations of the above timings) > > Is that what you experienced too? if I reduce probesize/analyzeduration it does not get faster, but at some point it fails to recognize the streams. At 100000 it does fail most of the time (mpegts h264/aac). Which is why I would love to configure all possible settings which can be set before these functions are called. From mrfun.china at gmail.com Wed May 15 05:37:04 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 15 May 2013 13:37:04 +1000 Subject: [Libav-user] How to set video quality when opening encoder Message-ID: Hi friends, I'm trying to encode using libtheora, I'm able to using command line argument -q:v 0-10 to set video quality. But I had problem when setting it in my program. My code looks like below: AVDictionary* options = NULL; av_dict_set(&options, "qscale", "0", 0); // also tried "q:v" avcodec_open() but seems encoder can't understand the keys. Could anyone let me know how to set the video qscale in this case? Great thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From bjoern.drabeck at gmail.com Wed May 15 06:09:46 2013 From: bjoern.drabeck at gmail.com (Bjoern Drabeck) Date: Wed, 15 May 2013 12:09:46 +0800 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: <61F841FD-5D07-4510-B06C-7FE9BF3D27EA@universalx.net> References: <61F841FD-5D07-4510-B06C-7FE9BF3D27EA@universalx.net> Message-ID: >> >> When I am opening a file I call avformat_open_input, then after that I >> call avformat_find_stream_info, and I am timing those calls: >> >> 'avformat_open_input': 9.7970 seconds >> 'avformat_find_stream_info': 0.1080 seconds >> >> So for me the problem seems to be avformat_open_input. My testfiles >> are all around that range, maybe +-2 sec > > You mentioned that you read the files using http urls, so isn't there the download time included in the values you measure for avformat_open_input? > Yeah sure, it will have to get the data first, but I am wondering if that amount of data can be reduced, because 10 sec seems quite long to me for opening, but those probesize etc don't seem to make a difference. On the other hand, once I have opened, and I seek to a spot later in the file, it is so fast it is almost instant.. so that's why I wondered if the amount of data analyzed/download on initial opening can be reduced... > In my case I fill a memory buffer first and then feed that to the avformat functions. > > Nevertheless I will time these two functions again. I always assumed that the time is lost in avformat_find_stream_info and not in avformat_open_input, but may be my assumption was wrong. > yeah please let me know your findings, am curious to hear... >> >> As I mentioned before, changine probesize/analyzeduration from 5000000 >> to 5000 doesn't seem show any visible effect (just ranging within the >> usual fluctuations of the above timings) >> >> Is that what you experienced too? > > if I reduce probesize/analyzeduration it does not get faster, but at some point it fails to recognize the streams. At 100000 it does fail most of the time (mpegts h264/aac). > for me I can often go down as low as 5000 (or at least 10000) before it starts failing.. but the timing doesn't seem to change really... > Which is why I would love to configure all possible settings which can be set before these functions are called. > yeah me too... cheers, Bjoern From mrfun.china at gmail.com Wed May 15 06:53:00 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 15 May 2013 14:53:00 +1000 Subject: [Libav-user] Fwd: How to set video quality when opening encoder In-Reply-To: References: Message-ID: Hi, I've solved this problem by setting codecCtx->flags |= CODEC_FLAG_QSCALE; and set codecCtx->global_quality = 1180 to get the best quality! because in libtheoraenc.c line 215: t_info.quality = av_clip(avc_context->global_quality /(float)FF_QP2LAMBDA, 0, 10) * 6.3 and #define FF_QP2LAMBDA 118 so av_clip( 1180/118, 0, 10 ) * 6.3 = 63 get the best quality. Please correct me if I'm wrong, thanks! ---------- Forwarded message ---------- From: YIRAN LI Date: 2013/5/15 Subject: How to set video quality when opening encoder To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." Hi friends, I'm trying to encode using libtheora, I'm able to using command line argument -q:v 0-10 to set video quality. But I had problem when setting it in my program. My code looks like below: AVDictionary* options = NULL; av_dict_set(&options, "qscale", "0", 0); // also tried "q:v" avcodec_open() but seems encoder can't understand the keys. Could anyone let me know how to set the video qscale in this case? Great thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Wed May 15 09:06:05 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Wed, 15 May 2013 17:06:05 +1000 Subject: [Libav-user] How can ffmpeg link to static libraries? Message-ID: Hi all, I'm building ffmpeg in MinGW with --enable-share --disable-static (I want to generate Dlls). I also enabled libtheora, wihch is configured with --enable-static --enable-shared. (libtheora.a libtheora.dll.a & libtheora-0.dll generated) I built libtheora first and then ffmpeg, build succeeded. But when I run generated ffmpeg.exe it still requires libtheora.dll. So I'd like to know, if there's anyway to statically compile libtheora code into ffmpeg executables or dlls? Great thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From myladyyang at gmail.com Wed May 15 12:47:53 2013 From: myladyyang at gmail.com (Xian Yan Yang) Date: Wed, 15 May 2013 18:47:53 +0800 Subject: [Libav-user] quicktime doesn't play my mpeg4 video stream which encoded by libav Message-ID: Hi all: I've been stucked with this problem for quite a long time, and finally I decide to ask for help here. I encode my camera video to MPEG4 ES stream with libav. I could use VLC to play the video, but it doesn't work for quicktime or realplayer. There must be something wrong with my encoding code. see below: avcodec_register_all(); AVCodec *codec = NULL; codec = avcodec_find_encoder(CODEC_ID_MPEG4); if (!codec) { return false; } c = avcodec_alloc_context3(codec); if (NULL == c) { return false; } AVDictionary *d = NULL; c->codec_id = CODEC_ID_MPEG4; c->codec_type = AVMEDIA_TYPE_VIDEO; c->width = dwDstWidth; c->height = dwDstHeight; AVRational atemp = {1,dwFps__}; c->time_base = atemp; c->gop_size = 10; c->max_b_frames=1; c->pix_fmt = PIX_FMT_YUV420P; c->bit_rate = 400000; c->level = 1;//profile-level-id if (avcodec_open2(c, codec,&d) < 0) { avcodec_close(c); av_free(c); c = NULL; return false; } av_dict_free(&d); picture= avcodec_alloc_frame(); ... ---------------------------------------------------------------------------------- I wonder if my set of parameraters for encoding mpeg4 video is right? Or some special parameters are needed for quicktime? Thanks Br.Luffy -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed May 15 12:52:17 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 15 May 2013 10:52:17 +0000 (UTC) Subject: [Libav-user] quicktime doesn't play my mpeg4 video stream which encoded by libav References: Message-ID: Xian Yan Yang writes: > I encode my camera video to MPEG4 ES stream with libav. > I could use VLC to play the video, but it doesn't work > for quicktime or realplayer. Do you have an mpeg4 elementary stream that can be played with QuickTime or Realplayer? Carl Eugen From myladyyang at gmail.com Wed May 15 14:08:56 2013 From: myladyyang at gmail.com (Xian Yan Yang) Date: Wed, 15 May 2013 20:08:56 +0800 Subject: [Libav-user] quicktime doesn't play my mpeg4 video stream which encoded by libav In-Reply-To: References: Message-ID: Yes,there is a MPEG4 video stream example which could be played by quicktime. Acutally the example stream is going through RTSP/RTP. So I capture some package and use openRTSP(live555 test program) to get the mpeg4 video stream file. After comparing the stream file and the packages, there are some differences between the example stream and my stream. 1. The b frame is enable in example.(checked by ffprobe) 2. There is object_layer_identifier set as 1 in the first frame of my stream, but not in the example. That's why I doubt my encoding code, cause the output stream is different than example stream. Thanks Br.Luffy 2013/5/15 Carl Eugen Hoyos > Xian Yan Yang writes: > > > I encode my camera video to MPEG4 ES stream with libav. > > I could use VLC to play the video, but it doesn't work > > for quicktime or realplayer. > > Do you have an mpeg4 elementary stream that can be > played with QuickTime or Realplayer? > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Wed May 15 14:16:21 2013 From: kalileo at universalx.net (Kalileo) Date: Wed, 15 May 2013 19:16:21 +0700 Subject: [Libav-user] Reducing latency of file opening (when playing from http) In-Reply-To: References: <61F841FD-5D07-4510-B06C-7FE9BF3D27EA@universalx.net> Message-ID: <4CCB50B4-2D4B-48DB-AB7C-4674BF3331B5@universalx.net> On May 15, 2013, at 11:09 , Bjoern Drabeck wrote: >>> >>> When I am opening a file I call avformat_open_input, then after that I >>> call avformat_find_stream_info, and I am timing those calls: >>> >>> 'avformat_open_input': 9.7970 seconds >>> 'avformat_find_stream_info': 0.1080 seconds >>> >>> So for me the problem seems to be avformat_open_input. My testfiles >>> are all around that range, maybe +-2 sec >> >> You mentioned that you read the files using http urls, so isn't there the download time included in the values you measure for avformat_open_input? >> > Yeah sure, it will have to get the data first, but I am wondering if > that amount of data can be reduced, because 10 sec seems quite long to > me for opening, but those probesize etc don't seem to make a > difference. > > On the other hand, once I have opened, and I seek to a spot later in > the file, it is so fast it is almost instant.. so that's why I > wondered if the amount of data analyzed/download on initial opening > can be reduced? Based on the values I measure (see below) I think that you have this latency at avformat_open_input only because there you have the download time included. > >> In my case I fill a memory buffer first and then feed that to the avformat functions. >> >> Nevertheless I will time these two functions again. I always assumed that the time is lost in avformat_find_stream_info and not in avformat_open_input, but may be my assumption was wrong. >> > > yeah please let me know your findings, am curious to hear... > >>> >>> As I mentioned before, changine probesize/analyzeduration from 5000000 >>> to 5000 doesn't seem show any visible effect (just ranging within the >>> usual fluctuations of the above timings) >>> >>> Is that what you experienced too? >> >> if I reduce probesize/analyzeduration it does not get faster, but at some point it fails to recognize the streams. At 100000 it does fail most of the time (mpegts h264/aac). >> > > for me I can often go down as low as 5000 (or at least 10000) before > it starts failing.. but the timing doesn't seem to change really? timings change in avformat_find_stream_info only, but not in avformat_open_input (where for you the http downloads times are included). > >> Which is why I would love to configure all possible settings which can be set before these functions are called. >> > > yeah me too? Here the values I measured (in ms for mpegts /h264/aac read from memory buffer): Test 1: probesize 5000000 max_analyze_duration 5000000 avio_alloc_context time: 0 avformat_open_input time: 0 avformat_find_stream_info time: 30 openVideoCodecContext time: 0 openAudioCodecContext time: 1 Test 2: probesize 5000000 max_analyze_duration 5000000 avio_alloc_context time: 0 avformat_open_input time: 0 avformat_find_stream_info time: 43 openVideoCodecContext time: 1 openAudioCodecContext time: 0 Test 3: probesize 50000 max_analyze_duration 50000 avformat_find_stream_info time: 14 ms +/- 2 but sometimes the codecs are not recognized. Test 4: probesize 500000 max_analyze_duration 500000 avformat_find_stream_info time: 18 ms +/- 4 codecs are recognized Test 5: probesize 1000000 max_analyze_duration 1000000 avformat_find_stream_info time: 22 ms +/- 4 Conclusion: 1. avformat_open_input is always very fast, no time lost. 2. avformat_find_stream_info is taking time, but not that much. 3. avformat_find_stream_info can be made faster by reducing probesize / max_analyze_duration 4 avformat_find_stream_info can fail at low values (50000) despite the stream chunks starting with PAT/PMT and keyframe. Based on these values it seems to be not a question of latency but more of making sure that avformat_find_stream_info gets the correct values, by setting known values before running avformat_find_stream_info (which seems to not work for me). Latency is low enough for me now. From joe.flowers at nofreewill.com Wed May 15 17:19:27 2013 From: joe.flowers at nofreewill.com (Joe Flowers) Date: Wed, 15 May 2013 11:19:27 -0400 Subject: [Libav-user] Using the libav* libraries in a thread-safe manner? Message-ID: Hello Everyone, I need to use the libav* APIs (specifically the audio codecs) in a thread-safe way, but they seem to be full of malloc()s and free()s which aren't re-entrant. Does anyone know how to make (enable) the libav* APIs to be thread-safe? I can't use the command-line utilities provided. I need to make API calls within my C coding. Are there flags or initialization and de-allocation procedures I need to follow in my C code that calls the APIs? Thanks! Joe ------------- -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed May 15 17:37:47 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 15 May 2013 15:37:47 +0000 (UTC) Subject: [Libav-user] Using the libav* libraries in a thread-safe manner? References: Message-ID: Joe Flowers writes: > I need to use the libav* APIs (specifically the audio > codecs) in a thread-safe way, but they seem to be full > of malloc()s and free()s which aren't re-entrant. My malloc manual says that it uses mutexes "internally to protect the memory-management data structures employed by these functions" (alloc, free, etc.) to avoid corruption. Or do I miss something? Audio codecs generally don't use multi-threading and should therefore not require special treatment. Carl Eugen From h.leppkes at gmail.com Wed May 15 17:41:37 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Wed, 15 May 2013 17:41:37 +0200 Subject: [Libav-user] Using the libav* libraries in a thread-safe manner? In-Reply-To: References: Message-ID: On Wed, May 15, 2013 at 5:37 PM, Carl Eugen Hoyos wrote: > Joe Flowers writes: > >> I need to use the libav* APIs (specifically the audio >> codecs) in a thread-safe way, but they seem to be full >> of malloc()s and free()s which aren't re-entrant. > > My malloc manual says that it uses mutexes "internally to > protect the memory-management data structures employed by > these functions" (alloc, free, etc.) to avoid corruption. > Or do I miss something? > Using mutexes is not reentrant, however that has nothing to do with thread-safety. malloc is thread-safe, but not reentrant. That means you can use it just fine multi-threaded, however you could deadlock if you somehow cancel a thread thats inside a malloc right now (meaning the mutex is never unlocked) Canceling threads like that should generally be avoided, and at least the libav* libraries don't do it themself. From brado at bighillsoftware.com Wed May 15 17:43:20 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Wed, 15 May 2013 08:43:20 -0700 Subject: [Libav-user] Using the libav* libraries in a thread-safe manner? In-Reply-To: References: Message-ID: <3143A0BB-8D8E-47FE-88E1-87ADE459F74A@bighillsoftware.com> On May 15, 2013, at 8:19 AM, Joe Flowers wrote: > Does anyone know how to make (enable) the libav* APIs to be thread-safe? This may sound a little ridiculous, but in general with any third-party library, make a thread-safe wrapper around it. I would guess that your dilemma centers on wanting to reuse resources like codecs / contexts, output formats / contexts, to keep the memory footprint low. But for whatever its worth, in throwing my FFmpeg processing on Instruments (Xcode profiling tool) that footprint is likely going to be a blip on the radar compared to the resources used when processing each frame (not because these consume a lot of memory, but because this processing will be executed many times a second). So if the motivation for multithreading is to reuse resources, I wouldn't worry about that. If you truly need more than one object accessing the same processing resources, then put a wrapper around it that makes multiple threads play nice. Without knowing exactly what you are trying to do, can't say what is the best route, but that's my best guess. Brad From joe.flowers at nofreewill.com Wed May 15 18:02:04 2013 From: joe.flowers at nofreewill.com (Joe Flowers) Date: Wed, 15 May 2013 12:02:04 -0400 Subject: [Libav-user] Using the libav* libraries in a thread-safe manner? In-Reply-To: <3143A0BB-8D8E-47FE-88E1-87ADE459F74A@bighillsoftware.com> References: <3143A0BB-8D8E-47FE-88E1-87ADE459F74A@bighillsoftware.com> Message-ID: Hi Brad, Very interesting comments. I am worrying more about the speed hit of putting it in a wrapper. We're in a real-time audio processing situation. Your experience is most appreciated. On Wed, May 15, 2013 at 11:43 AM, Brad O'Hearne wrote: > On May 15, 2013, at 8:19 AM, Joe Flowers > wrote: > > > Does anyone know how to make (enable) the libav* APIs to be thread-safe? > > This may sound a little ridiculous, but in general with any third-party > library, make a thread-safe wrapper around it. I would guess that your > dilemma centers on wanting to reuse resources like codecs / contexts, > output formats / contexts, to keep the memory footprint low. But for > whatever its worth, in throwing my FFmpeg processing on Instruments (Xcode > profiling tool) that footprint is likely going to be a blip on the radar > compared to the resources used when processing each frame (not because > these consume a lot of memory, but because this processing will be executed > many times a second). > > So if the motivation for multithreading is to reuse resources, I wouldn't > worry about that. If you truly need more than one object accessing the same > processing resources, then put a wrapper around it that makes multiple > threads play nice. Without knowing exactly what you are trying to do, can't > say what is the best route, but that's my best guess. > > Brad > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From joe.flowers at nofreewill.com Wed May 15 18:13:22 2013 From: joe.flowers at nofreewill.com (Joe Flowers) Date: Wed, 15 May 2013 12:13:22 -0400 Subject: [Libav-user] Using the libav* libraries in a thread-safe manner? In-Reply-To: References: Message-ID: Carl and Hendrik, Thank you very much for your comments and expertise. You are right, I'm mixing up thread-safety and re-entrantcy. Sorry. With Hendrik's advice on not cancelling threads to prevent a deadlock or zombie-type threads, I'm now more concerned with thread-safeness. 1. I know when I configure and make FFMPEG, there is an "--enable-pthreads" option. If I am understanding things correctly, this particular option is not relevant to the thread safety of a C program calling the libav* APIs, correct? 2. I am using gcc on Ubuntu to compile and link to the libav* libraries and am wondering if I need to use a particular "-pthreads" option (or something else) with gcc to make sure I am using thread-safe C libraries to get a thread-safe malloc()? The reason I ask is because in Windoze one has to link with the mulithreaded C libraries (*MT.lib) to get a thread-safe version of malloc(). Thanks!!! Joe ------------------- On Wed, May 15, 2013 at 11:37 AM, Carl Eugen Hoyos wrote: > Joe Flowers writes: > > > I need to use the libav* APIs (specifically the audio > > codecs) in a thread-safe way, but they seem to be full > > of malloc()s and free()s which aren't re-entrant. > > My malloc manual says that it uses mutexes "internally to > protect the memory-management data structures employed by > these functions" (alloc, free, etc.) to avoid corruption. > Or do I miss something? > > Audio codecs generally don't use multi-threading and > should therefore not require special treatment. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From bruce at spearmorgan.com Wed May 15 18:19:39 2013 From: bruce at spearmorgan.com (Bruce Wheaton) Date: Wed, 15 May 2013 09:19:39 -0700 Subject: [Libav-user] Using the libav* libraries in a thread-safe manner? In-Reply-To: References: Message-ID: On May 15, 2013, at 9:13 AM, Joe Flowers wrote: > Carl and Hendrik, > > Thank you very much for your comments and expertise. > > You are right, I'm mixing up thread-safety and re-entrantcy. Sorry. > > With Hendrik's advice on not cancelling threads to prevent a deadlock or zombie-type threads, I'm now more concerned with thread-safeness. You're heading pretty far down a tangent with malloc etc. System calls won't be your problem. Assuming you're using pthreads (or the windows equivalent), the main thing you need to worry about is the few ffmpeg functions that aren't re-entrant, mainly codec opening, selection and closing. Each context you open is as thread-safe as you make it, and you definitely don't need to wrapper all ffmpeg calls. Look for the lock manager stuff, or put your own critical section around the non re-entrant functions. That's about it. On a modern OS, trying to second guess threading on the system libraries is a folly. Bruce > > 1. > I know when I configure and make FFMPEG, there is an "--enable-pthreads" option. If I am understanding things correctly, this particular option is not relevant to the thread safety of a C program calling the libav* APIs, correct? > > 2. > I am using gcc on Ubuntu to compile and link to the libav* libraries and am wondering if I need to use a particular "-pthreads" option (or something else) with gcc to make sure I am using thread-safe C libraries to get a thread-safe malloc()? The reason I ask is because in Windoze one has to link with the mulithreaded C libraries (*MT.lib) to get a thread-safe version of malloc(). > > Thanks!!! > > Joe > ------------------- > > > > > > > > > On Wed, May 15, 2013 at 11:37 AM, Carl Eugen Hoyos wrote: > Joe Flowers writes: > > > I need to use the libav* APIs (specifically the audio > > codecs) in a thread-safe way, but they seem to be full > > of malloc()s and free()s which aren't re-entrant. > > My malloc manual says that it uses mutexes "internally to > protect the memory-management data structures employed by > these functions" (alloc, free, etc.) to avoid corruption. > Or do I miss something? > > Audio codecs generally don't use multi-threading and > should therefore not require special treatment. > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Wed May 15 18:26:05 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Wed, 15 May 2013 19:26:05 +0300 Subject: [Libav-user] Using the libav* libraries in a thread-safe manner? In-Reply-To: References: Message-ID: On 15 May 2013 19:13, "Joe Flowers" wrote: > > Carl and Hendrik, > > Thank you very much for your comments and expertise. > > You are right, I'm mixing up thread-safety and re-entrantcy. Sorry. > > With Hendrik's advice on not cancelling threads to prevent a deadlock or zombie-type threads, I'm now more concerned with thread-safeness. > > 1. > I know when I configure and make FFMPEG, there is an "--enable-pthreads" option. If I am understanding things correctly, this particular option is not relevant to the thread safety of a C program calling the libav* APIs, correct? Some codecs allow multithreaded processing to speed things up (on multicore systems). That's where pthreads become relevant. > 2. > I am using gcc on Ubuntu to compile and link to the libav* libraries and am wondering if I need to use a particular "-pthreads" option (or something else) with gcc to make sure I am using thread-safe C libraries to get a thread-safe malloc()? In your toolchain, malloc is thread-safe. > The reason I ask is because in Windoze one has to link with the mulithreaded C libraries (*MT.lib) to get a thread-safe version of malloc(). Non-multithread RT libraries for Microsoft C compiler are long gone. BR Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From brado at bighillsoftware.com Wed May 15 18:38:07 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Wed, 15 May 2013 09:38:07 -0700 Subject: [Libav-user] Using the libav* libraries in a thread-safe manner? In-Reply-To: References: <3143A0BB-8D8E-47FE-88E1-87ADE459F74A@bighillsoftware.com> Message-ID: On May 15, 2013, at 9:02 AM, Joe Flowers wrote: > Hi Brad, > > Very interesting comments. I am worrying more about the speed hit of putting it in a wrapper. We're in a real-time audio processing situation. Your experience is most appreciated. "Real-time": there indeed is the rub. I have had to solve two real-time video / audio network streaming use-cases over the past year, one in particular where minimum latency was absolutely imperative (<= .5 sec). What I found was that repeated memory allocation during frame processing resulted in my biggest hit to latency. So eliminate that where possible. For example, in my recent audio capture-encode-streaming use case I have a scenario where it is theoretically possible for the sample format, sample rate, and number of samples per buffer to change midstream during processing. I haven't encountered that, but according to the capture API it is possible. Should that happen, it would require the source data buffer, destination data buffer, and resampling context to also be recreated. So I create once, then check every frame to see if anything has changed -- if it has, reallocate, otherwise, reuse. That was a performance tweak I made from allocating every frame, after I got the thing working properly. The other tip as far as locking goes -- the best locking design is one where locking isn't needed at all. Again, I don't know what you can pull off in your design, but if you can avoid it entirely by just managing multiple instances of things, it might be worth considering. In other words, don't send the cars all down the same lane -- add another lane to your freeway. In real-time processing, speed is the prime directive, so it is usually OK to give up a little in memory to increase throughput. Good luck... Brad From mohandsp at gmail.com Wed May 15 12:36:28 2013 From: mohandsp at gmail.com (Mohan Reddy) Date: Wed, 15 May 2013 16:06:28 +0530 Subject: [Libav-user] to change the encoding bitrate inbetween encoding Message-ID: Dear All, Am using ffmpeg libavcodec for encoding h264 streams using lib x264 on win32. Can some one help me how to acheive the below. 1. Need to change the encoding bitrate inbetween encoding. say initiallly set it to 300kbps and later inbetween encoding wanted to chaneg the bitrate to 100kbps. 2>. How to use use x264_encoder_intra_refresh(). Say want to do intra refresh between encoding. Thanks, Mohan -------------- next part -------------- An HTML attachment was scrubbed... URL: From willbeas88 at gmail.com Wed May 15 21:51:03 2013 From: willbeas88 at gmail.com (iwastemoretimethanu) Date: Wed, 15 May 2013 12:51:03 -0700 (PDT) Subject: [Libav-user] Audio playing to fast using fflplay Message-ID: <1368647463312-4657609.post@n4.nabble.com> I'm not sure if anyone else has ran into this but the audio is playing much faster than the video. Here is a little breakdown. Any help would be great, THANKS! _Here is what I know_: * I know the sound being grabbed is correct because I made a playback test function. * I know the sound is being encoded into the video file because I can hear the sound when played in ffplay or any other player. _Here is the problem_: * When the output video is played, the video starts off at the correct speed, but the audio is playing far too quickly. o For reference, my test output is supposed to be 20 seconds. With my current settings, this is 100 video frames and 100 audio frames at 5 FPS. o All 20 seconds of audio play in the first 5 seconds of the video, which shouldn't be happening simply because the audio and video are being encoded side-by-side (write_audio_frame() is being called directly after write_video_frame()). *I also attempted to use atempo _Here is what I have tried_: * Changing pts values before the encode, after the encode, using the native av_rescale_q() function to try and automatically set the pts value. o I have done quite a bit of research on this and it seems to be the consensus that pts is supposed to be set before the frame is encoded into the packet, and I have a formula that should work for both the audio and video pts: + frame_count * (1000/STREAM_FRAME_RATE) * 90 + ^ frame scale ^ getting ms ^ pts is apparently supposed to be time * 90 * Reducing the frames per second to a safe value (well-below the potential of the system) * Switching between the av_interleaved_write_frame() and the manual av_write_frame() _Here is what I think the problem could be_: * I've always thought it could be the pts/dts that are off, as those are what are supposed to be controlling the speed/when the sound is played...but considering how many different ways I've modified these and tried things that I think should have worked with my understanding of them and how little any of my trials have mattered in the output file, I'm beginning to think the possibility of this being the problem is getting slimmer and slimmer. _Technical details about the audio data (just in case)_: * Using SFML (Built off of OpenAL) to grab the data * Developing on Windows, audio data is being grabbed from the muxer with the microphone disabled. * The sound data is PCM, 16 bit (stored as int16_t*) * I started off using an algorithm that interlaced the audio with the video manually by using a method of o if audio->pts < video->pts, write another audio frame o else write video frame * I now just encode an audio frame after every video frame because it /should /sync itself, considering the audio is being grabbed while the video is being encoded * I have access to the raw buffered audio data (int16_t*), the sample rate (uint), the channel count (uint), and the sample count (size_t). -- View this message in context: http://libav-users.943685.n4.nabble.com/Audio-playing-to-fast-using-fflplay-tp4657609.html Sent from the libav-users mailing list archive at Nabble.com. From yb947835908 at gmail.com Wed May 15 20:56:25 2013 From: yb947835908 at gmail.com (=?GB2312?B?1KzUrLHz?=) Date: Thu, 16 May 2013 02:56:25 +0800 Subject: [Libav-user] avformat_open_input() error! Message-ID: Hello, I am trying to use ffmpeg to demux video (with VS 2010, Win7). When calling avformat_open_input() to open the input file, it always returns -1094995529. the codes are blow: Init(const char *strFileName) { //some other codes AVFormatContext* m_pFormatCtx = NULL; //I also tried this : //m_pFormatCtx = avformat_alloc_context(); // Initialize libavcodec, and register all codecs and formats av_register_all(); res = avformat_open_input(&m_pFormatCtx, strFileName, NULL, NULL); if(res) { printf("FFMPEG: Could not open input container\n"); return ERR_UNKNOWN; } //...some other codes } Is there anything wrong? Many thanks!!! -------------- next part -------------- An HTML attachment was scrubbed... URL: From yiikai1987910 at gmail.com Wed May 15 03:48:42 2013 From: yiikai1987910 at gmail.com (dboyaoao) Date: Tue, 14 May 2013 18:48:42 -0700 (PDT) Subject: [Libav-user] how can I play h264 file?????????? Message-ID: <1368582522745-4657588.post@n4.nabble.com> HI: when I use av_read_frame ,I save the video file in the local,but why I can't play the h264 file use vlc?anybody can help? -- View this message in context: http://libav-users.943685.n4.nabble.com/how-can-I-play-h264-file-tp4657588.html Sent from the libav-users mailing list archive at Nabble.com. From yiikai1987910 at gmail.com Wed May 15 08:31:07 2013 From: yiikai1987910 at gmail.com (dboyaoao) Date: Tue, 14 May 2013 23:31:07 -0700 (PDT) Subject: [Libav-user] how can I play h264 file?????????? In-Reply-To: <1368582522745-4657588.post@n4.nabble.com> References: <1368582522745-4657588.post@n4.nabble.com> Message-ID: <1368599467784-4657594.post@n4.nabble.com> oh! I slove by myself ,THANKS -- View this message in context: http://libav-users.943685.n4.nabble.com/how-can-I-play-h264-file-tp4657588p4657594.html Sent from the libav-users mailing list archive at Nabble.com. From myladyyang at gmail.com Thu May 16 05:10:54 2013 From: myladyyang at gmail.com (Xian Yan Yang) Date: Thu, 16 May 2013 11:10:54 +0800 Subject: [Libav-user] Does anyone know how to generate quicktime compatiable H264 video by ffmpeg? Message-ID: I've generated H264 video stream from my camera, but the video can't play in quicktime, only works in VLC. Does anyone face same problem as me? Thanks Br.Luffy -------------- next part -------------- An HTML attachment was scrubbed... URL: From wprice at cyphers.net Thu May 16 05:40:57 2013 From: wprice at cyphers.net (Will Price) Date: Wed, 15 May 2013 20:40:57 -0700 Subject: [Libav-user] Reference app with ffmpeg n1.2 libs that works on IOS ? In-Reply-To: References: Message-ID: After a lot of work, I have arrived at the same issue last posted to this list by Lars on April 5. That is the following warnings on link: ld: warning: ARM function not 4-byte aligned: __b_evaluation from ffmpeg/lib/libavcodec.a(simple_idct_arm.o) ld: warning: ARM function not 4-byte aligned: __a_evaluation from ffmpeg/lib/libavcodec.a(simple_idct_arm.o) ld: warning: ARM function not 4-byte aligned: __end_b_evaluation2 from ffmpeg/lib/libavcodec.a(simple_idct_arm.o) ld: warning: ARM function not 4-byte aligned: __a_evaluation2 from ffmpeg/lib/libavcodec.a(simple_idct_arm.o) ld: warning: ARM function not 4-byte aligned: __end_simple_idct_arm from ffmpeg/lib/libavcodec.a(simple_idct_arm.o) The thread ensued from there to fix a different R_ABS reloc issue, but did not come back to these link problems. Any suggestions on getting rid of the above link warnings? Thanks. On Fri, May 10, 2013 at 11:46 PM, Carl Eugen Hoyos wrote: > Will Price writes: > > > The gas linked below > > [...] > > Allow me to repeat: > The only supported version of gas-preprocessor.pl is the > one mentioned on http://ffmpeg.org/platform.html > You are on your own with any other version. > > If you have a compilation problem, please provide the > following information: > Your configure line, (your FFmpeg version,) if (and only > if) compilation fails completely: Run make several times, > always see the same error, run "make V=1" and post the > console output for that last run (do not post the complete > make output from an earlier run). > If compilation does succeed, but you are unhappy with the > output of make, I suggest you run "make V=1 ffmpeg.o" and > post the output here. > > Carl Eugen > -------------- next part -------------- An HTML attachment was scrubbed... URL: From alexcohn at netvision.net.il Thu May 16 07:18:28 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 16 May 2013 08:18:28 +0300 Subject: [Libav-user] Audio playing to fast using fflplay In-Reply-To: <1368647463312-4657609.post@n4.nabble.com> References: <1368647463312-4657609.post@n4.nabble.com> Message-ID: On 16 May 2013 04:40, "iwastemoretimethanu" wrote: > For reference, my test output is supposed to be 20 seconds. With > my current settings, this is 100 video frames and 100 audio > frames at 5 FPS. > o All 20 seconds of audio play in the first 5 seconds of the > video, which shouldn't be happening simply because the audio and > video are being encoded side-by-side (write_audio_frame() is > being called directly after write_video_frame()). I think that most container formats don't support audio at 5 FPS. I would recommend to split the audio stream into 20 ms packets. BR Alex -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Thu May 16 09:31:32 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Thu, 16 May 2013 17:31:32 +1000 Subject: [Libav-user] How to disable zlib include Message-ID: Hi, Several days ago I succeeded in building ffmpeg with zlib support, I think I just got zlib code, made and installed, then ffmpeg build automatically included it. But today I tried to disable zlib support, but couldn't do it. I uninstalled header files and libs. and I can see the configure result is "zlib enable no, bzlib enabled yes' But why, after I opened generated ffmpeg with dependency walker and found that AVCODEC-54.DLL still needs ZLIB1.DLL Could anyone tell me how to do? Because zlib support is auto detected, is there anyway to explicitly disable that? Great thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Thu May 16 09:48:07 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 16 May 2013 07:48:07 +0000 (UTC) Subject: [Libav-user] How to disable zlib include References: Message-ID: YIRAN LI writes: > Could anyone tell me how to do? Because zlib support is > auto detected, is there anyway to explicitly disable that? ./configure --disable-zlib Carl Eugen From cehoyos at ag.or.at Thu May 16 10:58:21 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 16 May 2013 08:58:21 +0000 (UTC) Subject: [Libav-user] Reference app with ffmpeg n1.2 libs that works on IOS ? References: Message-ID: Will Price writes: > On Fri, May 10, 2013 at 11:46 PM, Carl Eugen Hoyos writes: > If you have a compilation problem, please provide the > following information: > Your configure line, (your FFmpeg version,) if (and only > if) compilation fails completely: Run make several times, > always see the same error, run "make V=1" and post the > console output for that last run (do not post the complete > make output from an earlier run). Please consider reading this paragraph again. Please do not top-post here, it is considered rude. Carl Eugen From onemda at gmail.com Thu May 16 12:38:03 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 16 May 2013 10:38:03 +0000 Subject: [Libav-user] Does anyone know how to generate quicktime compatiable H264 video by ffmpeg? In-Reply-To: References: Message-ID: On 5/16/13, Xian Yan Yang wrote: > I've generated H264 video stream from my camera, but the video can't play > in quicktime, only works in VLC. > > Does anyone face same problem as me? Add -pix_fmt yuv420p, because quicktime supports only baseline h264. > > Thanks > Br.Luffy > From myladyyang at gmail.com Thu May 16 12:46:54 2013 From: myladyyang at gmail.com (Xian Yan Yang) Date: Thu, 16 May 2013 18:46:54 +0800 Subject: [Libav-user] Does anyone know how to generate quicktime compatiable H264 video by ffmpeg? In-Reply-To: References: Message-ID: It's already added,still not work. Same problem happened to realplayer,I wonder if there is any special parameters that I need to take care? Thanks BR.Luffy 2013/5/16 Paul B Mahol > On 5/16/13, Xian Yan Yang wrote: > > I've generated H264 video stream from my camera, but the video can't play > > in quicktime, only works in VLC. > > > > Does anyone face same problem as me? > > Add -pix_fmt yuv420p, because quicktime supports only baseline h264. > > > > > Thanks > > Br.Luffy > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From onemda at gmail.com Thu May 16 12:52:37 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 16 May 2013 10:52:37 +0000 Subject: [Libav-user] Does anyone know how to generate quicktime compatiable H264 video by ffmpeg? In-Reply-To: References: Message-ID: On 5/16/13, Xian Yan Yang wrote: > It's already added,still not work. Same problem happened to realplayer,I > wonder if there is any special parameters that I need to take care? Its important where you added it. Without full uncut ffmpeg output its guessing game. > > Thanks > BR.Luffy > > > 2013/5/16 Paul B Mahol > >> On 5/16/13, Xian Yan Yang wrote: >> > I've generated H264 video stream from my camera, but the video can't >> > play >> > in quicktime, only works in VLC. >> > >> > Does anyone face same problem as me? >> >> Add -pix_fmt yuv420p, because quicktime supports only baseline h264. >> >> > >> > Thanks >> > Br.Luffy >> > >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > From andrey.krieger.utkin at gmail.com Thu May 16 17:24:53 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 16 May 2013 18:24:53 +0300 Subject: [Libav-user] Audio playing to fast using fflplay In-Reply-To: <1368647463312-4657609.post@n4.nabble.com> References: <1368647463312-4657609.post@n4.nabble.com> Message-ID: 2013/5/15 iwastemoretimethanu : > * Changing pts values before the encode, after the encode, using the > native av_rescale_q() function to try and automatically set the pts > value. > o I have done quite a bit of research on this and it seems to be > the consensus that pts is supposed to be set before the frame is > encoded into the packet, and I have a formula that should work > for both the audio and video pts: > + frame_count * (1000/STREAM_FRAME_RATE) * 90 > + ^ frame scale ^ getting ms > ^ pts is apparently supposed to be time * 90 > * Reducing the frames per second to a safe value (well-below the > potential of the system) > * Switching between the av_interleaved_write_frame() and the manual > av_write_frame() I've used another pts assignment formula in transcoding apps. For audio, you should set pts of uncompressed-yet AVFrame with raw samples to _offset from stream beginning, in samples_. It means if you have audio @ 48000 Hz, the raw audio timestamps should be stamped in units of 1/48000 of second. Then you put this AVFrame into encoder and get AVPacket. I don't remember to what AVPacket.dts, .pts is set to after this, you should check. Either libavcodec rescales timestamp to timebase of media file (i.e. 1/1000 for FLV, 1/90000 for MPEG TS), or you have to do it by yourself. That's all. -- Andrey Utkin From info at denisgottardello.it Thu May 16 21:46:44 2013 From: info at denisgottardello.it (Denis) Date: Thu, 16 May 2013 21:46:44 +0200 Subject: [Libav-user] FFmpeg, raspberry Message-ID: <201305162146.44533.info@denisgottardello.it> Do the FFmpeg libraries support the raspberry h264 hardware encoding? Have you got any example on how I can use it for encoding? -- www.denisgottardello.it Skype: mrdebug Videosurveillance and home automation! http://www.denisgottardello.it/DomusBoss/DomusBossIndice.php From praks411 at gmail.com Fri May 17 10:25:01 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Fri, 17 May 2013 01:25:01 -0700 (PDT) Subject: [Libav-user] Audio encoding using avcodec_fill_audio_frame() and memory leaks Message-ID: <1368779101753-4657623.post@n4.nabble.com> Hi, As a part of encoding decoded audio packets, I'm using avcodec_fill_audio_frame(). I'm passing allocated AVFrame pointer to along with buffer containing the decoded samples and other parameters number of channels, sample format, buffer size. Though the encoding is working fine I'm not able to completely eliminate the memory leaks. I've taken care of most of things but still I'm not able detect the leakage. Below is the function which I'm using for encoding. Please suggest something. AudioSample contains decoded data and it is completely managed in different class(free in class destructor). I'm freeing the AVFrame in FFmpegEncoder destructor and AVPacket is freed every time using av_free_packet() with av_packet_destruct enabled. What more do I need to free? void FfmpegEncoder::WriteAudioSample(AudioSample *audS) { int num_audio_frame = 0; AVCodecContext *c = NULL; // AVFrame *frame; AVPacket pkt; av_init_packet(&pkt); pkt.destruct = av_destruct_packet; pkt.data = NULL; pkt.size = 0; int ret = 0, got_packet = 0; c = m_out_aud_strm->codec; static int64_t aud_pts_in = -1; if((audS != NULL) && (audS->GetSampleLength() > 0) ) { int byte_per_sample = av_get_bytes_per_sample(c->sample_fmt); PRINT_VAL("Byte Per Sample ", byte_per_sample) m_frame->nb_samples = (audS->GetSampleLength())/(c->channels*av_get_bytes_per_sample(c->sample_fmt)); if(m_frame->nb_samples == c->frame_size) { #if 1 if(m_need_resample && (c->channels >= 2)) { uint8_t * t_buff1 = new uint8_t[audS->GetSampleLength()]; if(t_buff1 != NULL) { for(int64_t i = 0; i< m_frame->nb_samples; i++) { memcpy(t_buff1 + i*byte_per_sample, (uint8_t*)((uint8_t*)audS->GetAudioSampleData() + i*byte_per_sample*c->channels), byte_per_sample); memcpy(t_buff1 + (audS->GetSampleLength())/2 + i*byte_per_sample, (uint8_t*)((uint8_t*)audS->GetAudioSampleData() + i*byte_per_sample*c->channels+ byte_per_sample), byte_per_sample); } audS->FillAudioSample(t_buff1, audS->GetSampleLength()); delete[] t_buff1; } } #endif ret = avcodec_fill_audio_frame(m_frame, c->channels, c->sample_fmt, (uint8_t*)audS->GetAudioSampleData(),m_frame->nb_samples*byte_per_sample*c->channels, 0); //ret = avcodec_fill_audio_frame(&frame, c->channels, c->sample_fmt, t_buff,frame.nb_samples*byte_per_sample*c->channels, 0); if(ret != 0) { PRINT_MSG("Avcodec Fill Audio Failed ") } else { got_packet = 0; ret = avcodec_encode_audio2(c, &pkt, m_frame, &got_packet); if(ret < 0 || got_packet == 0) { PRINT_MSG("failed to encode audio ") } else { PRINT_MSG("Audio Packet Encoded "); aud_pts_in++; pkt.pts = aud_pts_in; pkt.dts = pkt.pts; pkt.stream_index = m_out_aud_strm->index; ret = av_interleaved_write_frame(oc, &pkt); if(ret != 0) { PRINT_MSG("Error Write Audio PKT ") } else { PRINT_MSG("Audio PKT Writen ") } } } } avcodec_flush_buffers(c); // avcodec_free_frame(&frame); } av_free_packet(&pkt); } Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Audio-encoding-using-avcodec-fill-audio-frame-and-memory-leaks-tp4657623.html Sent from the libav-users mailing list archive at Nabble.com. From praks411 at gmail.com Fri May 17 12:47:13 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Fri, 17 May 2013 03:47:13 -0700 (PDT) Subject: [Libav-user] Audio encoding using avcodec_fill_audio_frame() and memory leaks In-Reply-To: <1368779101753-4657623.post@n4.nabble.com> References: <1368779101753-4657623.post@n4.nabble.com> Message-ID: <1368787633166-4657624.post@n4.nabble.com> Ok after successively disabling the code I found that memory leak is coming from av_interleaved_write_frame(), even though I'm using av_free_packet, it is still there. I tried to use av_destruct_packet just before av_free_packet but then my application is crashing while calling av_destruct_packet. Actaully I'm setting mpkt.destruct to av_destruct_packet before calling av_interleaved_write_frame but somehow mpkt.destruct is setting to NULL after the call of av_inteleaved_write_frame, so I'm setting it again before calling av_free_packet. Can someone explain the correct use to AVPacket.destruct and av_destruct_packet. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Audio-encoding-using-avcodec-fill-audio-frame-and-memory-leaks-tp4657623p4657624.html Sent from the libav-users mailing list archive at Nabble.com. From kalileo at universalx.net Fri May 17 13:45:17 2013 From: kalileo at universalx.net (Kalileo) Date: Fri, 17 May 2013 18:45:17 +0700 Subject: [Libav-user] Audio encoding using avcodec_fill_audio_frame() and memory leaks In-Reply-To: <1368787633166-4657624.post@n4.nabble.com> References: <1368779101753-4657623.post@n4.nabble.com> <1368787633166-4657624.post@n4.nabble.com> Message-ID: <93E2A37E-B664-43C6-AE6D-3E8122FAEDDD@universalx.net> On May 17, 2013, at 17:47 , Pradeep Karosiya wrote: > Ok after successively disabling the code I found that memory leak is coming > from av_interleaved_write_frame(), even though I'm using av_free_packet, it > is still there. > I tried to use av_destruct_packet just before av_free_packet but then my > application is crashing while calling av_destruct_packet. > Actaully I'm setting mpkt.destruct to av_destruct_packet before calling > av_interleaved_write_frame but > somehow mpkt.destruct is setting to NULL after the call of > av_inteleaved_write_frame, so I'm setting it again before calling > av_free_packet. > Can someone explain the correct use to AVPacket.destruct and > av_destruct_packet. > > Thanks > Pradeep > I don't think you need to go the route of av_destruct_packet. If you really see a leak, then try freeing the data in the packet before you run av_free_packet. From praks411 at gmail.com Fri May 17 14:20:37 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Fri, 17 May 2013 05:20:37 -0700 (PDT) Subject: [Libav-user] Audio encoding using avcodec_fill_audio_frame() and memory leaks In-Reply-To: <93E2A37E-B664-43C6-AE6D-3E8122FAEDDD@universalx.net> References: <1368779101753-4657623.post@n4.nabble.com> <1368787633166-4657624.post@n4.nabble.com> <93E2A37E-B664-43C6-AE6D-3E8122FAEDDD@universalx.net> Message-ID: <1368793237321-4657626.post@n4.nabble.com> Hi Kalileo Thanks for the reply. I've noted that If I just disable av_interleaved_write_frame and keep the remaining code as it is then there is no memory leak. The memory for AVPacket is getting allocated in avcodec_encode_audio2 and if I use av_free_packet with destruct field set to av_packet_destruct than there is no crash. However if I enable av_interleaved_write_frame then I'm seeing a crash if destruct field is set. I tried following if(pkt.data) { av_free(pkt.data); } av_free_packet(&pkt) But again I'm seeing exception. So what all memory do I need to free before calling av_free_packet. And strangely this is happening only for audio my video encoding is working fine. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Audio-encoding-using-avcodec-fill-audio-frame-and-memory-leaks-tp4657623p4657626.html Sent from the libav-users mailing list archive at Nabble.com. From praks411 at gmail.com Fri May 17 15:07:48 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Fri, 17 May 2013 06:07:48 -0700 (PDT) Subject: [Libav-user] Audio encoding using avcodec_fill_audio_frame() and memory leaks In-Reply-To: <1368793237321-4657626.post@n4.nabble.com> References: <1368779101753-4657623.post@n4.nabble.com> <1368787633166-4657624.post@n4.nabble.com> <93E2A37E-B664-43C6-AE6D-3E8122FAEDDD@universalx.net> <1368793237321-4657626.post@n4.nabble.com> Message-ID: <1368796068892-4657627.post@n4.nabble.com> After adding code to free memory manually, just before calling av_free_packet(), basically I added the same code as in av_destruct_pkt(). But to my surprise I'm getting a crash in av_interleaved_write_frame for video till now video was working fine. I'm writing video and audio frame sequentially and I'm using sperate AVPackets and AVFrames for both audio and video. There is no shared data between audio and video except AVFormatContext which is global. Please someone suggest what could be going wrong. Thanks and Regards, Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Audio-encoding-using-avcodec-fill-audio-frame-and-memory-leaks-tp4657623p4657627.html Sent from the libav-users mailing list archive at Nabble.com. From ggarra13 at gmail.com Fri May 17 18:09:22 2013 From: ggarra13 at gmail.com (=?ISO-8859-1?Q?Gonzalo_Garramu=F1o?=) Date: Fri, 17 May 2013 13:09:22 -0300 Subject: [Libav-user] iZeranoe latest build and glut Message-ID: <51965632.2070500@gmail.com> I am getting a strange behavior in the latest zeranoe builds of ffmpeg when I link them to my program. The program fails to start and complains about avcodec not knowing glutStrokeCharacter. I used dependency walker and indeed there are failed entries for glut. I am currently linking against freeglut. ffmpeg and ffplay don't have a problem. Using the previous zeranoe build does not show the problem, but it uses avcodec-54 and I would like to link against the latest. My guess is something is wrong with the makefile but cannot figure what. Can someone suggest what could be the cause of the problem and something to try? Thanks in advance. From cehoyos at ag.or.at Fri May 17 18:37:31 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Fri, 17 May 2013 16:37:31 +0000 (UTC) Subject: [Libav-user] iZeranoe latest build and glut References: <51965632.2070500@gmail.com> Message-ID: Gonzalo Garramu?o writes: > I am getting a strange behavior in the latest zeranoe > builds of ffmpeg when I link them to my program. I believe there is a forum dedicated to such questions. Carl Eugen From ggarra13 at gmail.com Fri May 17 18:40:18 2013 From: ggarra13 at gmail.com (=?ISO-8859-1?Q?Gonzalo_Garramu=F1o?=) Date: Fri, 17 May 2013 13:40:18 -0300 Subject: [Libav-user] iZeranoe latest build and glut In-Reply-To: <51965632.2070500@gmail.com> References: <51965632.2070500@gmail.com> Message-ID: <51965D72.2060803@gmail.com> El 17/05/2013 01:09 p.m., Gonzalo Garramu?o escribi?: > I am getting a strange behavior in the latest zeranoe builds of ffmpeg Oh yes. This is on the 64-bits builds. From samhalligan15 at gmail.com Sat May 18 17:08:51 2013 From: samhalligan15 at gmail.com (yy-zed) Date: Sat, 18 May 2013 08:08:51 -0700 (PDT) Subject: [Libav-user] sws_scale crash Message-ID: <1368889731254-4657631.post@n4.nabble.com> Hi Guys, I'm trying to figure out to cause of constant crashes on sws_scale calls. I'm reading in a video frame, decoding it, then trying to scale, encode and write to video. Reading the frame and decoding it seem to be working fine, but sws_scale keeps crashing. Here's where I set the context: p_codec_ctx =p_in_video_ctx->p_fmt_ctx->streams[p_in_video_ctx->i_video_stream_idx]->codec; p_out_video_ctx->p_sws_ctx = sws_getContext(p_codec_ctx->width, p_codec_ctx->height, p_codec_ctx->pix_fmt, p_out_video_ctx->i_vwidth, p_out_video_ctx->i_vheight, AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL); and here's where I make the call to scale the frame: debugLogR->debug("here1"); sws_scale(p_out_video_ctx->p_sws_ctx, (uint8_t const * const *) p_in_video_ctx->p_video_frame->data, p_in_video_ctx->p_video_frame->linesize, 0, p_codec_ctx->height, p_out_video_ctx->p_video_frame->data, p_out_video_ctx->p_video_frame->linesize); debugLogR->debug("here2"); here1 is printed, but the program exits with error code "-1073741819" before printing here2. Google tells me thats a general access memory violation. Has anybody got any ideas where I'm going wrong? Thanks, Sam -- View this message in context: http://libav-users.943685.n4.nabble.com/sws-scale-crash-tp4657631.html Sent from the libav-users mailing list archive at Nabble.com. From brado at bighillsoftware.com Sat May 18 22:11:09 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Sat, 18 May 2013 13:11:09 -0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context Message-ID: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> I have the following audio use-case: audio capture -> resample captured audio to destination format for encoding -> encode audio -> stream audio I have developed an app which has worked decently well for fairly common sample rates (44100, 48000). However, I came across a sample rate of 16000 which is breaking the app. The problem stems from the calculation of the number of audio samples in the destination data exceeding the codec context's frame size. In the resampling_audio.c example, there it shows the following means to calculate the destination number of samples: dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) + src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); Here are the values for these variables: src_rate = 16000 src_nb_samples = 512 dst_rate = 44100 and the calculated value: dst_nb_samples = 1412 However, the codec context's frame size is set (by the encoder, as per the documentation) at 1152, smaller than the calculated value. If I continue with the resampling and followed by encoding with these values, I see this in the console: [libmp3lame @ 0x10380a200] more samples than frame size (avcodec_encode_audio2) followed by receiving a -22 return code from avcodec_encode_audio2. I tracked this into the FFmpeg source, and the console output is coming from libavcodec's utils.c line 1208 as the result of this check in the preceding line failing: if (frame->nb_samples > avctx->frame_size) { Fair enough, it doesn't want more samples than the codec specifies for its expected frame size. Just to see what would happen, I assigned dst_nb_samples the codec context's frame size value, and the audio seems mostly fine, but the associated video timing is out of sync and askew (which probably makes sense, as the timings should be wrong given using a wrong number of samples). So my question is how should I handle this scenario? What should the app do to accommodate the calculation for the number of samples which exceeds the frame size specified by the codec context, so that the timing isn't thrown out of whack? Thanks for your help. Brad From yangnuo0408 at yahoo.com.cn Sun May 19 11:52:47 2013 From: yangnuo0408 at yahoo.com.cn (nuo yang) Date: Sun, 19 May 2013 17:52:47 +0800 (CST) Subject: [Libav-user] MPEG-2 NTSC video shows horizontal lines on the red color In-Reply-To: <1367922051.16514.YahooMailNeo@web15105.mail.cnb.yahoo.com> References: <1367157019.49851.YahooMailNeo@web15102.mail.cnb.yahoo.com> <1367922051.16514.YahooMailNeo@web15105.mail.cnb.yahoo.com> Message-ID: <1368957167.85119.YahooMailNeo@web15101.mail.cnb.yahoo.com> Hi Carl, ? Thanks for your help, and now I fixed my issue! ? You are right, my issue is with upsampling the 4:2:0 mpeg video to 4:2:2 feeding the decklink card. I read the article and found an upsampling filter to convert chroma format from 4:2:0 to 4:2:2. The upsampling filter can handle two types of frame, it is progressive and interlaced. Previous I used a ffmpeg function sws_scale?to convert the chroma format, it has this issue, and it is the same issue when I convert the chroma format using this upsampling filter by assuming the frame is progressive. But things changed when I assume the frame is interlaced, it is difficult to see horizontal lines on the red color. I think ffmpeg treated a frame as a progressive frame when doing the chroma upsampling using sws_scale in my video player. Thanks, Nuo ________________________________ From: nuo yang To: "This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." ? Sent: 2013-5-7 Subject:? Re: [Libav-user] MPEG-2 NTSC video shows horizontal lines on the red color ? Thank you,?Carl?! I will read the?article?and have a try, will update you later. ________________________________ From:?Carl Lindqvist To:?"This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." ? Sent:?2013-5-6 Subject:?Re: [Libav-user] MPEG-2 NTSC video shows horizontal lines on the red color Here is an article describing what is probably happening in your app, and will hopefully give you some idea what you need to correct: http://web.archive.org/web/20060719025947/http://www.hometheaterhifi.com/volume_8_2/dvd-benchmark-special-report-chroma-bug-4-2001.html 2013/5/6 Carl Lindqvist : > I suspect your issue is with resampling the 4:2:0 mpeg video to 4:2:2 > feeding the decklink card. > > As 4:2:0 in interlaced is often poorly done or misunderstood, this is > often an issue. And since we are pretty bad at noticing errors in > color, it will only be obvious in very saturated colors. > > How do you handle the conversion now? Make sure you really specify > that you are handling an interlaced source, since 4:2:0 is very > different in interlaced vs progressive. > > 2013/4/28 nuo yang : >> Hi everyone, >> >> Recently I use ffmpeg sdk to develop my own player, my video source is >> MPEG-2 NTSC video, and I use ffmpeg sdk to decode the video, then use >> BlackMagic DeckLink sdk to receive the video frame and display the video to >> my CRT monitor through a DeckLink PCI card. Everything is okay but a little >> defect, when the video contains some red color objects (like red clothes), >> and if the red color objects moving fast, there are some horizontal lines on >> red color. My video is interlaced, and I tried some methods, including >> change the video field order, but I didn't make it. BTW, if I use ffdshow to >> decode the video, it does not have the issue. >> >> Is there someone has the same issue like me, or can someone give me some >> advice? Many thanks in advance! >> >> >> - Nuo >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Mon May 20 02:05:17 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Mon, 20 May 2013 10:05:17 +1000 Subject: [Libav-user] sws_scale crash In-Reply-To: <1368889731254-4657631.post@n4.nabble.com> References: <1368889731254-4657631.post@n4.nabble.com> Message-ID: Hi, you can check if pixel format ever changes between frames. Once up a time I also had a crash problem, which I later found is caused by pixel format change. 2013/5/19 yy-zed > Hi Guys, > > I'm trying to figure out to cause of constant crashes on sws_scale calls. > I'm reading in a video frame, decoding it, then trying to scale, encode and > write to video. Reading the frame and decoding it seem to be working fine, > but sws_scale keeps crashing. > > Here's where I set the context: > > > p_codec_ctx > > =p_in_video_ctx->p_fmt_ctx->streams[p_in_video_ctx->i_video_stream_idx]->codec; > > p_out_video_ctx->p_sws_ctx = sws_getContext(p_codec_ctx->width, > p_codec_ctx->height, p_codec_ctx->pix_fmt, > p_out_video_ctx->i_vwidth, p_out_video_ctx->i_vheight, > AV_PIX_FMT_YUV420P, SWS_BICUBIC, NULL, NULL, NULL); > > and here's where I make the call to scale the frame: > > debugLogR->debug("here1"); > sws_scale(p_out_video_ctx->p_sws_ctx, > (uint8_t const * const *) > p_in_video_ctx->p_video_frame->data, > p_in_video_ctx->p_video_frame->linesize, 0, > p_codec_ctx->height, > p_out_video_ctx->p_video_frame->data, > p_out_video_ctx->p_video_frame->linesize); > > debugLogR->debug("here2"); > > here1 is printed, but the program exits with error code "-1073741819" > before > printing here2. Google tells me thats a general access memory violation. > > Has anybody got any ideas where I'm going wrong? > > Thanks, > Sam > > > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/sws-scale-crash-tp4657631.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Mon May 20 02:11:16 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Mon, 20 May 2013 10:11:16 +1000 Subject: [Libav-user] qscale for vorbis encoder Message-ID: Hi Guys, I'm trying encoding ogg video with native experimental vorbis encoder. While documentation here says the max qscale is 10 for vorbis audio, and default is 6, http://ffmpeg.org/trac/ffmpeg/wiki/TheoraVorbisEncodingGuide But I found that even if I pass 150 to -qscale:a I still can get files with larger size than -qscale:10 (I keep same qscale for video, so I assume the size increment is caused by audio part). and the code fragment for vorbis quality is here avccontext->bit_rate = 0; if (avccontext->flags & CODEC_FLAG_QSCALE) venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA; else venc->quality = 8; venc->quality *= venc->quality; So could anyone tell me what's the maximum value I can set AVCodecCtx->global_quality for Vorbis encoder? Great thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mrfun.china at gmail.com Mon May 20 10:23:06 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Mon, 20 May 2013 18:23:06 +1000 Subject: [Libav-user] how to set crf for vp8 encoder in ffmpeg programmatically? Message-ID: Hi guys, I've downloaded latest libvpx code and built it into ffmpeg, so that my application can use ffmpeg dlls. Vp8 encoding works correctly and my application can generate webm videos. But what I want to know is, how can I set crf when encoding? What I do in my application is just calling ffmpeg interface 1. AVStream* pVideoStream = av_new_stream(pFormatCtx, 0); 2. AVCodec* pVideoCodec = avcodec_find_encoder(AVCODE_ID_VP8) 3. AVCodecContext* pVideoCodecCtx = pVideoStream->codec; pVideoCodexCtx->bit_rate = ->rc_min_rate= ->rc_max_rate= (set all these bit rate control param) I checked libvpxenc.c under libavcodec and seems when initing the encoder, it doesn't directly refer to any member of AVCodecContext to set crf. So could anyone tell me, how to set crf when open vp8 encoder programmatically? Great thanks! -------------- next part -------------- An HTML attachment was scrubbed... URL: From mike at mikeversteeg.com Mon May 20 10:34:58 2013 From: mike at mikeversteeg.com (Mike Versteeg) Date: Mon, 20 May 2013 10:34:58 +0200 Subject: [Libav-user] flv/h264/rtmp live video streaming In-Reply-To: References: Message-ID: > Is x264 capable of live video streaming, i.e. constant bitrate? I'm > asking because I cannot get any acceptable quality from it when using > bitrates < 1 Mbps, not even for static images. Only if I set qcompress > to a very low value does the quality improve, but it also seems to > skyrocket the bitrate considering the buffering I see in the > downstream. Is someone willing & able to offer paid support? Thanks, Mike From h.leppkes at gmail.com Mon May 20 10:39:34 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Mon, 20 May 2013 10:39:34 +0200 Subject: [Libav-user] how to set crf for vp8 encoder in ffmpeg programmatically? In-Reply-To: References: Message-ID: On Mon, May 20, 2013 at 10:23 AM, YIRAN LI wrote: > Hi guys, > > I've downloaded latest libvpx code and built it into ffmpeg, so that my > application can use ffmpeg dlls. > > Vp8 encoding works correctly and my application can generate webm videos. > > But what I want to know is, how can I set crf when encoding? > > What I do in my application is just calling ffmpeg interface > 1. AVStream* pVideoStream = av_new_stream(pFormatCtx, 0); > 2. AVCodec* pVideoCodec = avcodec_find_encoder(AVCODE_ID_VP8) > 3. AVCodecContext* pVideoCodecCtx = pVideoStream->codec; > > pVideoCodexCtx->bit_rate = > ->rc_min_rate= > ->rc_max_rate= (set all these bit rate control > param) > > I checked libvpxenc.c under libavcodec and seems when initing the encoder, > it doesn't directly refer to any member > of AVCodecContext to set crf. > > So could anyone tell me, how to set crf when open vp8 encoder > programmatically? > > Great thanks! > This should do it: av_opt_set_int(pVideoCodexCtx, "crf", 10, AV_OPT_SEARCH_CHILDREN) From mrfun.china at gmail.com Mon May 20 11:35:36 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Mon, 20 May 2013 19:35:36 +1000 Subject: [Libav-user] how to set crf for vp8 encoder in ffmpeg programmatically? In-Reply-To: References: Message-ID: Thanks Hendrik! And I found that member variable crf has been removed from AVCodecContext, so I assume that unless I add that back to AVCodecConetxt, using av_option_set is the only way to set that. Great thanks! 2013/5/20 Hendrik Leppkes > On Mon, May 20, 2013 at 10:23 AM, YIRAN LI wrote: > > Hi guys, > > > > I've downloaded latest libvpx code and built it into ffmpeg, so that my > > application can use ffmpeg dlls. > > > > Vp8 encoding works correctly and my application can generate webm videos. > > > > But what I want to know is, how can I set crf when encoding? > > > > What I do in my application is just calling ffmpeg interface > > 1. AVStream* pVideoStream = av_new_stream(pFormatCtx, 0); > > 2. AVCodec* pVideoCodec = avcodec_find_encoder(AVCODE_ID_VP8) > > 3. AVCodecContext* pVideoCodecCtx = pVideoStream->codec; > > > > pVideoCodexCtx->bit_rate = > > ->rc_min_rate= > > ->rc_max_rate= (set all these bit rate > control > > param) > > > > I checked libvpxenc.c under libavcodec and seems when initing the > encoder, > > it doesn't directly refer to any member > > of AVCodecContext to set crf. > > > > So could anyone tell me, how to set crf when open vp8 encoder > > programmatically? > > > > Great thanks! > > > > This should do it: > av_opt_set_int(pVideoCodexCtx, "crf", 10, AV_OPT_SEARCH_CHILDREN) > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From praks411 at gmail.com Mon May 20 11:26:45 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Mon, 20 May 2013 02:26:45 -0700 (PDT) Subject: [Libav-user] Encoding with variable frame rate Message-ID: <1369042005385-4657639.post@n4.nabble.com> Hi, Till now I was doing all of my encoding using fixed frame (programmatically). Now I need to support variable frame rate. I started with just commenting the portion of my code which was setting frame rate. However it is not working. My function is failing at avcodec_open2. Please someone suggest me how to go about supporting the variable frame rate. Also I came to know not all codec support variable frame rate. So which codecs are normally used when encoding with variable frame rate. Please suggest. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Encoding-with-variable-frame-rate-tp4657639.html Sent from the libav-users mailing list archive at Nabble.com. From mrfun.china at gmail.com Mon May 20 11:53:16 2013 From: mrfun.china at gmail.com (YIRAN LI) Date: Mon, 20 May 2013 19:53:16 +1000 Subject: [Libav-user] how to set crf for vp8 encoder in ffmpeg programmatically? In-Reply-To: References: Message-ID: Hi Hendrik, I had a quick test, and seems it doesn't work. I guess that's because crf is longer a member of AVCodecContext. I'll try to set AVOptions when opening codecs. Thanks 2013/5/20 YIRAN LI > Thanks Hendrik! > > And I found that member variable crf has been removed from AVCodecContext, > so I assume that unless I add that back to AVCodecConetxt, using > av_option_set is the only way to set that. > > Great thanks! > > > 2013/5/20 Hendrik Leppkes > >> On Mon, May 20, 2013 at 10:23 AM, YIRAN LI wrote: >> > Hi guys, >> > >> > I've downloaded latest libvpx code and built it into ffmpeg, so that my >> > application can use ffmpeg dlls. >> > >> > Vp8 encoding works correctly and my application can generate webm >> videos. >> > >> > But what I want to know is, how can I set crf when encoding? >> > >> > What I do in my application is just calling ffmpeg interface >> > 1. AVStream* pVideoStream = av_new_stream(pFormatCtx, 0); >> > 2. AVCodec* pVideoCodec = avcodec_find_encoder(AVCODE_ID_VP8) >> > 3. AVCodecContext* pVideoCodecCtx = pVideoStream->codec; >> > >> > pVideoCodexCtx->bit_rate = >> > ->rc_min_rate= >> > ->rc_max_rate= (set all these bit rate >> control >> > param) >> > >> > I checked libvpxenc.c under libavcodec and seems when initing the >> encoder, >> > it doesn't directly refer to any member >> > of AVCodecContext to set crf. >> > >> > So could anyone tell me, how to set crf when open vp8 encoder >> > programmatically? >> > >> > Great thanks! >> > >> >> This should do it: >> av_opt_set_int(pVideoCodexCtx, "crf", 10, AV_OPT_SEARCH_CHILDREN) >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon May 20 12:11:35 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 20 May 2013 10:11:35 +0000 (UTC) Subject: [Libav-user] Encoding with variable frame rate References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: Pradeep Karosiya writes: > Also I came to know not all codec support variable frame rate. (?, that sounds unlikely.) FFmpeg's mov muxer does not support vfr. Carl Eugen From praks411 at gmail.com Mon May 20 12:36:58 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Mon, 20 May 2013 03:36:58 -0700 (PDT) Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: <1369046218705-4657643.post@n4.nabble.com> Hi Carl, Thanks for the reply. Do mean that it is not able possible to do vfr encoding using ffmpeg.exe or it is not supported in ffmpeg lib iteself? I'm writing my own application to carry this encoding. Please clarify. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Encoding-with-variable-frame-rate-tp4657639p4657643.html Sent from the libav-users mailing list archive at Nabble.com. From krueger at lesspain.de Mon May 20 13:59:03 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Mon, 20 May 2013 13:59:03 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: On Mon, May 20, 2013 at 12:11 PM, Carl Eugen Hoyos wrote: > Pradeep Karosiya writes: > > > Also I came to know not all codec support variable frame rate. > > (?, that sounds unlikely.) > > FFmpeg's mov muxer does not support vfr. > > > Do you know what exactly is missing? What happens when one feeds the muxer with packets that have timestamps with differing offsets? Thanks, Robert -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon May 20 14:06:33 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 20 May 2013 12:06:33 +0000 (UTC) Subject: [Libav-user] Encoding with variable frame rate References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: Robert Kr?ger writes: > On Mon, May 20, 2013 at 12:11 PM, Carl Eugen Hoyos wrote: > > Pradeep Karosiya ...> writes: > > > Also I came to know not all codec support > > > variable frame rate. > > > > (?, that sounds unlikely.) > > > > FFmpeg's mov muxer does not support vfr. > > Do you know what exactly is missing? No, but it was discussed recently on irc. > What happens when one feeds the muxer with packets > that have timestamps with differing offsets? I am not sure but I would expect you get an invalid mov file. Please try to set your mailer to text-only, Carl Eugen From krueger at lesspain.de Mon May 20 15:01:57 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Mon, 20 May 2013 15:01:57 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: On Mon, May 20, 2013 at 2:06 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> On Mon, May 20, 2013 at 12:11 PM, Carl Eugen Hoyos wrote: >> > Pradeep Karosiya ...> writes: >> > > Also I came to know not all codec support >> > > variable frame rate. >> > >> > (?, that sounds unlikely.) >> > >> > FFmpeg's mov muxer does not support vfr. >> >> Do you know what exactly is missing? > > No, but it was discussed recently on irc. OK, I am asking because in the code there is neither a comment regarding that nor is it obvious that a frame rate is used anywhere with the exception of timecode tracks where it is needed for obvious reasons and in mov_write_uuidprof_tag, which is only used in PSP mode and the Quicktime spec AFAIK offers no means of specifying a constant frame rate explicitly. It will just result in a time-to-sample table that looks differently if it is constant. But, of course, there may be not so obvious places in the code, where constant frame rate is assumed and for people considering working on the mov muxer, this would be valuable information. That's why I am asking. Is IRC traffic archived publicly somewhere? > >> What happens when one feeds the muxer with packets >> that have timestamps with differing offsets? > > I am not sure but I would expect you get an > invalid mov file. > > Please try to set your mailer to text-only, Sorry, I was not aware that it wasn't already set to that. Robert From cehoyos at ag.or.at Mon May 20 16:27:55 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 20 May 2013 14:27:55 +0000 (UTC) Subject: [Libav-user] Encoding with variable frame rate References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: Robert Kr?ger writes: > >> > FFmpeg's mov muxer does not support vfr. > >> > >> Do you know what exactly is missing? > > > > No, but it was discussed recently on irc. (Maybe not recently or not on irc, sorry.) > OK, I am asking because in the code there is neither > a comment regarding that nor is it obvious that a > frame rate is used anywhere with the exception of > timecode tracks where it is needed for obvious > reasons and in mov_write_uuidprof_tag, which is > only used in PSP mode and the Quicktime spec AFAIK > offers no means of specifying a constant frame > rate explicitly. The point is that it will not try to write vfr files because the relevant flag is not set. (iiuc) > It will just result in a time-to-sample table that > looks differently if it is constant. But, of course, > there may be not so obvious places in the code, > where constant frame rate is assumed and for people > considering working on the mov muxer, this would be > valuable information. That's why I am asking. Is > IRC traffic archived publicly somewhere? http://ffmpeg.org/pipermail/ffmpeg-devel-irc/ But I searched hard and couldn't find the (short) discussion I thought to remember ;-( This might help you: http://git.videolan.org/?p=ffmpeg.git;a=commit;h=91360ce Carl Eugen From brado at bighillsoftware.com Mon May 20 17:33:26 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Mon, 20 May 2013 08:33:26 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: On May 20, 2013, at 6:01 AM, Robert Kr?ger wrote: > On Mon, May 20, 2013 at 2:06 PM, Carl Eugen Hoyos wrote: >> Robert Kr?ger writes: >> >>> On Mon, May 20, 2013 at 12:11 PM, Carl Eugen Hoyos wrote: >>>> FFmpeg's mov muxer does not support vfr. >>> What happens when one feeds the muxer with packets >>> that have timestamps with differing offsets? Robert, For what its worth, this is essentially the problem I recently had to tackle. You may have seen some recent discussions about pts/dts and the nature of time-base. While there are some things that can be done if you control a capture mechanism, if you don't control that mechanism (i.e. receiving capture data from a third-party API), in general, there is no such thing as a fixed frame rate. In my use-case, I am using QTKit as the capture mechanism, which while you can set the desired frame-rate, doesn't deliver that specified FPS per se. It delivers pts timestamp, dts timestamp, a timescale, and a duration. That is sufficient data and logically all that is needed to properly encode the captured video. But if you specify that you want 30 FPS, and set FFmpeg's time_base.den to 30, but then QTKit decides to deliver you 15FPS with each frame having double the 30FPS duration (1/15 of a sec instead of 1/30), this is a problem because FFmpeg must have its time_base.den frames per second. If you don't give it that, your video will play back at an unexpected speed -- if you give it 15FPS for example, it will take 2 seconds in the source data's time to reach 30 FPS, but FFmpeg processes that in one second, and hence your video will end up playing back at double the speed. This was my dilemma -- capture is by definition a variable frame rate (it may end up coming at a fixed frame rate, but that isn't guaranteed, so you have to plan for variable), but FFmpeg must have fixed frame rate. So what I had to do was make variable frame rate look like a fixed frame rate. In short, you have to skip encoding frames entirely if they come too quickly (i.e. a higher frame rate than time_base.den), and you have to add frames if they are received too slowly (i.e. lower frame rate than time_base.den) by encoding the same frame more than once. You also have to convert your pts / dts received to the frame count relative again to the time_base. It isn't pretty. But it worked. I hope that helps. Brad From brado at bighillsoftware.com Mon May 20 17:39:36 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Mon, 20 May 2013 08:39:36 -0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> Message-ID: <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> On May 18, 2013, at 1:11 PM, Brad O'Hearne wrote: > I have the following audio use-case: > > audio capture -> resample captured audio to destination format for encoding -> encode audio -> stream audio > > I have developed an app which has worked decently well for fairly common sample rates (44100, 48000). However, I came across a sample rate of 16000 which is breaking the app. The problem stems from the calculation of the number of audio samples in the destination data exceeding the codec context's frame size. > > In the resampling_audio.c example, there it shows the following means to calculate the destination number of samples: > > dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) + > src_nb_samples, dst_rate, src_rate, AV_ROUND_UP); > > Here are the values for these variables: > > src_rate = 16000 > src_nb_samples = 512 > dst_rate = 44100 > > and the calculated value: > > dst_nb_samples = 1412 > > However, the codec context's frame size is set (by the encoder, as per the documentation) at 1152, smaller than the calculated value. If I continue with the resampling and followed by encoding with these values, I see this in the console: > > [libmp3lame @ 0x10380a200] more samples than frame size (avcodec_encode_audio2) > > followed by receiving a -22 return code from avcodec_encode_audio2. I tracked this into the FFmpeg source, and the console output is coming from libavcodec's utils.c line 1208 as the result of this check in the preceding line failing: > > if (frame->nb_samples > avctx->frame_size) { > > Fair enough, it doesn't want more samples than the codec specifies for its expected frame size. Just to see what would happen, I assigned dst_nb_samples the codec context's frame size value, and the audio seems mostly fine, but the associated video timing is out of sync and askew (which probably makes sense, as the timings should be wrong given using a wrong number of samples). > > So my question is how should I handle this scenario? What should the app do to accommodate the calculation for the number of samples which exceeds the frame size specified by the codec context, so that the timing isn't thrown out of whack? I take it by sound of crickets (no response) to my question above that either I've done a bad job communicating the issue, or it is indeed a real stumper. In the event that it is the former, I'm going to take another stab at this by distilling it all down to a very simple question: How does one encode decompressed audio received where source data sample buffers have 512 samples each and a sample rate of 16000, and encode it to a sample rate of 44100? Thanks for your help. Brad From ggarra13 at gmail.com Tue May 21 00:32:35 2013 From: ggarra13 at gmail.com (=?ISO-8859-1?Q?Gonzalo_Garramu=F1o?=) Date: Mon, 20 May 2013 19:32:35 -0300 Subject: [Libav-user] MSVC 2010 pre-built binaries Message-ID: <519AA483.8020207@gmail.com> I was wondering if some kind soul had MSVC 2010 binaries of libavcodec, libavformat, libavutil, libswscale and libswresample that could share, as I found an incompatability with the zeranoe builds (or so it seems). From cehoyos at ag.or.at Tue May 21 00:45:31 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 20 May 2013 22:45:31 +0000 (UTC) Subject: [Libav-user] MSVC 2010 pre-built binaries References: <519AA483.8020207@gmail.com> Message-ID: Gonzalo Garramu?o writes: > as I found an incompatability with the zeranoe > builds (or so it seems). Could you be a little more specific? Carl Eugen From cine.dvlpt at gmail.com Tue May 21 07:29:53 2013 From: cine.dvlpt at gmail.com (=?ISO-8859-1?Q?St=E9phane?=) Date: Tue, 21 May 2013 07:29:53 +0200 Subject: [Libav-user] MSVC 2010 pre-built binaries In-Reply-To: <519AA483.8020207@gmail.com> References: <519AA483.8020207@gmail.com> Message-ID: <519B0651.6090809@gmail.com> Hi Gonzalo, I use the binaries from Zeranoe (64 bits dll) without problem. What I just did, was to build my own lib files using "lib.exe" from MS SDK tools. First, I modified the def files from Zeranoe by adding "LIBRARY ..." statement at the begining of the file. Then, I created the lib files. Command line for 64 bits libs should look like this: "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\amd64\lib.exe" /MACHINE:x64 /DEF:avcodec-55.def /OUT:avcodec.lib St?phane Le 21/05/2013 00:32, Gonzalo Garramu?o a ?crit : > I was wondering if some kind soul had MSVC 2010 binaries of > libavcodec, libavformat, libavutil, libswscale and libswresample that > could share, as I found an incompatability with the zeranoe builds (or > so it seems). > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -------------- next part -------------- An HTML attachment was scrubbed... URL: From krueger at lesspain.de Tue May 21 09:12:50 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Tue, 21 May 2013 09:12:50 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: Hi, On Mon, May 20, 2013 at 5:33 PM, Brad O'Hearne wrote: > > On May 20, 2013, at 6:01 AM, Robert Kr?ger wrote: > >> On Mon, May 20, 2013 at 2:06 PM, Carl Eugen Hoyos wrote: >>> Robert Kr?ger writes: >>> >>>> On Mon, May 20, 2013 at 12:11 PM, Carl Eugen Hoyos wrote: >>>>> FFmpeg's mov muxer does not support vfr. > >>>> What happens when one feeds the muxer with packets >>>> that have timestamps with differing offsets? > > Robert, > > For what its worth, this is essentially the problem I recently had to tackle. You may have seen some recent discussions about pts/dts and the nature of time-base. While there are some things that can be done if you control a capture mechanism, if you don't control that mechanism (i.e. receiving capture data from a third-party API), in general, there is no such thing as a fixed frame rate. > > In my use-case, I am using QTKit as the capture mechanism, which while you can set the desired frame-rate, doesn't deliver that specified FPS per se. It delivers pts timestamp, dts timestamp, a timescale, and a duration. That is sufficient data and logically all that is needed to properly encode the captured video. But if you specify that you want 30 FPS, and set FFmpeg's time_base.den to 30, but then QTKit decides to deliver you 15FPS with each frame having double the 30FPS duration (1/15 of a sec instead of 1/30), this is a problem because FFmpeg must have its time_base.den frames per second. If you don't give it that, your video will play back at an unexpected speed -- if you give it 15FPS for example, it will take 2 seconds in the source data's time to reach 30 FPS, but FFmpeg processes that in one second, and hence your video will end up playing back at double the speed. > > This was my dilemma -- capture is by definition a variable frame rate (it may end up coming at a fixed frame rate, but that isn't guaranteed, so you have to plan for variable), but FFmpeg must have fixed frame rate. So what I had to do was make variable frame rate look like a fixed frame rate. In short, you have to skip encoding frames entirely if they come too quickly (i.e. a higher frame rate than time_base.den), and you have to add frames if they are received too slowly (i.e. lower frame rate than time_base.den) by encoding the same frame more than once. You also have to convert your pts / dts received to the frame count relative again to the time_base. > > It isn't pretty. But it worked. I hope that helps. > are you talking about using the ffmpeg as a command line application? I am not sure because I am mostly interested in the capabilities of the muxer (e.g. used programatically in another application)? could you elaborate what exactly you mean by "but FFmpeg must have fixed frame rate"? From krueger at lesspain.de Tue May 21 09:19:30 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Tue, 21 May 2013 09:19:30 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: On Mon, May 20, 2013 at 4:27 PM, Carl Eugen Hoyos wrote: > Robert Kr?ger writes: > >> >> > FFmpeg's mov muxer does not support vfr. >> >> >> >> Do you know what exactly is missing? >> > >> > No, but it was discussed recently on irc. > > (Maybe not recently or not on irc, sorry.) > >> OK, I am asking because in the code there is neither >> a comment regarding that nor is it obvious that a >> frame rate is used anywhere with the exception of >> timecode tracks where it is needed for obvious >> reasons and in mov_write_uuidprof_tag, which is >> only used in PSP mode and the Quicktime spec AFAIK >> offers no means of specifying a constant frame >> rate explicitly. > > The point is that it will not try to write vfr files > because the relevant flag is not set. > (iiuc) > >> It will just result in a time-to-sample table that >> looks differently if it is constant. But, of course, >> there may be not so obvious places in the code, >> where constant frame rate is assumed and for people >> considering working on the mov muxer, this would be >> valuable information. That's why I am asking. Is >> IRC traffic archived publicly somewhere? > > http://ffmpeg.org/pipermail/ffmpeg-devel-irc/ > But I searched hard and couldn't find the (short) > discussion I thought to remember ;-( > > This might help you: > http://git.videolan.org/?p=ffmpeg.git;a=commit;h=91360ce I see. But AFAICS this only makes the ffmpeg command line application behave differently and not the muxer. So if I read baptiste's comment right, it will work when used programmatically if timestamps start at 0 and maybe it is not too much work to make it work properly as soon as someone really needs it, which is good to know. Thank you, Robert From brado at bighillsoftware.com Tue May 21 15:35:38 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 06:35:38 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> Message-ID: <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> On May 21, 2013, at 12:12 AM, Robert Kr?ger wrote: > are you talking about using the ffmpeg as a command line application? No, using libraries programmatically in an app. > you elaborate what exactly you mean by "but FFmpeg must have fixed > frame rate"? In my testing, you have to feed the encoder the exact number of FPS set in time_base.den. You cannot give the encoder some lesser or greater FPS and think that accommodating this by setting pts will fix the timing. Playback is going to process time_base.den frames per second, so if you give it fewer FPS than time_base.den, then your video is going to play back faster than intended, and if you give it greater FPS than time_base.den, then your video is going to play back slower than intended. The upshot is that you are pinned to a fixed frame rate while encoding. If your source data provides are a variable frame rate, then you have some work to do to feed a fixed frame rate to the encoder. That was my experience. If there are other nuances which can positively affect the situation, I'm not aware of them -- perhaps someone else can expound on those if they exist.. Good luck, Brad From brado at bighillsoftware.com Tue May 21 15:40:13 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 06:40:13 -0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> Message-ID: On May 20, 2013, at 8:39 AM, Brad O'Hearne wrote: > I take it by sound of crickets (no response) to my question above that either I've done a bad job communicating the issue, or it is indeed a real stumper. In the event that it is the former, I'm going to take another stab at this by distilling it all down to a very simple question: > > How does one encode decompressed audio received where source data sample buffers have 512 samples each and a sample rate of 16000, and encode it to a sample rate of 44100? Given no answer, is it safe to conclude that FFmpeg is unable to deal with this? A solution would be great, but if none exists, confirmation that FFmpeg can't cope with such a scenario is helpful too. Thanks for your help. Brad From krueger at lesspain.de Tue May 21 15:50:57 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Tue, 21 May 2013 15:50:57 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> Message-ID: On Tue, May 21, 2013 at 3:35 PM, Brad O'Hearne wrote: > On May 21, 2013, at 12:12 AM, Robert Kr?ger wrote: >> are you talking about using the ffmpeg as a command line application? > > No, using libraries programmatically in an app. > >> you elaborate what exactly you mean by "but FFmpeg must have fixed >> frame rate"? > > In my testing, you have to feed the encoder the exact number of FPS set in time_base.den. You cannot give the encoder some lesser or greater FPS and think that accommodating this by setting pts will fix the timing. Playback is going to process time_base.den frames per second, so if you give it fewer FPS than time_base.den, then your video is going to play back faster than intended, and if you give it greater FPS than time_base.den, then your video is going to play back slower than intended. That sounds weird. "Playback is going to process time_base.den frames per second". Where is that? It seems you're assuming (inverse) timebase == framerate which is only one special case. Anyway, a player reading a quicktime file should not assume any frame rate but display the samples with the timings/durations that are encoded in the quicktime file. So I am not sure if you're saying the resulting quicktime file is incorrect because of an ffmpeg limitation or that a specific player does not play VFR files correctly. My understanding is that _if_ the ffmpeg mov muxer supports VFR (despite what the flag says, see Carl's mail with the referenced commit by Baptiste) you should not have to do anything with frame rate as you would only need to decide on a timebase that has the granularity required to describe your captured frames' timestamps and then rescale incoming timestamps, durations to that timescale before feeding it to the mov muxer. Maybe I will try that at some point but right now I'm asking this rather because of a general interest in the state of the mov muxer than having a pressing need to get it working. Cheers, Robert From kalileo at universalx.net Tue May 21 15:58:52 2013 From: kalileo at universalx.net (Kalileo) Date: Tue, 21 May 2013 20:58:52 +0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> Message-ID: <9FA11FD3-5D94-4A2F-99BF-ED0644D5C2DA@universalx.net> On May 21, 2013, at 20:40 , Brad O'Hearne wrote: > On May 20, 2013, at 8:39 AM, Brad O'Hearne wrote: > >> I take it by sound of crickets (no response) to my question above that either I've done a bad job communicating the issue, or it is indeed a real stumper. In the event that it is the former, I'm going to take another stab at this by distilling it all down to a very simple question: >> >> How does one encode decompressed audio received where source data sample buffers have 512 samples each and a sample rate of 16000, and encode it to a sample rate of 44100? > > Given no answer, is it safe to conclude that FFmpeg is unable to deal with this? That is an assumption, nothing but an assumption. I would not base any action on such assumptions. I also think that it is not a good style to argue like that. Can you convert your audio using ffmpeg command line? If yes I would check the sources of ffmpeg's resampling code. From kalileo at universalx.net Tue May 21 15:58:51 2013 From: kalileo at universalx.net (Kalileo) Date: Tue, 21 May 2013 20:58:51 +0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> Message-ID: <477B5B61-CA54-47D1-A69A-5FDB25A228E2@universalx.net> On May 21, 2013, at 20:40 , Brad O'Hearne wrote: > On May 20, 2013, at 8:39 AM, Brad O'Hearne wrote: > >> I take it by sound of crickets (no response) to my question above that either I've done a bad job communicating the issue, or it is indeed a real stumper. In the event that it is the former, I'm going to take another stab at this by distilling it all down to a very simple question: >> >> How does one encode decompressed audio received where source data sample buffers have 512 samples each and a sample rate of 16000, and encode it to a sample rate of 44100? > > Given no answer, is it safe to conclude that FFmpeg is unable to deal with this? That is an assumption, nothing but an assumption. I would not base any action on such assumptions. I also think that it is not a good style to argue like that. Can you convert your audio using ffmpeg command line? If yes I would check the sources of ffmpeg's resampling code. From onemda at gmail.com Tue May 21 16:04:38 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 21 May 2013 14:04:38 +0000 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> Message-ID: On 5/18/13, Brad O'Hearne wrote: > I have the following audio use-case: > > audio capture -> resample captured audio to destination format for encoding > -> encode audio -> stream audio > > I have developed an app which has worked decently well for fairly common > sample rates (44100, 48000). However, I came across a sample rate of 16000 > which is breaking the app. The problem stems from the calculation of the > number of audio samples in the destination data exceeding the codec > context's frame size. > > In the resampling_audio.c example, there it shows the following means to > calculate the destination number of samples: > > dst_nb_samples = av_rescale_rnd(swr_get_delay(swr_ctx, src_rate) + > src_nb_samples, dst_rate, src_rate, > AV_ROUND_UP); > > Here are the values for these variables: > > src_rate = 16000 > src_nb_samples = 512 > dst_rate = 44100 > > and the calculated value: > > dst_nb_samples = 1412 > > However, the codec context's frame size is set (by the encoder, as per the > documentation) at 1152, smaller than the calculated value. If I continue > with the resampling and followed by encoding with these values, I see this > in the console: > > [libmp3lame @ 0x10380a200] more samples than frame size > (avcodec_encode_audio2) > > followed by receiving a -22 return code from avcodec_encode_audio2. I > tracked this into the FFmpeg source, and the console output is coming from > libavcodec's utils.c line 1208 as the result of this check in the preceding > line failing: > > if (frame->nb_samples > avctx->frame_size) { > > Fair enough, it doesn't want more samples than the codec specifies for its > expected frame size. Just to see what would happen, I assigned > dst_nb_samples the codec context's frame size value, and the audio seems > mostly fine, but the associated video timing is out of sync and askew (which > probably makes sense, as the timings should be wrong given using a wrong > number of samples). > > So my question is how should I handle this scenario? What should the app do > to accommodate the calculation for the number of samples which exceeds the > frame size specified by the codec context, so that the timing isn't thrown > out of whack? Is it so hard to send exact number of samples that encoder wants? > > Thanks for your help. > > Brad > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From onemda at gmail.com Tue May 21 16:05:42 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 21 May 2013 14:05:42 +0000 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> Message-ID: On 5/21/13, Brad O'Hearne wrote: > On May 20, 2013, at 8:39 AM, Brad O'Hearne > wrote: > >> I take it by sound of crickets (no response) to my question above that >> either I've done a bad job communicating the issue, or it is indeed a real >> stumper. In the event that it is the former, I'm going to take another >> stab at this by distilling it all down to a very simple question: >> >> How does one encode decompressed audio received where source data sample >> buffers have 512 samples each and a sample rate of 16000, and encode it to >> a sample rate of 44100? > > Given no answer, is it safe to conclude that FFmpeg is unable to deal with > this? A solution would be great, but if none exists, confirmation that > FFmpeg can't cope with such a scenario is helpful too. > I'm safe to conclude you are troller. > Thanks for your help. > > Brad > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From Steffen.Roeber at hella.com Tue May 21 15:59:23 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Tue, 21 May 2013 06:59:23 -0700 (PDT) Subject: [Libav-user] avformat_open_input failes for > 2gb Message-ID: <1369144763565-4657658.post@n4.nabble.com> Hi, avformat_open_input returns an error fpr files >2gb. It seems because of call to file_seek and lseek in file file.c. The given pos is int64 but lseek only accepts a long, so it returns a -22. ffplay and ffmpeg works with same file. What do I wrong? -- View this message in context: http://libav-users.943685.n4.nabble.com/avformat-open-input-failes-for-2gb-tp4657658.html Sent from the libav-users mailing list archive at Nabble.com. From kalileo at universalx.net Tue May 21 16:26:53 2013 From: kalileo at universalx.net (Kalileo) Date: Tue, 21 May 2013 21:26:53 +0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> Message-ID: <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> On May 21, 2013, at 20:35 , Brad O'Hearne wrote: > On May 21, 2013, at 12:12 AM, Robert Kr?ger wrote: >> are you talking about using the ffmpeg as a command line application? > > No, using libraries programmatically in an app. > >> you elaborate what exactly you mean by "but FFmpeg must have fixed >> frame rate"? > > In my testing, you have to feed the encoder the exact number of FPS set in time_base.den. You cannot give the encoder some lesser or greater FPS and think that accommodating this by setting pts will fix the timing. I disagree (again). If your player synchronizes audio and video using dts/pts, and as far as I know most do, you can indeed create the weirdest frame rate changes by manipulating dts/pts. > Playback is going to process time_base.den frames per second, so if you give it fewer FPS than time_base.den, then your video is going to play back faster than intended, and if you give it greater FPS than time_base.den, then your video is going to play back slower than intended. Which "Playback" , which player ? Every player can have it's own playback logic, nevertheless I don't see where the player logic would require fps to be fixed (unless it ignores dts/pts). time_base might play a role in the formulas used by the player, so it makes sense to match the dts/pts manipulations to the timebase used. If players base the playback on fps, they will run out of sync sooner or later. That's why we have dts/pts. > > The upshot is that you are pinned to a fixed frame rate while encoding. If your source data provides are a variable frame rate, then you have some work to do to feed a fixed frame rate to the encoder. Again i disagree. Just set DTS/PTS accordingly, to compensate for the different fps rate. Been there, done that. Works. From praks411 at gmail.com Tue May 21 16:32:34 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 21 May 2013 07:32:34 -0700 (PDT) Subject: [Libav-user] Memory leak while adding new streams In-Reply-To: <1369145673060-4657663.post@n4.nabble.com> References: <1369145673060-4657663.post@n4.nabble.com> Message-ID: <1369146754527-4657665.post@n4.nabble.com> Sorry in the above code I've replaced if(out_vid_codec_ctx) {avcodec_close(out_vid_codec_ctx);} with if(out_vid_strm->codec) {avcodec_close(out_vid_strm->codec);} Still no use. Any suggestion? Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Memory-leak-while-adding-new-streams-tp4657663p4657665.html Sent from the libav-users mailing list archive at Nabble.com. From praks411 at gmail.com Tue May 21 16:14:33 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 21 May 2013 07:14:33 -0700 (PDT) Subject: [Libav-user] Memory leak while adding new streams Message-ID: <1369145673060-4657663.post@n4.nabble.com> Hi, I have been struggling for quite some time because of memory leaks which I'm getting while encoding video and audio frames. I have posted earlier also regarding the same issue but couldn't get much clue. So I've broken down my problem into smaller parts. Till now I've found that as soon as I added new stream to output file. I get a memory leak. I've tried all the possible way of freeing streams, closing codec and closing AVFormatContext(listed in examples/suggested in forum) but still the leak persist. Below is my small test program. I'm opening input file, probing the stream , allocating avformat_alloc_context() and adding only one stream. Finally closing everything. Still I'm getting memory leaks of 10831 bytes. Please suggest. int main(int argc, char *argv[]) { AVFormatContext *informat, *outformat; informat = outformat = NULL; AVOutputFormat *outfmt = NULL; int in_aud_strm_idx, in_vid_strm_idx, out_aud_strm_idx, out_vid_strm_idx; out_aud_strm_idx = out_vid_strm_idx = in_aud_strm_idx = in_vid_strm_idx = -1; AVStream *in_aud_strm, *in_vid_strm, *out_aud_strm, *out_vid_strm; out_aud_strm = out_vid_strm = in_aud_strm = in_vid_strm = NULL; AVCodecContext *in_aud_codec_ctx, *in_vid_codec_ctx, *out_aud_codec_ctx, *out_vid_codec_ctx; out_aud_codec_ctx = out_vid_codec_ctx = in_aud_codec_ctx = in_vid_codec_ctx = NULL; AVCodec *in_aud_codec, *in_vid_codec, *out_aud_codec, *out_vid_codec; out_aud_codec = out_vid_codec = in_aud_codec = in_vid_codec = NULL; av_register_all(); const char *sourcefile = "infile1.flv"; const char *outfile = "outfile1.avi"; if ( (ret = avformat_open_input( &informat, sourcefile, 0, 0)) != 0 ) { PRINT_VAL("Not able to Open file;; ", errbuf) std::getchar(); return -1; } if ((ret = avformat_find_stream_info(informat, 0))< 0 ) { PRINT_VAL("Not Able to find stream info:: ", errbuf) std::getchar(); return -1; } else { PRINT_MSG("Got stream Info ") } else { PRINT_MSG("Opened File ") } for(unsigned int i = 0; inb_streams; i++) { if(informat->streams[i]->codec->codec_type == AVMEDIA_TYPE_VIDEO) { PRINT_MSG("Found Video Stream ") in_vid_strm_idx = i; in_vid_strm = informat->streams[i]; } if(informat->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) { PRINT_MSG("Found Audio Stream ") in_aud_strm_idx = i; in_aud_strm = informat->streams[i]; } } outfmt = av_guess_format(NULL, (const char*)outfile, NULL); if(NULL == outfmt) { PRINT_MSG("Not able to Guess Output format ") std::getchar(); } else { outformat = avformat_alloc_context(); if(outformat) { PRINT_MSG("Got Output context ") outformat->oformat = outfmt; _snprintf(outformat->filename, sizeof(outformat->filename), "%s", (const char*)outfile); if(outfmt->video_codec != AV_CODEC_ID_NONE) { out_vid_codec = avcodec_find_encoder(outfmt->video_codec); if(NULL == out_vid_codec) { PRINT_MSG("Could Not Find Vid Encoder") } else { PRINT_MSG("Found Out Vid Encoder ") out_vid_strm = avformat_new_stream(outformat, out_vid_codec); if(NULL == out_vid_strm) { PRINT_MSG("Failed to Allocate Output Vid Strm ") } else { PRINT_MSG("Allocated Video Stream ") if(avcodec_copy_context(out_vid_strm->codec, in_vid_codec_ctx) != 0) { PRINT_MSG("Failed to Copy Context ") } else { PRINT_MSG("Copied Context ") } } } } if(informat) { if(in_aud_codec_ctx) { avcodec_close(in_aud_codec_ctx); } if(in_vid_codec_ctx) { avcodec_close(in_vid_codec_ctx); } avformat_close_input(&informat); av_free(informat); } if(outformat) { if(out_aud_codec_ctx) { avcodec_close(out_aud_codec_ctx); } if(out_vid_codec_ctx) { avcodec_close(out_vid_codec_ctx); } if(outformat->pb) { avio_close(outformat->pb); } avformat_free_context(outformat); //av_free(&outformat); std::cout<<"Freeing "< Hi! I am trying to read exact values for frame rate (fps) from any input video file. I have been trying to debug different structures like AVFormatCtx, etc. but cannot seem to figure it out. For a test case, here is the code I have managed (just the source snippet, include files etc. are all understandable): //--------------------------------------------------------------------------------------------------------------------------------------------------- // ++ test code begins ++// av_register_all(); avcodec_register_all(); avformat_network_init(); avdevice_register_all(); AVFormatContext *pFormatCtx = NULL; pFormatCtx = avformat_alloc_context(); string finalInputName = "test_input.3gp"; avformat_open_input(&pFormatCtx, finalInputName.c_str(), NULL, NULL); if ( pFormatCtx == NULL || pFormatCtx->iformat == NULL ) { return -1; } // Retrieve stream information if(avformat_find_stream_info(pFormatCtx, NULL)<0) return -1; // Couldn't find stream information // Dump information about file onto standard error av_dump_format(pFormatCtx, 0, finalInputName.c_str(), 0); // -- test code ends --// //--------------------------------------------------------------------------------------------------------------------------------------------------- The output it gives me is (in debug console): //--------------------------------------------------------------------------------------------------------------------------------------------------- Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_input.3gp': Metadata: major_brand : 3gp4 minor_version : 0 compatible_brands: isom3gp4 creation_time : 2013-05-20 11:54:39 Duration: 00:00:23.77, start: 0.000000, bitrate: 5882 kb/s Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D) , yuv420p, 640x480 [SAR 1:1 DAR 4:3], 5752 kb/s, 30.08 fps, 30.08 tbr, 90k tbn, 300 tbc Metadata: creation_time : 2013-05-20 11:54:39 handler_name : VideoHandle Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, stereo, s16, 127 kb/s Metadata: creation_time : 2013-05-20 11:54:39 handler_name : SoundHandle //--------------------------------------------------------------------------------------------------------------------------------------------------- Like in above example, I can read that video is recorded at 30.08 fps, question is: it is apparently very simple for FFmpeg to figure this out, but how can I use this information from my own program? I was trying to follow code from FFmpeg source file (utils.c): [void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)], but was easily lost there. Can anyone kindly guide me how to intercept this problem? Thanks in advance for your time... -------------- next part -------------- An HTML attachment was scrubbed... URL: From brado at bighillsoftware.com Tue May 21 17:35:36 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 08:35:36 -0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> Message-ID: <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> On May 21, 2013, at 7:05 AM, Paul B Mahol wrote: > On 5/21/13, Brad O'Hearne wrote: > > I'm safe to conclude you are troller. In the interest of civility and productivity, let's dispense with this kind of discourse. All it does is intimidate others from posting their questions for fear of getting blasted, and it raises a serious question for businesses as to whether including FFmpeg as a part of a commercial endeavor is support liability -- I don't think any of us wants that. I'm not interested in conflict and enemies, I'm interested in peace and friends, so Paul, if you ever get to Gilbert, AZ, or by chance you are going to be at the WWDC in a few months, hit me off-list, and we can hook up and I'll buy you a drink. To the technical issue -- I've presented a valid issue that effectively breaks the resampling -> encode approach if using the resampling_audio.c example. All I'm asking for is whether or not FFmpeg can handle this, and if not, confirmation that the API can't. If you have an actual answer to the question, I'd love to hear it. Thanks, Brad From brado at bighillsoftware.com Tue May 21 17:53:29 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 08:53:29 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> Message-ID: <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> On May 21, 2013, at 7:26 AM, Kalileo wrote: > I disagree (again). If your player synchronizes audio and video using dts/pts, and as far as I know most do, you can indeed create the weirdest frame rate changes by manipulating dts/pts. I posted a working app with source code to this list a few months ago that demonstrated this was not the case. That was the reason for my continued inquisition about pts/dts. > Which "Playback" , which player ? Every player can have it's own playback logic, nevertheless I don't see where the player logic would require fps to be fixed (unless it ignores dts/pts). I reproduced this behavior by with playback in Wondershare Video Converter Ultimate, VLC, and streaming through Wowza and playback in a browser Flash player. All consistent. > Again i disagree. Just set DTS/PTS accordingly, to compensate for the different fps rate. Been there, done that. Works. It really isn't an issue of agreement, it is an issue of how FFmpeg works. Most of the posts I've seen about variable frame rate have stated that FFmpeg does not support variable frame rate. This was consistent with what I saw in my testing, and moreover, the solution to the problem in my case wasn't solved by setting pts/dts (though I tried for days to no avail), it was solved by sending a fixed frame rate. If what you are saying about pts/dts is true, then I believe by definition FFmpeg would support variable frame rate, because you could send any number of frames at any interval different from time_base.den and just simply correct the situation by setting pts/dts. (FWIW, if my capture source gave my app the exact pts and dts, and FFmpeg couldn't handle it because the frame rate was different than time_base.den). I think the easy way to settle this is just to put it out there -- can someone who knows definitively (not intuition, not guessing, i.e. a developer preferably) answer these two questions: 1. Does FFmpeg support variable frame rate, or not? 2. If I set the time_base.den on the video codec (let's say to 30 fps), can I fire say 12fps at the encoder and compensate for that by setting pts/dts such that the timing won't be incorrect? Thanks, Brad From onemda at gmail.com Tue May 21 18:28:40 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 21 May 2013 16:28:40 +0000 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> Message-ID: On 5/21/13, Brad O'Hearne wrote: > On May 21, 2013, at 7:05 AM, Paul B Mahol wrote: > >> On 5/21/13, Brad O'Hearne wrote: >> >> I'm safe to conclude you are troller. > > In the interest of civility and productivity, let's dispense with this kind > of discourse. All it does is intimidate others from posting their questions > for fear of getting blasted, and it raises a serious question for businesses > as to whether including FFmpeg as a part of a commercial endeavor is support > liability -- I don't think any of us wants that. I'm not interested in > conflict and enemies, I'm interested in peace and friends, so Paul, if you > ever get to Gilbert, AZ, or by chance you are going to be at the WWDC in a > few months, hit me off-list, and we can hook up and I'll buy you a drink. > > To the technical issue -- I've presented a valid issue that effectively > breaks the resampling -> encode approach if using the resampling_audio.c > example. All I'm asking for is whether or not FFmpeg can handle this, and if > not, confirmation that the API can't. If you have an actual answer to the > question, I'd love to hear it. I don't see any problem, ffmpeg can resample and encode at same time. If you want some additional funcionality there is place to report it. Doing something like this: person X creates thread Y about A (not)doing thing B. person X bumps thread Y M-th times in rather unfriendly way. is unproductive and helps nobody. From kalileo at universalx.net Tue May 21 18:34:04 2013 From: kalileo at universalx.net (Kalileo) Date: Tue, 21 May 2013 23:34:04 +0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> Message-ID: <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> On May 21, 2013, at 22:53 , Brad O'Hearne wrote: > On May 21, 2013, at 7:26 AM, Kalileo wrote: > >> Which "Playback" , which player ? Every player can have it's own playback logic, nevertheless I don't see where the player logic would require fps to be fixed (unless it ignores dts/pts). > > I reproduced this behavior by with playback in Wondershare Video Converter Ultimate, VLC, and streaming through Wowza and playback in a browser Flash player. All consistent. Which might simply say that these tools do require a fixed frame rate, or need longer to synchronize, than you gave them time, or that your dts/pts settings were wrong. > 1. Does FFmpeg support variable frame rate, or not? ffmpeg gives you the tools to handle it. Don't mix statements about ffmpeg command line tool with what you can do with the ffmpeg libraries. > > 2. If I set the time_base.den on the video codec (let's say to 30 fps), can I fire say 12fps at the encoder and compensate for that by setting pts/dts such that the timing won't be incorrect? Again, that depends on your player, on how it synchronizes. Don't blame it on ffmpeg when your players / streamers can't handle it. You might want to study the basic old example of a player written using the ffmpeg libraries by Dranger. Seriously. From dev at rarevision.com Tue May 21 18:40:07 2013 From: dev at rarevision.com (Thomas Worth) Date: Tue, 21 May 2013 09:40:07 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> Message-ID: > 1. Does FFmpeg support variable frame rate, or not? If you can playback or re-encode an iPhone video, then yes. MOV/MP4 is _not_ a fixed frame rate format. In other words, there is no "FPS" field/atom in MOV. You set some arbitrary timebase, and the stts atom contains the durations for each of the frames/samples per this timebase. If the frames happen to be all the same timing, then congratulations! Your video has a "fixed" frame rate. However, since the iPhone's MOV writer for some reason uses a timebase of 600, it is impossible to get enough precision to represent "29.97" for each frame perfectly. The only thing to do in this case is to vary each frame's timing slightly to achieve a "nominal" rate of 29.97 (which is what QuickTime Player is always showing). This is why sometimes QuickTime player shows "30.01" or some stupid number for FPS because it's arrived at that figure after doing its math on the timing values in stts. For editing apps, usually there is only one entry in stts, so all frames play at the same rate (fixed). But, all apps reading the file are still showing a nominal frame rate, not a fixed one. > 2. If I set the time_base.den on the video codec (let's say to 30 fps), can I fire say 12fps at the encoder and compensate for that by setting pts/dts such that the timing won't be incorrect? The timescale in MOV is just a timing reference, not a frame rate. Your individual frame timing values determine the playback rate, and the frame rate value shown in any reader. Again, the frame rate can't be read like a field in a header. It has to be calculated by averaging all the timing values in stts. I'm not sure what this means for someone writing with FFmpeg. I've only ever written files for editing purposes, so I don't use variable timing. Have you tried varying the "duration" parameter for each frame rather than only DTS/PTS? From brado at bighillsoftware.com Tue May 21 18:56:21 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 09:56:21 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> Message-ID: <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> On May 21, 2013, at 9:34 AM, Kalileo wrote: >> 1. Does FFmpeg support variable frame rate, or not? > > ffmpeg gives you the tools to handle it. Don't mix statements about ffmpeg command line tool with what you can do with the ffmpeg libraries. Does FFmpeg support variable frame rate? If yes, let's take the specific example of setting time_base.den to 30 fps. How do I send 15 fps to the encoder and ensure accurate playback timing? No theory -- specifics please. I'm not arguing, I'm not calling you wrong, I'm not making platitudes about or branding ffmpeg. I've got code that for months showed me something different and I'm trying to work that out. If you are saying that I should be able to send 15fps at an encoder with time_base.den set to 30, and correct it by setting pts to 1, 3, 5, 7, etc. i.e. every other frame, then I'll construct that case and test it. Is that what you are saying, or something different? > You might want to study the basic old example of a player written using the ffmpeg libraries by Dranger. Seriously. Spent hours with it over months past. That resource, and a few other, helped. Brad From onemda at gmail.com Tue May 21 19:02:02 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 21 May 2013 17:02:02 +0000 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> Message-ID: On 5/21/13, Brad O'Hearne wrote: > On May 21, 2013, at 9:34 AM, Kalileo wrote: > >>> 1. Does FFmpeg support variable frame rate, or not? >> >> ffmpeg gives you the tools to handle it. Don't mix statements about ffmpeg >> command line tool with what you can do with the ffmpeg libraries. > > Does FFmpeg support variable frame rate? If yes, let's take the specific > example of setting time_base.den to 30 fps. How do I send 15 fps to the > encoder and ensure accurate playback timing? No theory -- specifics please. > I'm not arguing, I'm not calling you wrong, I'm not making platitudes about > or branding ffmpeg. I've got code that for months showed me something > different and I'm trying to work that out. If you are saying that I should > be able to send 15fps at an encoder with time_base.den set to 30, and > correct it by setting pts to 1, 3, 5, 7, etc. i.e. every other frame, then > I'll construct that case and test it. Is that what you are saying, or > something different? Something like that, but also AVPacket.duration of each packet should be set in AVPacket.time_base units > >> You might want to study the basic old example of a player written using >> the ffmpeg libraries by Dranger. Seriously. > > Spent hours with it over months past. That resource, and a few other, > helped. > > Brad > > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From stebbins at jetheaddev.com Tue May 21 19:20:38 2013 From: stebbins at jetheaddev.com (John Stebbins) Date: Tue, 21 May 2013 10:20:38 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> Message-ID: <519BACE6.70201@jetheaddev.com> On 05/21/2013 10:02 AM, Paul B Mahol wrote: > On 5/21/13, Brad O'Hearne wrote: >> On May 21, 2013, at 9:34 AM, Kalileo wrote: >> >>>> 1. Does FFmpeg support variable frame rate, or not? >>> ffmpeg gives you the tools to handle it. Don't mix statements about ffmpeg >>> command line tool with what you can do with the ffmpeg libraries. >> Does FFmpeg support variable frame rate? If yes, let's take the specific >> example of setting time_base.den to 30 fps. How do I send 15 fps to the >> encoder and ensure accurate playback timing? No theory -- specifics please. >> I'm not arguing, I'm not calling you wrong, I'm not making platitudes about >> or branding ffmpeg. I've got code that for months showed me something >> different and I'm trying to work that out. If you are saying that I should >> be able to send 15fps at an encoder with time_base.den set to 30, and >> correct it by setting pts to 1, 3, 5, 7, etc. i.e. every other frame, then >> I'll construct that case and test it. Is that what you are saying, or >> something different? > Something like that, but also AVPacket.duration of each packet should > be set in AVPacket.time_base units > >>> You might want to study the basic old example of a player written using >>> the ffmpeg libraries by Dranger. Seriously. >> Spent hours with it over months past. That resource, and a few other, >> helped. >> >> Brad >> >> >> >> Hmm, I've recently started an effort to use libav for muxing in HandBrake. https://reviews.handbrake.fr/r/494/ HandBrake does variable framerate encoding by default. I haven't seen any synchronization issues as of yet (in mplayer or vlc). As a test, I just ran the worst variable rate sample I have through this new code and don't see any problems from beginning to end. My sample is a DVD that switches constantly between film and ntsc rates. Do any of you have variable rate sources that you can demonstrate this problem with? I would be glad to test them. -- John GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01 83F0 49F1 D7B2 60D4 D0F7 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: OpenPGP digital signature URL: From brado at bighillsoftware.com Tue May 21 19:36:06 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 10:36:06 -0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> Message-ID: On May 21, 2013, at 9:28 AM, Paul B Mahol wrote: > I don't see any problem, ffmpeg can resample and encode at same time. I didn't see any problem in principle either. In practice, it all works fine until encountering an audio device with a lower sample rate that pushes the resampled frame size above the codec's max frame size, then it blows up. Here's the problem: source sample rate = 16000 source number of samples = 512 destination sample rate = 44100 (using libmp3lame, which sets its frame size to 1152). if you resample prior to encoding, av_encode_audio2 fails with error -22, due to libavcodec's utils.c line 1208 as the result of this check in the preceding line failing: if (frame->nb_samples > avctx->frame_size) { If you do it your suggested way, letting av_encode_audio2 handle both the resampling and encoding, FFmpeg crashes outright. However, if you use a source sample rate of 44100, or 48000 (no other changes to above data) everything works fine. That's the problem. Brad -------------- next part -------------- An HTML attachment was scrubbed... URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: Screen Shot 2013-05-21 at 10.30.52 AM.png Type: image/png Size: 16642 bytes Desc: not available URL: From onemda at gmail.com Tue May 21 20:02:54 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 21 May 2013 18:02:54 +0000 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> Message-ID: On 5/21/13, Brad O'Hearne wrote: > On May 21, 2013, at 9:28 AM, Paul B Mahol wrote: > >> I don't see any problem, ffmpeg can resample and encode at same time. > > I didn't see any problem in principle either. In practice, it all works fine > until encountering an audio device with a lower sample rate that pushes the > resampled frame size above the codec's max frame size, then it blows up. > Here's the problem: > > source sample rate = 16000 > source number of samples = 512 > destination sample rate = 44100 > (using libmp3lame, which sets its frame size to 1152). You told that already, you enjoy repeating yourself, do you? > > if you resample prior to encoding, av_encode_audio2 fails with error -22, > due to libavcodec's utils.c line 1208 as the result of this check in the > preceding line failing: > > if (frame->nb_samples > avctx->frame_size) { > > If you do it your suggested way, letting av_encode_audio2 handle both the > resampling and encoding, FFmpeg crashes outright. You are spreading false claims yet again. Where I suggested that way? The only one who sugested such nonsense (multiple times) is you. > > > > However, if you use a source sample rate of 44100, or 48000 (no other > changes to above data) everything works fine. That's the problem. You still fail to see the real problem. Send exact number of samples that encoder wants, if there is samples left put them in fifo list and use them later. > > Brad From praks411 at gmail.com Tue May 21 20:10:40 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Tue, 21 May 2013 11:10:40 -0700 (PDT) Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> Message-ID: <1369159840953-4657677.post@n4.nabble.com> I had similar issue sometime back. I matched the number of sample to that of codec context. I have used buffering scheme and which still working for me, so I didn't explore any other option. I used intermediate buffer to keep the remaining samples and pass them to encoder when number of sample equals that of codec context. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-of-audio-samples-calculated-vs-codec-context-tp4657632p4657677.html Sent from the libav-users mailing list archive at Nabble.com. From brado at bighillsoftware.com Tue May 21 20:41:05 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 11:41:05 -0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: <1369159840953-4657677.post@n4.nabble.com> References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> <1369159840953-4657677.post@n4.nabble.com> Message-ID: On May 21, 2013, at 11:10 AM, Pradeep Karosiya wrote: > I had similar issue sometime back. I matched the number of sample to that of > codec context. I have used buffering scheme and which still working for me, > so I didn't explore any other option. > I used intermediate buffer to keep the remaining samples and pass them to > encoder when number of sample equals that of codec context. Thank you for your help, Pradeep. You not only confirmed the issue I"m seeing, but made clear that you had to roll your own code (vs. use some FFmpeg facility) to get it to work. That's the kind of informative answer I was looking for. I'll do the same. This situation would be good to address in either decoding_enocding.c or resampling_audio.c, and documentation somewhere. Thanks, Brad From onemda at gmail.com Tue May 21 20:46:42 2013 From: onemda at gmail.com (Paul B Mahol) Date: Tue, 21 May 2013 18:46:42 +0000 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> <1369159840953-4657677.post@n4.nabble.com> Message-ID: On 5/21/13, Brad O'Hearne wrote: > On May 21, 2013, at 11:10 AM, Pradeep Karosiya wrote: > >> I had similar issue sometime back. I matched the number of sample to that >> of >> codec context. I have used buffering scheme and which still working for >> me, >> so I didn't explore any other option. >> I used intermediate buffer to keep the remaining samples and pass them to >> encoder when number of sample equals that of codec context. > > Thank you for your help, Pradeep. You not only confirmed the issue I"m > seeing, but made clear that you had to roll your own code (vs. use some > FFmpeg facility) to get it to work. That's the kind of informative answer I > was looking for. I'll do the same. > > This situation would be good to address in either decoding_enocding.c or > resampling_audio.c, and documentation somewhere. One can use libavcodec/audio_frame_queue.c > > Thanks, > > Brad > > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From brado at bighillsoftware.com Tue May 21 20:46:48 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 11:46:48 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <519BACE6.70201@jetheaddev.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> Message-ID: <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> On May 21, 2013, at 10:20 AM, John Stebbins wrote: > Do any of you have > variable rate sources that you can demonstrate this problem with? Yes, I do, and I would be very happy to have you take a look at and test it. I had a source code sample posted for several weeks which demonstrated this. It is still available, but the code has moved on a bit since then (to actually solving the problem), so it would take some extra coding to revert back to an isolated example of this. At the moment I'm pressed for time in trying to solve an audio problem (which is the topic of the other thread about audio samples), but once I get that done and can spring some time I'll revisit this, clean up the example, and ping you. Thanks for the offer, Brad From brado at bighillsoftware.com Tue May 21 20:52:59 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 11:52:59 -0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> <1369159840953-4657677.post@n4.nabble.com> Message-ID: On May 21, 2013, at 11:46 AM, Paul B Mahol wrote: > One can use libavcodec/audio_frame_queue.c Thank you, Paul. Are you aware of a code sample which demonstrates use? The header is simple enough, but I want to avoid having to make any assumptions about is function, proper use, or nuances of its behavior. Thanks, Brad From stebbins at jetheaddev.com Tue May 21 20:54:20 2013 From: stebbins at jetheaddev.com (John Stebbins) Date: Tue, 21 May 2013 11:54:20 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> Message-ID: <519BC2DC.1060309@jetheaddev.com> On 05/21/2013 11:46 AM, Brad O'Hearne wrote: > On May 21, 2013, at 10:20 AM, John Stebbins wrote: > >> Do any of you have >> variable rate sources that you can demonstrate this problem with? > Yes, I do, and I would be very happy to have you take a look at and test it. I had a source code sample posted for several weeks which demonstrated this. It is still available, but the code has moved on a bit since then (to actually solving the problem), so it would take some extra coding to revert back to an isolated example of this. At the moment I'm pressed for time in trying to solve an audio problem (which is the topic of the other thread about audio samples), but once I get that done and can spring some time I'll revisit this, clean up the example, and ping you. > > Thanks for the offer, > I think we may have crossed wires here. By "sources" I meant source video that I can run through my code to verify that VFR is possible and works correctly using avformat mov muxer. -- John GnuPG fingerprint: D0EC B3DB C372 D1F1 0B01 83F0 49F1 D7B2 60D4 D0F7 -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 490 bytes Desc: OpenPGP digital signature URL: From brado at bighillsoftware.com Tue May 21 21:08:31 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Tue, 21 May 2013 12:08:31 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <519BC2DC.1060309@jetheaddev.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> Message-ID: <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> On May 21, 2013, at 11:54 AM, John Stebbins wrote: > I think we may have crossed wires here. By "sources" I meant source video that I can run through my code to verify that > VFR is possible and works correctly using avformat mov muxer. Oh, then in that case no I do not. My source video is live capture, which is being encoded to FLV. Brad From Steve.Rothkin at Honeywell.com Tue May 21 21:52:57 2013 From: Steve.Rothkin at Honeywell.com (Rothkin, Steve (NY81)) Date: Tue, 21 May 2013 19:52:57 +0000 Subject: [Libav-user] Intermittent heap crash with Visual Studio 2005 Message-ID: <0ED54485BDF923428E38AB27448A35771A0B6A65@de08ex3007.global.ds.honeywell.com> I followed the instructions at http://www.ffmpeg.org/platform.html#Crosscompilation-for-Windows-under-Cygwin to build FFMPEG windows DLLs for GPL2. I use the following commands in cygwin to configure and build it: ./configure --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin --disable-programs --disable-doc --disable-swresample --disable-postproc --disable-zlib --disable-bzlib --disable-pthreads --disable-os2threads --enable-w32threads --arch=x86 --enable-runtime-cpudetect ; make ; make install My program is currently built in Visual Studio 2005 (though I will move to 2012 once another team member finishes migrating our projects and getting them all to build correctly). With just 1 or 2 threads it works fine most of the time (I'm using avformat to read various video clips, and convert/rescale to YUV420P which is what our processing module needs; I'm also using libavcodec to encode and decode JPEGs of single frames). However, when I get more threads running (e.g. 5 videos being processed in parallel and JPEG frames being streamed to a viewer) I'm getting intermittent crashes in the DLLs. Often the crash is in the heap manager (e.g. mscvrt.dll!_malloc called from avutil-52.dll). Unfortunately, even disabling stripping of the output, Visual Studio doesn't tell me anything about locations within the DLLs (and Bounds Checker probably won't be much help for the same reason), and av_log_set_level(AV_LOG_DEBUG) didn't give me more info. Adding --assert-level=2 --enable-memory-poisoning --enable-ftrapv --disable-stripping to the configure command makes it crash faster/more often but still doesn't give me any "smoking guns". I built from http://www.ffmpeg.org/releases/ffmpeg-1.2.1.tar.bz2, but I've also tried 1.2 and http://www.ffmpeg.org/releases/ffmpeg-snapshot.tar.bz2 (last night's build). I had similar results with all 3. I do have a lock manager registered with av_lockmgr_register(ffmpeg_lockmgr): extern "C" static int ffmpeg_lockmgr(void **mtx, enum AVLockOp op) { AE_ASSERT(mtx,"ffmpeg_lockmgr: NULL param"); AE_ASSERT(*mtx || (op == AV_LOCK_CREATE),"ffmpeg_lockmgr: NULL *mtx"); AE_Mutex *pMutex = (AE_Mutex *) *mtx; switch(op) { case AV_LOCK_CREATE: AE_CALLOC_CHECK_GOTO_VOID(pMutex,AE_Mutex,1); AE_CHECK_GOTO_VOID(ae_mutex_init(pMutex)); *mtx = pMutex; return 0; case AV_LOCK_OBTAIN: AE_CHECK_GOTO_VOID(ae_mutex_lock(pMutex)); return 0; case AV_LOCK_RELEASE: ae_mutex_release(pMutex); return 0; case AV_LOCK_DESTROY: ae_mutex_finish(pMutex); AE_CLEANUP(*mtx); return 0; default: ae_log(AE_LOG_ERROR,"ffmpeg_lockmgr: unrecognized op %d",op); } error: return -1; } One thing I've noticed several times (but not every crash) is my lock manager getting called with an op value of 0xCCCCCCCC (the uninitialized variable value). I checked every place in the source code that calls the lock manager callback and hard-coded defines are always used for the op value, so I'm wondering if the calling convention is wrong and I need to add something (or maybe it is just a corruption of the stack backtrace displayed in Visual Studio since the lock manager seems to work fine most of the time and the program breaks quickly with a codec threading warning when I don't register the lock manager). I also register my own log handler with av_log_set_callback(ffmpeg_log) to redirect the log (though commenting out the registration doesn't avoid the crash). extern "C" static void ffmpeg_log(void *ptr, int level, const char *fmt, va_list vargs) { int loglevel = av_log_get_level(); if (level > loglevel) return; AE_LogType type; if (level <= AV_LOG_FATAL) { type = AE_LOG_FATAL; } else if (level <= AV_LOG_ERROR) { type = AE_LOG_ERROR; } else if (level <= AV_LOG_WARNING) { type = AE_LOG_WARNING; } else if (level <= AV_LOG_INFO) { type = AE_LOG_INFO; } else { type = AE_LOG_DEBUG; } char line[2048]; static int print_prefix = 1; av_log_format_line(ptr, level, fmt, vargs, line, sizeof(line), &print_prefix); ae_log(type, "FFMPEG: %s",line); } I did find an old (2009) mention at http://japanesesoapbox.blogspot.com/2009/09/ffmpeg-and-mingw.html of some issue with vararg passing, but for the most part my log messages seem to come out correctly so maybe that issue was fixed in the last 4 years. I tried building FFMPEG with Visual Studio 2012 following the instructions at http://www.ffmpeg.org/platform.html#Microsoft-Visual-C_002b_002b. In MSYS I was able to get the build to go most of the way through but it chokes on some PERL within the scripts/makefiles and I couldn't get past that without trying to debug those make files. Trying to build with Visual Studio in Cygwin doesn't work at all because I end up with clashes between the CL executables from cygwin and visual studio. And I had absolutely no luck at trying to natively compile ffmpeg within the visual studio 2012 IDE (due to the lack of C99 support). The crash seems to be related to my use of the MJPEG codec to create JPEGs since it goes away if I turn off that code (JPEGging does work fine until it crashes). The JPEGging code (summary without the error handling) is: m_pCodec = avcodec_find_encoder(AV_CODEC_ID_MJPEG); m_pCodecCtx=avcodec_alloc_context3(m_pCodec); m_pCodecCtx->pix_fmt = m_targetPixelFormat = AV_PIX_FMT_YUVJ420P; m_pCodecCtx->color_range = AVCOL_RANGE_JPEG; av_init_packet(&m_packet); m_packet.data = NULL; m_packet.size = 0; m_pCodecCtx->width = m_targetWidth; m_pCodecCtx->height = m_targetHeight; m_pCodecCtx->time_base.num = 1; m_pCodecCtx->time_base.den = 1; // Arbitrary frame rate - 1 fps avcodec_open2(m_pCodecCtx, m_pCodec,NULL); m_pFrame->pts = 0; if ((downscaleWidth > 1) || (downscaleHeight > 1)) { // Point m_pFrame directly at data in pImg img.GetFfmpegArraysFromImage(m_pFrame->data,m_pFrame->linesize); m_pFrame->width = pImg->size.width; m_pFrame->height = pImg->size.height; // Convert to target color model / size ConvertScaleImg(m_tmpImage2); // Now point at converted image img.m_pImage = pImg = m_tmpImage2; } // Finish setting up frame as source for JPEG img.GetFfmpegArraysFromImage(m_pFrame->data,m_pFrame->linesize); m_pFrame->format = AV_PIX_FMT_YUV420P; m_pFrame->width = m_pCodecCtx->width; m_pFrame->height = m_pCodecCtx->height; avcodec_encode_video2(m_pCodecCtx, &m_packet, m_pFrame, &got_output); // Copy JPEG to output buffer ae_memcpy(*jpgBuffer,m_packet.data,m_packet.size); *jpgSize = m_packet.size; av_free_packet(&m_packet); void CAE_FfmpegCommon::ConvertScaleImg(CAE_FfmpegImage & outImg) { // Get context for converting/scaling image. Reuses current one if possible. m_pSwsContext = sws_getCachedContext(m_pSwsContext, m_pFrame->width,m_pFrame->height,m_pCodecCtx->pix_fmt, m_targetWidth,m_targetHeight,m_targetPixelFormat, SWS_BILINEAR,NULL,NULL,NULL); /* Setup arrays with pointers to planes of destination image. */ uint8_t *dst_data[FFMPEG_NUM_PLANES]; int dst_linesize[FFMPEG_NUM_PLANES]; outImg.GetFfmpegArraysFromImage(dst_data, dst_linesize); // convert to destination format sws_scale(m_pSwsContext, m_pFrame->data, m_pFrame->linesize, 0, m_pFrame->height,dst_data, dst_linesize); } void CAE_FfmpegImage::GetFfmpegArraysFromImage(uint8_t *pointers[FFMPEG_NUM_PLANES], int linesizes[FFMPEG_NUM_PLANES]) { for (int i=0;ipPlane[i].pPtr; linesizes[i] = m_pImage->pPlane[i].stride; } } Any suggestions for fixing this crash? Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From andrey.krieger.utkin at gmail.com Tue May 21 22:08:41 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Tue, 21 May 2013 23:08:41 +0300 Subject: [Libav-user] Intermittent heap crash with Visual Studio 2005 In-Reply-To: <0ED54485BDF923428E38AB27448A35771A0B6A65@de08ex3007.global.ds.honeywell.com> References: <0ED54485BDF923428E38AB27448A35771A0B6A65@de08ex3007.global.ds.honeywell.com> Message-ID: 2013/5/21 Rothkin, Steve (NY81) : > Any suggestions for fixing this crash? Try to make up minimal but compilable and working snippet which reproduces addressed problem, and makes issue reproduction easy. Then you could either recheck it by yourself or publish it there so people can immediately compile it on their own and try debugging it. As far as i know majority of ffmpeg developers uses Linux, so consider making your minimal issue reproduction case to be working on Linux. -- Andrey Utkin From cehoyos at ag.or.at Tue May 21 22:05:34 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 21 May 2013 20:05:34 +0000 (UTC) Subject: [Libav-user] Intermittent heap crash with Visual Studio 2005 References: <0ED54485BDF923428E38AB27448A35771A0B6A65@de08ex3007.global.ds.honeywell.com> Message-ID: Rothkin, Steve (NY81 writes: > However, when I get more threads running (e.g. 5 > videos being processed in parallel and JPEG frames > being streamed to a viewer) I'm getting intermittent > crashes in the DLLs. Please either provide gdb information as explained on http://ffmpeg.org/bugreports.html or compile FFmpeg with Visual Studio if you prefer MS debugging. Carl Eugen From Steve.Rothkin at Honeywell.com Tue May 21 22:14:32 2013 From: Steve.Rothkin at Honeywell.com (Rothkin, Steve (NY81)) Date: Tue, 21 May 2013 20:14:32 +0000 Subject: [Libav-user] Intermittent heap crash with Visual Studio 2005 In-Reply-To: References: <0ED54485BDF923428E38AB27448A35771A0B6A65@de08ex3007.global.ds.honeywell.com> Message-ID: <0ED54485BDF923428E38AB27448A35771A0B6AAA@de08ex3007.global.ds.honeywell.com> > Please either provide gdb information as explained on > http://ffmpeg.org/bugreports.html or compile FFmpeg with Visual Studio if you prefer > MS debugging. How do I get gdb information when the main program is running with Visual Studio? I would love to compile it with visual studio and have all the symbolic debugging info available. However, I have not been able to successfully build it with VS2005, 2008, 2010, or 2012. I tried the instructions at http://ffmpeg.org/platform.html#Microsoft-Visual-C_002b_002b but I got failures in make that I haven't tried to debug yet. From cehoyos at ag.or.at Tue May 21 22:17:15 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Tue, 21 May 2013 20:17:15 +0000 (UTC) Subject: [Libav-user] Intermittent heap crash with Visual Studio 2005 References: <0ED54485BDF923428E38AB27448A35771A0B6A65@de08ex3007.global.ds.honeywell.com> <0ED54485BDF923428E38AB27448A35771A0B6AAA@de08ex3007.global.ds.honeywell.com> Message-ID: Rothkin, Steve (NY81 writes: > I have not been able to successfully build it with > VS2005, 2008, 2010, or 2012. I tried the instructions at > http://ffmpeg.org/platform.html#Microsoft-Visual-C_002b_002b > but I got failures in make Would you like to tell us about those failures? Carl Eugen From huanggh0108 at sina.com Wed May 22 02:58:15 2013 From: huanggh0108 at sina.com (Guohui Huang) Date: Wed, 22 May 2013 08:58:15 +0800 Subject: [Libav-user] Reading correct frame rate (fps) of input video In-Reply-To: References: Message-ID: <519C181B.8010205@sina.com> You can get frame rate as follow: AVStream *st = pFormatCtx->streams[your_video_index]; double frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; 2013-05-22 Guohui Huang ????Taha Ansari ?????2013-05-21 23:04 ???[Libav-user] Reading correct frame rate (fps) of input video ????"This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter." ??? Hi! I am trying to read exact values for frame rate (fps) from any input video file. I have been trying to debug different structures like AVFormatCtx, etc. but cannot seem to figure it out. For a test case, here is the code I have managed (just the source snippet, include files etc. are all understandable): //--------------------------------------------------------------------------------------------------------------------------------------------------- // ++ test code begins ++// av_register_all(); avcodec_register_all(); avformat_network_init(); avdevice_register_all(); AVFormatContext *pFormatCtx = NULL; pFormatCtx = avformat_alloc_context(); string finalInputName = "test_input.3gp"; avformat_open_input(&pFormatCtx, finalInputName.c_str(), NULL, NULL); if ( pFormatCtx == NULL || pFormatCtx->iformat == NULL ) { return -1; } // Retrieve stream information if(avformat_find_stream_info(pFormatCtx, NULL)<0) return -1; // Couldn't find stream information // Dump information about file onto standard error av_dump_format(pFormatCtx, 0, finalInputName.c_str(), 0); // -- test code ends --// //--------------------------------------------------------------------------------------------------------------------------------------------------- The output it gives me is (in debug console): //--------------------------------------------------------------------------------------------------------------------------------------------------- Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_input.3gp': Metadata: major_brand : 3gp4 minor_version : 0 compatible_brands: isom3gp4 creation_time : 2013-05-20 11:54:39 Duration: 00:00:23.77, start: 0.000000, bitrate: 5882 kb/s Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / 0x7634706D) , yuv420p, 640x480 [SAR 1:1 DAR 4:3], 5752 kb/s, 30.08 fps, 30.08 tbr, 90k tbn, 300 tbc Metadata: creation_time : 2013-05-20 11:54:39 handler_name : VideoHandle Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, stereo, s16, 127 kb/s Metadata: creation_time : 2013-05-20 11:54:39 handler_name : SoundHandle //--------------------------------------------------------------------------------------------------------------------------------------------------- Like in above example, I can read that video is recorded at 30.08 fps, question is: it is apparently very simple for FFmpeg to figure this out, but how can I use this information from my own program? I was trying to follow code from FFmpeg source file (utils.c): [void av_dump_format(AVFormatContext *ic, int index, const char *url, int is_output)], but was easily lost there. Can anyone kindly guide me how to intercept this problem? Thanks in advance for your time... -------------- next part -------------- An HTML attachment was scrubbed... URL: From john.orr at scala.com Wed May 22 04:01:12 2013 From: john.orr at scala.com (John Orr) Date: Tue, 21 May 2013 22:01:12 -0400 Subject: [Libav-user] avformat_open_input failes for > 2gb In-Reply-To: <1369144763565-4657658.post@n4.nabble.com> References: <1369144763565-4657658.post@n4.nabble.com> Message-ID: <519C26E8.2000407@scala.com> On 5/21/2013 9:59 AM, Steffen wrote: > Hi, > avformat_open_input returns an error fpr files >2gb. It seems because of > call to file_seek and lseek in file file.c. The given pos is int64 but lseek > only accepts a long, so it returns a -22. > ffplay and ffmpeg works with same file. What do I wrong? IF you are compiling with Visual Studio, this might be a bug that was fixed a few months back. I think the fix is only in the git master and not, for example, in the 1.2.1 release. The fixed files I believe were: libavformat/os_support.h libavformat/os_support.c --Johno From mtaha.ansari at gmail.com Wed May 22 05:48:28 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 22 May 2013 08:48:28 +0500 Subject: [Libav-user] Reading correct frame rate (fps) of input video In-Reply-To: <519C181B.8010205@sina.com> References: <519C181B.8010205@sina.com> Message-ID: Hi Guohui Huan! Many thanks for your guidance, I have got it working now! Thanks once again... On Wed, May 22, 2013 at 5:58 AM, Guohui Huang wrote: > ** > You can get frame rate as follow: > AVStream *st = pFormatCtx->streams[your_video_index]; > double frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; > > 2013-05-22 > ------------------------------ > Guohui Huang > ------------------------------ > *????*Taha Ansari > *?????*2013-05-21 23:04 > *???*[Libav-user] Reading correct frame rate (fps) of input video > *????*"This list is about using libavcodec, libavformat, libavutil, > libavdevice and libavfilter." > *???* > > Hi! > > I am trying to read exact values for frame rate (fps) from any input video > file. I have been trying to debug different structures like AVFormatCtx, > etc. but cannot seem to figure it out. For a test case, here is the code I > have managed (just the source snippet, include files etc. are all > understandable): > > > //--------------------------------------------------------------------------------------------------------------------------------------------------- > // ++ test code begins ++// > av_register_all(); > avcodec_register_all(); > avformat_network_init(); > avdevice_register_all(); > AVFormatContext *pFormatCtx = NULL; > pFormatCtx = avformat_alloc_context(); > string finalInputName = "test_input.3gp"; > avformat_open_input(&pFormatCtx, finalInputName.c_str(), NULL, NULL); > if ( pFormatCtx == NULL || > pFormatCtx->iformat == NULL ) > { > return -1; > } > // Retrieve stream information > if(avformat_find_stream_info(pFormatCtx, NULL)<0) > return -1; // Couldn't find stream information > > // Dump information about file onto standard error > av_dump_format(pFormatCtx, 0, finalInputName.c_str(), 0); > // -- test code ends --// > > //--------------------------------------------------------------------------------------------------------------------------------------------------- > > The output it gives me is (in debug console): > > > //--------------------------------------------------------------------------------------------------------------------------------------------------- > Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_input.3gp': > Metadata: > major_brand : 3gp4 > minor_version : 0 > compatible_brands: isom3gp4 > creation_time : 2013-05-20 11:54:39 > Duration: 00:00:23.77, start: 0.000000, bitrate: 5882 kb/s > Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / > 0x7634706D) > , yuv420p, 640x480 [SAR 1:1 DAR 4:3], 5752 kb/s, 30.08 fps, 30.08 tbr, 90k > tbn, > 300 tbc > Metadata: > creation_time : 2013-05-20 11:54:39 > handler_name : VideoHandle > Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, stereo, > s16, 127 > kb/s > Metadata: > creation_time : 2013-05-20 11:54:39 > handler_name : SoundHandle > > //--------------------------------------------------------------------------------------------------------------------------------------------------- > > Like in above example, I can read that video is recorded at 30.08 fps, > question is: it is apparently very simple for FFmpeg to figure this out, > but how can I use this information from my own program? I was trying to > follow code from FFmpeg source file (utils.c): [void > av_dump_format(AVFormatContext *ic, int index, const char *url, int > is_output)], but was easily lost there. > > Can anyone kindly guide me how to intercept this problem? > > Thanks in advance for your time... > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From mtaha.ansari at gmail.com Wed May 22 09:12:08 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 22 May 2013 12:12:08 +0500 Subject: [Libav-user] Reading correct frame rate (fps) of input video In-Reply-To: References: <519C181B.8010205@sina.com> Message-ID: I just noticed one more thing: using: AVStream *st = pFormatCtx->streams[your_video_index]; double frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; gives me correct values for 3gp files. When I tried this code on an MP4 file, I got about 49.9 value, which was incorrect (actual was 25); looking at other values, I tried following: AVStream *st = pFormatCtx->streams[your_video_index ]; double frame_rate = st->avg_frame_rate.num / (double)st->avg_frame_rate.den; It worked fine for MP4: {num=25 den=1 }, and for 3gp, I get: {num=64350000 den=2139391 } (30.078 FPS), which is also correct. So I assume this might be better structure to refer to, until it breaks again on another video...? On Wed, May 22, 2013 at 8:48 AM, Taha Ansari wrote: > Hi Guohui Huan! > > Many thanks for your guidance, I have got it working now! > > Thanks once again... > > > On Wed, May 22, 2013 at 5:58 AM, Guohui Huang wrote: > >> ** >> You can get frame rate as follow: >> AVStream *st = pFormatCtx->streams[your_video_index]; >> double frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; >> >> 2013-05-22 >> ------------------------------ >> Guohui Huang >> ------------------------------ >> *????*Taha Ansari >> *?????*2013-05-21 23:04 >> *???*[Libav-user] Reading correct frame rate (fps) of input video >> *????*"This list is about using libavcodec, libavformat, libavutil, >> libavdevice and libavfilter." >> *???* >> >> Hi! >> >> I am trying to read exact values for frame rate (fps) from any input >> video file. I have been trying to debug different structures like >> AVFormatCtx, etc. but cannot seem to figure it out. For a test case, here >> is the code I have managed (just the source snippet, include files etc. are >> all understandable): >> >> >> //--------------------------------------------------------------------------------------------------------------------------------------------------- >> // ++ test code begins ++// >> av_register_all(); >> avcodec_register_all(); >> avformat_network_init(); >> avdevice_register_all(); >> AVFormatContext *pFormatCtx = NULL; >> pFormatCtx = avformat_alloc_context(); >> string finalInputName = "test_input.3gp"; >> avformat_open_input(&pFormatCtx, finalInputName.c_str(), NULL, NULL); >> if ( pFormatCtx == NULL || >> pFormatCtx->iformat == NULL ) >> { >> return -1; >> } >> // Retrieve stream information >> if(avformat_find_stream_info(pFormatCtx, NULL)<0) >> return -1; // Couldn't find stream information >> >> // Dump information about file onto standard error >> av_dump_format(pFormatCtx, 0, finalInputName.c_str(), 0); >> // -- test code ends --// >> >> //--------------------------------------------------------------------------------------------------------------------------------------------------- >> >> The output it gives me is (in debug console): >> >> >> //--------------------------------------------------------------------------------------------------------------------------------------------------- >> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_input.3gp': >> Metadata: >> major_brand : 3gp4 >> minor_version : 0 >> compatible_brands: isom3gp4 >> creation_time : 2013-05-20 11:54:39 >> Duration: 00:00:23.77, start: 0.000000, bitrate: 5882 kb/s >> Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / >> 0x7634706D) >> , yuv420p, 640x480 [SAR 1:1 DAR 4:3], 5752 kb/s, 30.08 fps, 30.08 tbr, >> 90k tbn, >> 300 tbc >> Metadata: >> creation_time : 2013-05-20 11:54:39 >> handler_name : VideoHandle >> Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, stereo, >> s16, 127 >> kb/s >> Metadata: >> creation_time : 2013-05-20 11:54:39 >> handler_name : SoundHandle >> >> //--------------------------------------------------------------------------------------------------------------------------------------------------- >> >> Like in above example, I can read that video is recorded at 30.08 fps, >> question is: it is apparently very simple for FFmpeg to figure this out, >> but how can I use this information from my own program? I was trying to >> follow code from FFmpeg source file (utils.c): [void >> av_dump_format(AVFormatContext *ic, int index, const char *url, int >> is_output)], but was easily lost there. >> >> Can anyone kindly guide me how to intercept this problem? >> >> Thanks in advance for your time... >> >> _______________________________________________ >> Libav-user mailing list >> Libav-user at ffmpeg.org >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From praks411 at gmail.com Wed May 22 09:04:57 2013 From: praks411 at gmail.com (Pradeep Karosiya) Date: Wed, 22 May 2013 00:04:57 -0700 (PDT) Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> <1369159840953-4657677.post@n4.nabble.com> Message-ID: <1369206297892-4657693.post@n4.nabble.com> Hi Brad, Actually at that time I didn't explore much and since I already had my own buffer class I quickly reused it. But if there are some other better facility available in ffmpeg like libavcodec/audio_frame_queue.c I suggest you cantry that. Thanks Pradeep -- View this message in context: http://libav-users.943685.n4.nabble.com/Libav-user-of-audio-samples-calculated-vs-codec-context-tp4657632p4657693.html Sent from the libav-users mailing list archive at Nabble.com. From mtaha.ansari at gmail.com Wed May 22 09:28:42 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 22 May 2013 12:28:42 +0500 Subject: [Libav-user] Reading correct frame rate (fps) of input video In-Reply-To: References: <519C181B.8010205@sina.com> Message-ID: Like I spoke too soon, (I have also included time_base structure): when tried on: - FLV file: for r_frame_rate: {num=15 den=1 }, for avg_frame_rate: {num=0 den=0 }, for time_base: {num=1 den=1000 } - WMV file: for r_frame_rate: {num=15 den=1 }, for avg_frame_rate: {num=0 den=0 }, for time_base: {num=1 den=1000 } - AVI file: for r_frame_rate: {num=15 den=1 }, for avg_frame_rate:{num=0 den=0 }, for time_base: {num=1 den=15 } - 3gp file: for r_frame_rate: {num=361 den=12 }, for avg_frame_rate: {num=64350000 den=2139391 }, for time_base: {num=1 den=90000 } (30.08, 30.078 fps respectively) - MP4 file: for r_frame_rate: {num=599 den=12 }, for avg_frame_rate: {num=25 den=1 }, for time_base: {num=1 den=90000 } (49.9, 25 fps respectively - first figure is wrong). So, is there any way to know for sure which structure I could surely rely on? Thanks again for your time.. On Wed, May 22, 2013 at 12:12 PM, Taha Ansari wrote: > I just noticed one more thing: > > using: > > > AVStream *st = pFormatCtx->streams[your_video_index]; > double frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; > > gives me correct values for 3gp files. When I tried this code on an MP4 > file, I got about 49.9 value, which was incorrect (actual was 25); looking > at other values, I tried following: > > > AVStream *st = pFormatCtx->streams[your_video_index ]; > double frame_rate = st->avg_frame_rate.num / > (double)st->avg_frame_rate.den; > > It worked fine for MP4: {num=25 den=1 }, and for 3gp, I get: {num=64350000 > den=2139391 } (30.078 FPS), which is also correct. > > So I assume this might be better structure to refer to, until it breaks > again on another video...? > > > On Wed, May 22, 2013 at 8:48 AM, Taha Ansari wrote: > >> Hi Guohui Huan! >> >> Many thanks for your guidance, I have got it working now! >> >> Thanks once again... >> >> >> On Wed, May 22, 2013 at 5:58 AM, Guohui Huang wrote: >> >>> ** >>> You can get frame rate as follow: >>> AVStream *st = pFormatCtx->streams[your_video_index]; >>> double frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; >>> >>> 2013-05-22 >>> ------------------------------ >>> Guohui Huang >>> ------------------------------ >>> *????*Taha Ansari >>> *?????*2013-05-21 23:04 >>> *???*[Libav-user] Reading correct frame rate (fps) of input video >>> *????*"This list is about using libavcodec, libavformat, libavutil, >>> libavdevice and libavfilter." >>> *???* >>> >>> Hi! >>> >>> I am trying to read exact values for frame rate (fps) from any input >>> video file. I have been trying to debug different structures like >>> AVFormatCtx, etc. but cannot seem to figure it out. For a test case, here >>> is the code I have managed (just the source snippet, include files etc. are >>> all understandable): >>> >>> >>> //--------------------------------------------------------------------------------------------------------------------------------------------------- >>> // ++ test code begins ++// >>> av_register_all(); >>> avcodec_register_all(); >>> avformat_network_init(); >>> avdevice_register_all(); >>> AVFormatContext *pFormatCtx = NULL; >>> pFormatCtx = avformat_alloc_context(); >>> string finalInputName = "test_input.3gp"; >>> avformat_open_input(&pFormatCtx, finalInputName.c_str(), NULL, NULL); >>> if ( pFormatCtx == NULL || >>> pFormatCtx->iformat == NULL ) >>> { >>> return -1; >>> } >>> // Retrieve stream information >>> if(avformat_find_stream_info(pFormatCtx, NULL)<0) >>> return -1; // Couldn't find stream information >>> >>> // Dump information about file onto standard error >>> av_dump_format(pFormatCtx, 0, finalInputName.c_str(), 0); >>> // -- test code ends --// >>> >>> //--------------------------------------------------------------------------------------------------------------------------------------------------- >>> >>> The output it gives me is (in debug console): >>> >>> >>> //--------------------------------------------------------------------------------------------------------------------------------------------------- >>> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_input.3gp': >>> Metadata: >>> major_brand : 3gp4 >>> minor_version : 0 >>> compatible_brands: isom3gp4 >>> creation_time : 2013-05-20 11:54:39 >>> Duration: 00:00:23.77, start: 0.000000, bitrate: 5882 kb/s >>> Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / >>> 0x7634706D) >>> , yuv420p, 640x480 [SAR 1:1 DAR 4:3], 5752 kb/s, 30.08 fps, 30.08 tbr, >>> 90k tbn, >>> 300 tbc >>> Metadata: >>> creation_time : 2013-05-20 11:54:39 >>> handler_name : VideoHandle >>> Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, stereo, >>> s16, 127 >>> kb/s >>> Metadata: >>> creation_time : 2013-05-20 11:54:39 >>> handler_name : SoundHandle >>> >>> //--------------------------------------------------------------------------------------------------------------------------------------------------- >>> >>> Like in above example, I can read that video is recorded at 30.08 fps, >>> question is: it is apparently very simple for FFmpeg to figure this out, >>> but how can I use this information from my own program? I was trying to >>> follow code from FFmpeg source file (utils.c): [void >>> av_dump_format(AVFormatContext *ic, int index, const char *url, int >>> is_output)], but was easily lost there. >>> >>> Can anyone kindly guide me how to intercept this problem? >>> >>> Thanks in advance for your time... >>> >>> _______________________________________________ >>> Libav-user mailing list >>> Libav-user at ffmpeg.org >>> http://ffmpeg.org/mailman/listinfo/libav-user >>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cnelson at ina.fr Wed May 22 09:38:51 2013 From: cnelson at ina.fr (Christophe Nelson) Date: Wed, 22 May 2013 07:38:51 +0000 Subject: [Libav-user] Hevc Message-ID: <853FB49B5740B24B965337850CCA7E1538E84C7D@AMSPRD0410MB375.eurprd04.prod.outlook.com> Hello everybody I am wondering if some of the developers of ffmpeg have any intention to implement HEVC in ffmpeg ? I know there is an open lib called openHevc https://github.com/OpenHEVC. Any intention to work with ? Regards Christophe -------------- next part -------------- An HTML attachment was scrubbed... URL: From Steffen.Roeber at hella.com Wed May 22 09:42:43 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Wed, 22 May 2013 00:42:43 -0700 (PDT) Subject: [Libav-user] Making a static lib with -MD option In-Reply-To: References: <1368441454747-4657578.post@n4.nabble.com> <1368509911028-4657584.post@n4.nabble.com> Message-ID: <1369208563114-4657698.post@n4.nabble.com> The git head works but gives me something like: 1> Creating library ..\..\bin\Debug\cio.lib and object ..\..\bin\Debug\cio.exp 1>libavcodec.lib(pamenc.o) : warning LNK4049: locally defined symbol _avpriv_snprintf imported 1>libavcodec.lib(huffyuvenc.o) : warning LNK4217: locally defined symbol _avpriv_snprintf imported in function _encode_init 1>libavcodec.lib(ffv1enc.o) : warning LNK4049: locally defined symbol _avpriv_snprintf imported 1>libavcodec.lib(ratecontrol.o) : warning LNK4049: locally defined symbol _avpriv_snprintf imported 1>libavcodec.lib(assenc.o) : warning LNK4049: locally defined symbol _avpriv_snprintf imported 1>libavcodec.lib(xbmenc.o) : warning LNK4049: locally defined symbol _avpriv_snprintf imported -- View this message in context: http://libav-users.943685.n4.nabble.com/Making-a-static-lib-with-MD-option-tp4657578p4657698.html Sent from the libav-users mailing list archive at Nabble.com. From h.leppkes at gmail.com Wed May 22 09:55:43 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Wed, 22 May 2013 09:55:43 +0200 Subject: [Libav-user] Making a static lib with -MD option In-Reply-To: <1369208563114-4657698.post@n4.nabble.com> References: <1368441454747-4657578.post@n4.nabble.com> <1368509911028-4657584.post@n4.nabble.com> <1369208563114-4657698.post@n4.nabble.com> Message-ID: On Wed, May 22, 2013 at 9:42 AM, Steffen wrote: > The git head works but gives me something like: > > 1> Creating library ..\..\bin\Debug\cio.lib and object > ..\..\bin\Debug\cio.exp > 1>libavcodec.lib(pamenc.o) : warning LNK4049: locally defined symbol > _avpriv_snprintf imported > 1>libavcodec.lib(huffyuvenc.o) : warning LNK4217: locally defined symbol > _avpriv_snprintf imported in function _encode_init > 1>libavcodec.lib(ffv1enc.o) : warning LNK4049: locally defined symbol > _avpriv_snprintf imported > 1>libavcodec.lib(ratecontrol.o) : warning LNK4049: locally defined symbol > _avpriv_snprintf imported > 1>libavcodec.lib(assenc.o) : warning LNK4049: locally defined symbol > _avpriv_snprintf imported > 1>libavcodec.lib(xbmenc.o) : warning LNK4049: locally defined symbol > _avpriv_snprintf imported > > > You can safely ignore these warnings, they happen because the build system was meant to be kept simple, instead of over-complicating everything and avoiding these warnings. From Steffen.Roeber at hella.com Wed May 22 09:27:35 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Wed, 22 May 2013 00:27:35 -0700 (PDT) Subject: [Libav-user] written yuv cannot be played Message-ID: <1369207655867-4657695.post@n4.nabble.com> ffmpeg.exe -i d:\videos\simpsons_trailer05-de_xhigh.mov -vcodec rawvideo d:\temp\test2.yuv ffplay d:\temp\test2.yuv gives: [IMGUTILS @ 04bafc44] Picture size 0x0 is invalid sq= 0B f=0/0 [IMGUTILS @ 04baf724] Picture size 0x0 is invalid [IMGUTILS @ 04baf794] Picture size 0x0 is invalid [rawvideo @ 040719c0] Could not find codec parameters for stream 0 (Video: rawvi deo, yuv420p, -4 kb/s): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options d:\temp\test2.yuv: could not find codec parameters -- View this message in context: http://libav-users.943685.n4.nabble.com/written-yuv-cannot-be-played-tp4657695.html Sent from the libav-users mailing list archive at Nabble.com. From cnelson at ina.fr Wed May 22 10:20:13 2013 From: cnelson at ina.fr (Christophe Nelson) Date: Wed, 22 May 2013 08:20:13 +0000 Subject: [Libav-user] written yuv cannot be played In-Reply-To: <1369207655867-4657695.post@n4.nabble.com> References: <1369207655867-4657695.post@n4.nabble.com> Message-ID: <853FB49B5740B24B965337850CCA7E1538E84CF7@AMSPRD0410MB375.eurprd04.prod.outlook.com> Hi You have to specifie in the player the size of the picture of the YUV file There is no header information about that in the yuv file ! Maybe you can try http://sourceforge.net/projects/raw-yuvplayer/ -----Message d'origine----- De?: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] De la part de Steffen Envoy??: mercredi 22 mai 2013 09:28 ??: libav-user at ffmpeg.org Objet?: [Libav-user] written yuv cannot be played ffmpeg.exe -i d:\videos\simpsons_trailer05-de_xhigh.mov -vcodec rawvideo d:\temp\test2.yuv ffplay d:\temp\test2.yuv gives: [IMGUTILS @ 04bafc44] Picture size 0x0 is invalid sq= 0B f=0/0 [IMGUTILS @ 04baf724] Picture size 0x0 is invalid [IMGUTILS @ 04baf794] Picture size 0x0 is invalid [rawvideo @ 040719c0] Could not find codec parameters for stream 0 (Video: rawvi deo, yuv420p, -4 kb/s): unspecified size Consider increasing the value for the 'analyzeduration' and 'probesize' options d:\temp\test2.yuv: could not find codec parameters -- View this message in context: http://libav-users.943685.n4.nabble.com/written-yuv-cannot-be-played-tp4657695.html Sent from the libav-users mailing list archive at Nabble.com. _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From krueger at lesspain.de Wed May 22 10:38:21 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 22 May 2013 10:38:21 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> Message-ID: On Tue, May 21, 2013 at 9:08 PM, Brad O'Hearne wrote: > On May 21, 2013, at 11:54 AM, John Stebbins wrote: > >> I think we may have crossed wires here. By "sources" I meant source video that I can run through my code to verify that >> VFR is possible and works correctly using avformat mov muxer. > > Oh, then in that case no I do not. My source video is live capture, which is being encoded to FLV. > ??? I thought this thread is about the capabilities of the mov muxer? A lot of the discussion above was rather pointless then because at least three people were explaining to you how this works in mov and your claims, that it did not work came from your experience with the FLV muxer? If that is the case, then it would help, if you were a bit more specific the next time. The capabilities of container formats _and_ muxers vary a lot. So this can only really be discussed in a useful way when were talking about the same thing. From mtaha.ansari at gmail.com Wed May 22 11:03:56 2013 From: mtaha.ansari at gmail.com (Taha Ansari) Date: Wed, 22 May 2013 14:03:56 +0500 Subject: [Libav-user] Reading correct frame rate (fps) of input video In-Reply-To: References: <519C181B.8010205@sina.com> Message-ID: Hi guys, I have come up with a quick patch: //------------------------------ AVStream *st = pFormatCtx->streams[this->videoStream ]; if ( st->codec->codec_id == AV_CODEC_ID_H264 )//mp4 { video_frame_rate = st->avg_frame_rate.num / (double)st->avg_frame_rate.den; } else if ( st->codec->codec_id == AV_CODEC_ID_MJPEG ) { video_frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; } else if ( st->codec->codec_id == AV_CODEC_ID_FLV1 ) { video_frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; } else if ( st->codec->codec_id == AV_CODEC_ID_WMV3 ) { video_frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; } else if ( st->codec->codec_id == AV_CODEC_ID_MPEG4 )//3gp { video_frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; } else { video_frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; } //--------------------------- This way I can add up more files as I encounter them. Question now: is this solution elegant? I would love to know if there is any generic/proper implementation for this. Thanks again for your time, On Wed, May 22, 2013 at 12:28 PM, Taha Ansari wrote: > Like I spoke too soon, (I have also included time_base structure): > > when tried on: > > - FLV file: for r_frame_rate: {num=15 den=1 }, for avg_frame_rate: {num=0 > den=0 }, for time_base: {num=1 den=1000 } > > - WMV file: for r_frame_rate: {num=15 den=1 }, for avg_frame_rate: {num=0 > den=0 }, for time_base: {num=1 den=1000 } > > - AVI file: for r_frame_rate: {num=15 den=1 }, for avg_frame_rate:{num=0 > den=0 }, for time_base: {num=1 den=15 } > > - 3gp file: for r_frame_rate: {num=361 den=12 }, for avg_frame_rate: > {num=64350000 den=2139391 }, for time_base: {num=1 den=90000 } (30.08, > 30.078 fps respectively) > > - MP4 file: for r_frame_rate: {num=599 den=12 }, for avg_frame_rate: > {num=25 den=1 }, for time_base: {num=1 den=90000 } (49.9, 25 fps > respectively - first figure is wrong). > > > So, is there any way to know for sure which structure I could surely rely > on? > > Thanks again for your time.. > > > On Wed, May 22, 2013 at 12:12 PM, Taha Ansari wrote: > >> I just noticed one more thing: >> >> using: >> >> >> AVStream *st = pFormatCtx->streams[your_video_index]; >> double frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; >> >> gives me correct values for 3gp files. When I tried this code on an MP4 >> file, I got about 49.9 value, which was incorrect (actual was 25); looking >> at other values, I tried following: >> >> >> AVStream *st = pFormatCtx->streams[your_video_index ]; >> double frame_rate = st->avg_frame_rate.num / >> (double)st->avg_frame_rate.den; >> >> It worked fine for MP4: {num=25 den=1 }, and for 3gp, I get: >> {num=64350000 den=2139391 } (30.078 FPS), which is also correct. >> >> So I assume this might be better structure to refer to, until it breaks >> again on another video...? >> >> >> On Wed, May 22, 2013 at 8:48 AM, Taha Ansari wrote: >> >>> Hi Guohui Huan! >>> >>> Many thanks for your guidance, I have got it working now! >>> >>> Thanks once again... >>> >>> >>> On Wed, May 22, 2013 at 5:58 AM, Guohui Huang wrote: >>> >>>> ** >>>> You can get frame rate as follow: >>>> AVStream *st = pFormatCtx->streams[your_video_index]; >>>> double frame_rate = st->r_frame_rate.num / (double)st->r_frame_rate.den; >>>> >>>> 2013-05-22 >>>> ------------------------------ >>>> Guohui Huang >>>> ------------------------------ >>>> *????*Taha Ansari >>>> *?????*2013-05-21 23:04 >>>> *???*[Libav-user] Reading correct frame rate (fps) of input video >>>> *????*"This list is about using libavcodec, libavformat, libavutil, >>>> libavdevice and libavfilter." >>>> *???* >>>> >>>> Hi! >>>> >>>> I am trying to read exact values for frame rate (fps) from any input >>>> video file. I have been trying to debug different structures like >>>> AVFormatCtx, etc. but cannot seem to figure it out. For a test case, here >>>> is the code I have managed (just the source snippet, include files etc. are >>>> all understandable): >>>> >>>> >>>> //--------------------------------------------------------------------------------------------------------------------------------------------------- >>>> // ++ test code begins ++// >>>> av_register_all(); >>>> avcodec_register_all(); >>>> avformat_network_init(); >>>> avdevice_register_all(); >>>> AVFormatContext *pFormatCtx = NULL; >>>> pFormatCtx = avformat_alloc_context(); >>>> string finalInputName = "test_input.3gp"; >>>> avformat_open_input(&pFormatCtx, finalInputName.c_str(), NULL, >>>> NULL); >>>> if ( pFormatCtx == NULL || >>>> pFormatCtx->iformat == NULL ) >>>> { >>>> return -1; >>>> } >>>> // Retrieve stream information >>>> if(avformat_find_stream_info(pFormatCtx, NULL)<0) >>>> return -1; // Couldn't find stream information >>>> >>>> // Dump information about file onto standard error >>>> av_dump_format(pFormatCtx, 0, finalInputName.c_str(), 0); >>>> // -- test code ends --// >>>> >>>> //--------------------------------------------------------------------------------------------------------------------------------------------------- >>>> >>>> The output it gives me is (in debug console): >>>> >>>> >>>> //--------------------------------------------------------------------------------------------------------------------------------------------------- >>>> Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'test_input.3gp': >>>> Metadata: >>>> major_brand : 3gp4 >>>> minor_version : 0 >>>> compatible_brands: isom3gp4 >>>> creation_time : 2013-05-20 11:54:39 >>>> Duration: 00:00:23.77, start: 0.000000, bitrate: 5882 kb/s >>>> Stream #0:0(eng): Video: mpeg4 (Advanced Simple Profile) (mp4v / >>>> 0x7634706D) >>>> , yuv420p, 640x480 [SAR 1:1 DAR 4:3], 5752 kb/s, 30.08 fps, 30.08 tbr, >>>> 90k tbn, >>>> 300 tbc >>>> Metadata: >>>> creation_time : 2013-05-20 11:54:39 >>>> handler_name : VideoHandle >>>> Stream #0:1(eng): Audio: aac (mp4a / 0x6134706D), 16000 Hz, stereo, >>>> s16, 127 >>>> kb/s >>>> Metadata: >>>> creation_time : 2013-05-20 11:54:39 >>>> handler_name : SoundHandle >>>> >>>> //--------------------------------------------------------------------------------------------------------------------------------------------------- >>>> >>>> Like in above example, I can read that video is recorded at 30.08 fps, >>>> question is: it is apparently very simple for FFmpeg to figure this out, >>>> but how can I use this information from my own program? I was trying to >>>> follow code from FFmpeg source file (utils.c): [void >>>> av_dump_format(AVFormatContext *ic, int index, const char *url, int >>>> is_output)], but was easily lost there. >>>> >>>> Can anyone kindly guide me how to intercept this problem? >>>> >>>> Thanks in advance for your time... >>>> >>>> _______________________________________________ >>>> Libav-user mailing list >>>> Libav-user at ffmpeg.org >>>> http://ffmpeg.org/mailman/listinfo/libav-user >>>> >>>> >>> >> > -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed May 22 11:31:32 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 22 May 2013 09:31:32 +0000 (UTC) Subject: [Libav-user] written yuv cannot be played References: <1369207655867-4657695.post@n4.nabble.com> Message-ID: Steffen writes: > ffmpeg.exe -i d:\videos\simpsons_trailer05-de_xhigh.mov > -vcodec rawvideo d:\temp\test2.yuv Complete, uncut console output missing. > ffplay d:\temp\test2.yuv > [IMGUTILS 04baf794] Picture size 0x0 is invalid > [rawvideo 040719c0] Could not find codec parameters for stream 0 > (Video: rawvideo, yuv420p, -4 kb/s): unspecified size $ ffplay -s 320x240 d:\temp\test2.yuv Carl Eugen From cehoyos at ag.or.at Wed May 22 11:33:05 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 22 May 2013 09:33:05 +0000 (UTC) Subject: [Libav-user] Hevc References: <853FB49B5740B24B965337850CCA7E1538E84C7D@AMSPRD0410MB375.eurprd04.prod.outlook.com> Message-ID: Christophe Nelson writes: > I am wondering if some of the developers of ffmpeg > have any intention to implement HEVC in ffmpeg ? Yes. If you are interested in contributing, please setup your own git clone and join #ffmpeg-devel on freenode. Carl Eugen From h.leppkes at gmail.com Wed May 22 12:03:14 2013 From: h.leppkes at gmail.com (Hendrik Leppkes) Date: Wed, 22 May 2013 12:03:14 +0200 Subject: [Libav-user] Hevc In-Reply-To: <853FB49B5740B24B965337850CCA7E1538E84C7D@AMSPRD0410MB375.eurprd04.prod.outlook.com> References: <853FB49B5740B24B965337850CCA7E1538E84C7D@AMSPRD0410MB375.eurprd04.prod.outlook.com> Message-ID: On Wed, May 22, 2013 at 9:38 AM, Christophe Nelson wrote: > Hello everybody > > I am wondering if some of the developers of ffmpeg have any intention to > implement HEVC in ffmpeg ? > > I know there is an open lib called openHevc https://github.com/OpenHEVC. > For the record, OpenHEVC is actually based on libavcodec, and implements a HEVC decoder on top of this. Its still very much a work in progress, which is why its not being merged into ffmpeg or libav yet. Give it some time to mature, i've heard some comments that the developers hope to get it integrated into mainline ffmpeg/libav this summer, once all the major features are implemented and its in a state worth merging. From Steffen.Roeber at hella.com Wed May 22 12:07:43 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Wed, 22 May 2013 03:07:43 -0700 (PDT) Subject: [Libav-user] Making a static lib with -MD option In-Reply-To: References: <1368441454747-4657578.post@n4.nabble.com> <1368509911028-4657584.post@n4.nabble.com> <1369208563114-4657698.post@n4.nabble.com> Message-ID: <1369217263633-4657706.post@n4.nabble.com> Unfortunately not. Example: 1. dll (cio.dll) links statically to av.libs 2. dll (crecord.dll) links to both statically to av.libs and dynamically to cio.dll That gives me: cio.lib(cio.dll) : error LNK2005: _avpriv_snprintf already defined in libavutil.lib(snprintf.o) cio.lib(cio.dll) : error LNK2005: _avpriv_vsnprintf already defined in libavutil.lib(snprintf.o) cio.lib(cio.dll) : error LNK2005: _avpriv_strtod already defined in libavutil.lib(strtod.o) -- View this message in context: http://libav-users.943685.n4.nabble.com/Making-a-static-lib-with-MD-option-tp4657578p4657706.html Sent from the libav-users mailing list archive at Nabble.com. From brado at bighillsoftware.com Wed May 22 17:15:04 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Wed, 22 May 2013 08:15:04 -0700 Subject: [Libav-user] # of audio samples, calculated vs. codec context In-Reply-To: <1369206297892-4657693.post@n4.nabble.com> References: <12C17700-6C2B-48AD-ADA1-3FDE8D5B1607@bighillsoftware.com> <8092C4D0-121F-4292-AD91-D6AFF827848B@bighillsoftware.com> <83B64D10-91DA-46D5-BF59-D4755C0B5DC4@bighillsoftware.com> <1369159840953-4657677.post@n4.nabble.com> <1369206297892-4657693.post@n4.nabble.com> Message-ID: <088A21FD-68C4-4F1F-85A4-746F09E94905@bighillsoftware.com> On May 22, 2013, at 12:04 AM, Pradeep Karosiya wrote: > Hi Brad, > > Actually at that time I didn't explore much and since I already had my own > buffer class I quickly reused it. But if there are some other better > facility available in ffmpeg like libavcodec/audio_frame_queue.c I suggest > you cantry that. I'd love to use audio_frame_queue.c. If I can put my hands on any example of its use, I'll use it. Google has been fruitless so far, but a grep of the FFmpeg source shows there might be something useful in the AAC encoder. If that doesn't shed any light on it, I'll either roll my own or try to revert back into Apple's Core Audio to handle it. B From brado at bighillsoftware.com Wed May 22 17:28:39 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Wed, 22 May 2013 08:28:39 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> Message-ID: <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> On May 22, 2013, at 1:38 AM, Robert Kr?ger wrote: > ??? I thought this thread is about the capabilities of the mov muxer? My discussion of pts/dts and time_base.den surrounded the common AVCodecContext, which should be relevant to ffmpeg muxing in general. > The capabilities of container formats > _and_ muxers vary a lot. So this can only really be discussed in a > useful way when were talking about the same thing. Yes, but these are facilitated through a common code layer. Quite frankly, it is hard to tell where common behavior and muxer-specific behavior starts / ends. I threw it out in hopes of shedding light on something that might be affecting your situation, as it sounded like it had some similarities to things which I had encountered. FFmpeg development in general has been an exercise of frequently wandering around in the dark, and I personally appreciate those who take the time to offer ideas and things they've run into, even if not identical to my use case, as they may shed light on possibilities in my situation, and the knowledge can be applied and yield some progress. My apologies, though I wouldn't have known anyway -- I was not aware that pts/dts and time_base.den were handled differently across muxers. I guess I missed that part in the ffmpeg user guide. I guess it also means Dranger's discussion of them would be not generally applicable either, as I don't recall his information being muxer-specific. Good to know. Nevertheless, I hope you get your problem solved. I'll keep my powder dry on throwing out possibly relevant info anymore in this thread. Good luck, Brad From klaussfreire at gmail.com Wed May 22 17:45:45 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Wed, 22 May 2013 12:45:45 -0300 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> Message-ID: On Wed, May 22, 2013 at 12:28 PM, Brad O'Hearne wrote: >> The capabilities of container formats >> _and_ muxers vary a lot. So this can only really be discussed in a >> useful way when were talking about the same thing. > > Yes, but these are facilitated through a common code layer. Quite frankly, it is hard to tell where common behavior and muxer-specific behavior starts / ends. This is true at many levels, I faced similar woes in the past with codecs, and options that codecs ignored or interpreted in varied ways. It would be nice to have detailled: * Documentation about those codec/muxer/format-specific behaviors * Machine-readable capabilities descriptions. There's already some of it in CODEC_CAP bits, perhaps it should be expanded. Especially audio, those cap bits seem to care only for video stuff. Example: VBR, ABR, CBR. One has to guess whether a particular codec supports any of those in any meaningful way. Multipass. Maybe there's some facility for that I missed, in that case I would love to be enlightened ;) From krueger at lesspain.de Wed May 22 18:02:20 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 22 May 2013 18:02:20 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> Message-ID: On Wed, May 22, 2013 at 5:45 PM, Claudio Freire wrote: > On Wed, May 22, 2013 at 12:28 PM, Brad O'Hearne > wrote: >>> The capabilities of container formats >>> _and_ muxers vary a lot. So this can only really be discussed in a >>> useful way when were talking about the same thing. >> >> Yes, but these are facilitated through a common code layer. Quite frankly, it is hard to tell where common behavior and muxer-specific behavior starts / ends. > > > This is true at many levels, I faced similar woes in the past with > codecs, and options that codecs ignored or interpreted in varied ways. yes, I agree but I don't think lack of awareness is the problem here, so the only thing that is going to change that is either contributing documentation (which, I know, is kind of hard in many cases when one is not the author of a specific undocumented piece of code and relies on the cooperation of the few people knowing what the state of affairs is) or try to motivate people by asking them for a specific piece of documentation (e.g. by opening a trac ticket) or paying them to do it, at least that's all I can think of. After all, most of the work is done by people in their spare time and I haven't found many developers who enjoy writing documentation (no matter how important docs are, I think we all agree on that). From andy.y.huang at gmail.com Wed May 22 18:24:45 2013 From: andy.y.huang at gmail.com (Andy Huang) Date: Wed, 22 May 2013 11:24:45 -0500 Subject: [Libav-user] avformat_open_input Message-ID: When I can call it "avformat_open_input(&avFormatContextPtr, "", NULL, NULL), it works on iOS, but it blocks on Android, never returns, any ideas? -------------- next part -------------- An HTML attachment was scrubbed... URL: From prathap.malempati at gmail.com Wed May 22 06:50:33 2013 From: prathap.malempati at gmail.com (prathap) Date: Tue, 21 May 2013 21:50:33 -0700 (PDT) Subject: [Libav-user] AVCODEC_MAX_AUDIO_FRAME_SIZE Message-ID: <1369198233661-4657692.post@n4.nabble.com> Hi, I am new to ffmpeg , when i am doing work on sound functions i got errors like this In function ?audio_callback?: error: ?AVCODEC_MAX_AUDIO_FRAME_SIZE? undeclared (first use in this function) note: each undeclared identifier is reported only once for each function it appears in Could you please suggest me the correct way Thank you Regards Prathap.M -- View this message in context: http://libav-users.943685.n4.nabble.com/AVCODEC-MAX-AUDIO-FRAME-SIZE-tp4657692.html Sent from the libav-users mailing list archive at Nabble.com. From brado at bighillsoftware.com Wed May 22 18:53:48 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Wed, 22 May 2013 09:53:48 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> Message-ID: <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> On May 22, 2013, at 9:02 AM, Robert Kr?ger wrote: > After all, most of the work is > done by people in their spare time and I haven't found many developers > who enjoy writing documentation (no matter how important docs are, I > think we all agree on that). The problem, Robert, is bigger than just finding someone to document FFmpeg, getting volunteers, or motivating people. The bigger problem is that producing good documentation and discussion of a particular technical domain requires an inquisitive and exhaustive approach, willing to drill down to details, and ask questions which put design decisions and potentially either weaknesses or needs in the spotlight. The tone of this mailing list just doesn't have a thick-enough skin for that. The discourse on this list consistently demonstrates an inability to treat machinery as machinery, nuts and bolts, and instead quickly degenerates into personal attacks when a good answer isn't quickly obvious, or when someone refuses to consider that there may be a problem in some part of FFmpeg which someone has adopted as their turf. There is absolutely zero question in my mind, from the several projects I've had to solve with FFmpeg, discussions with others, numerous blog posts which lament the undocumented and unknown nature of various parts of FFmpeg, that save bug-fixing, adding a single additional line of code to FFmpeg pales in importance to thoroughly documenting the API with adequate discussion, documenting use, and producing some examples that address real-world use-cases, not "let's just generate some audio samples or a sample images for video", which avoids the real problems of building a robust app. I love writing, have written technical documentation and technical articles, and had several book deals offered. Given my frustrations and time loss due to a lack of documentation, if it were mine to script, I'd document the whole thing myself, and produce either a book or user guide on this. But given both my personal experiences thus far and observing others as well on this mailing list, I won't go anywhere near it. Too much shoot-the-messenger on this mailing list. Too much condescension if you ask a question without demonstrating deep expertise of a particular concept. Too much passion for sniping people because they don't just by default know something. That, Robert, is the primary problem -- with people making personal attacks, and an inability to drill into minutia with patience, people who would otherwise offer their services are driven away. I'm not just referring to my own experiences here, I've been on this mailing list a year and a half, and I've watched it with others, too. It's a shame. Entirely unnecessary. Brad From onemda at gmail.com Wed May 22 19:52:38 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 22 May 2013 17:52:38 +0000 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> Message-ID: On 5/22/13, Brad O'Hearne wrote: > On May 22, 2013, at 9:02 AM, Robert Krueger wrote: > >> After all, most of the work is >> done by people in their spare time and I haven't found many developers >> who enjoy writing documentation (no matter how important docs are, I >> think we all agree on that). > > The problem, Robert, is bigger than just finding someone to document FFmpeg, > getting volunteers, or motivating people. The bigger problem is that > producing good documentation and discussion of a particular technical domain > requires an inquisitive and exhaustive approach, willing to drill down to > details, and ask questions which put design decisions and potentially either > weaknesses or needs in the spotlight. The tone of this mailing list just > doesn't have a thick-enough skin for that. The discourse on this list > consistently demonstrates an inability to treat machinery as machinery, nuts > and bolts, and instead quickly degenerates into personal attacks when a good > answer isn't quickly obvious, or when someone refuses to consider that there > may be a problem in some part of FFmpeg which someone has adopted as their > turf. > > There is absolutely zero question in my mind, from the several projects I've > had to solve with FFmpeg, discussions with others, numerous blog posts which > lament the undocumented and unknown nature of various parts of FFmpeg, that > save bug-fixing, adding a single additional line of code to FFmpeg pales in > importance to thoroughly documenting the API with adequate discussion, > documenting use, and producing some examples that address real-world > use-cases, not "let's just generate some audio samples or a sample images > for video", which avoids the real problems of building a robust app. > > I love writing, have written technical documentation and technical articles, > and had several book deals offered. Given my frustrations and time loss due > to a lack of documentation, if it were mine to script, I'd document the > whole thing myself, and produce either a book or user guide on this. But > given both my personal experiences thus far and observing others as well on > this mailing list, I won't go anywhere near it. Too much shoot-the-messenger > on this mailing list. Too much condescension if you ask a question without > demonstrating deep expertise of a particular concept. Too much passion for > sniping people because they don't just by default know something. That, > Robert, is the primary problem -- with people making personal attacks, and > an inability to drill into minutia with patience, people who would otherwise > offer their services are driven away. > > I'm not just referring to my own experiences here, I've been on this mailing > list a year and a half, and I've watched it with others, too. It's a shame. > Entirely unnecessary. How much time it takes to write above text? Now compare to time I wasted reading this FUD instead of doing something else - like helping users than really need help. From onemda at gmail.com Wed May 22 19:54:49 2013 From: onemda at gmail.com (Paul B Mahol) Date: Wed, 22 May 2013 17:54:49 +0000 Subject: [Libav-user] AVCODEC_MAX_AUDIO_FRAME_SIZE In-Reply-To: <1369198233661-4657692.post@n4.nabble.com> References: <1369198233661-4657692.post@n4.nabble.com> Message-ID: On 5/22/13, prathap wrote: > Hi, > > I am new to ffmpeg , when i am doing work on sound functions i got errors > like this > > > In function `audio_callback': > > error: `AVCODEC_MAX_AUDIO_FRAME_SIZE' undeclared (first use in this > function) > > note: each undeclared identifier is reported only once for each function it > appears in > > > Could you please suggest me the correct way That item have gone, there are updated examples for new API available in source code. From brado at bighillsoftware.com Wed May 22 20:02:46 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Wed, 22 May 2013 11:02:46 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.c om> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> Message-ID: <6238EEFD-12ED-45B2-8049-0AEAB6381D6E@bighillsoftware.com> On May 22, 2013, at 10:52 AM, Paul B Mahol wrote: > How much time it takes to write above text? Now compare to time I wasted reading > this FUD instead of doing something else - like helping users than > really need help. I rest my case. Brad From andy.y.huang at gmail.com Wed May 22 22:04:09 2013 From: andy.y.huang at gmail.com (Andy Huang) Date: Wed, 22 May 2013 15:04:09 -0500 Subject: [Libav-user] enable logcat Message-ID: Hi, I am new to ffmpeg. I was able to compile ffmpeg for Android by following the advice. But how can I compile a version that has the logging using Android's logcat, i.e. the log should be displayed on logcat window. Thx. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Wed May 22 22:29:37 2013 From: kalileo at universalx.net (Kalileo) Date: Thu, 23 May 2013 03:29:37 +0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> Message-ID: <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> On May 22, 2013, at 23:53 , Brad O'Hearne wrote: > On May 22, 2013, at 9:02 AM, Robert Kr?ger wrote: > >> After all, most of the work is >> done by people in their spare time and I haven't found many developers >> who enjoy writing documentation (no matter how important docs are, I >> think we all agree on that). > > The problem, Robert, is bigger than just finding someone to document FFmpeg, getting volunteers, or motivating people. The bigger problem is that producing good documentation and discussion of a particular technical domain requires an inquisitive and exhaustive approach, willing to drill down to details, and ask questions which put design decisions and potentially either weaknesses or needs in the spotlight. The tone of this mailing list just doesn't have a thick-enough skin for that. The discourse on this list consistently demonstrates an inability to treat machinery as machinery, nuts and bolts, and instead quickly degenerates into personal attacks when a good answer isn't quickly obvious, or when someone refuses to consider that there may be a problem in some part of FFmpeg which someone has adopted as their turf. > > There is absolutely zero question in my mind, from the several projects I've had to solve with FFmpeg, discussions with others, numerous blog posts which lament the undocumented and unknown nature of various parts of FFmpeg, that save bug-fixing, adding a single additional line of code to FFmpeg pales in importance to thoroughly documenting the API with adequate discussion, documenting use, and producing some examples that address real-world use-cases, not "let's just generate some audio samples or a sample images for video", which avoids the real problems of building a robust app. > > I love writing, have written technical documentation and technical articles, and had several book deals offered. Given my frustrations and time loss due to a lack of documentation, if it were mine to script, I'd document the whole thing myself, and produce either a book or user guide on this. But given both my personal experiences thus far and observing others as well on this mailing list, I won't go anywhere near it. Too much shoot-the-messenger on this mailing list. Too much condescension if you ask a question without demonstrating deep expertise of a particular concept. Too much passion for sniping people because they don't just by default know something. That, Robert, is the primary problem -- with people making personal attacks, and an inability to drill into minutia with patience, people who would otherwise offer their services are driven away. > > I'm not just referring to my own experiences here, I've been on this mailing list a year and a half, and I've watched it with others, too. It's a shame. Entirely unnecessary. > > Brad Let me just say that the negative picture you paint above about this list is very different from my impression. If you spread half based theories about what ffmpeg might support, or not support, including conclusions based on not getting answers to some questions - that's not appreciated, because it misleads other users. Please don't complain if you don't find many willing to discuss these theories with you, most here are looking for answers or trying to help others. You say that you "love writing", and that's quite obvious by now, why don't you use it to write the documentation you miss. Document what's there. It's all open source, no secrets there, no need for theories. Everybody would appreciate that. From Steve.Rothkin at Honeywell.com Wed May 22 22:38:59 2013 From: Steve.Rothkin at Honeywell.com (Rothkin, Steve (NY81)) Date: Wed, 22 May 2013 20:38:59 +0000 Subject: [Libav-user] Intermittent heap crash with Visual Studio 2005 In-Reply-To: References: <0ED54485BDF923428E38AB27448A35771A0B6A65@de08ex3007.global.ds.honeywell.com> <0ED54485BDF923428E38AB27448A35771A0B6AAA@de08ex3007.global.ds.honeywell.com> Message-ID: <0ED54485BDF923428E38AB27448A35771A0B799E@de08ex3007.global.ds.honeywell.com> > > I have not been able to successfully build it with VS2005, 2008, 2010, > > or 2012. I tried the instructions at > > http://ffmpeg.org/platform.html#Microsoft-Visual-C_002b_002b > > but I got failures in make > > Would you like to tell us about those failures? > > Carl Eugen OK, it turns out my installation of MSYS was bad. After uninstalling/reinstalling/reconfiguring I was finally able to get it to build with Visual Studio 2012. The crash seems to go away with this build (even though from the same source of FFMPEG) so perhaps something wasn't good about the way I originally cross-compiled it in cygwin. Anyway I can see symbols/source for FFMPEG within Visual Studio now, so if the crash comes back I'll be able to debug it. From Steve.Rothkin at Honeywell.com Wed May 22 22:46:58 2013 From: Steve.Rothkin at Honeywell.com (Rothkin, Steve (NY81)) Date: Wed, 22 May 2013 20:46:58 +0000 Subject: [Libav-user] Failure to read quicktime movie with FFMPEG 1.2.1 when built with Visual studio, works fine with today's git though Message-ID: <0ED54485BDF923428E38AB27448A35771A0B79B7@de08ex3007.global.ds.honeywell.com> I have a particular quicktime .mov file that is 2,586,525,646 bytes (unfortunately, I cannot share it due to license restrictions). With a Visual Studio 2012 build of the 1.2.1 source I get [mov,mp4,m4a,3gp,3g2,mj2 @ 06FFAE60] moov atom not found When I try to open the file with av_format_open. When I do the same build with the source from git on 2013-05-22 I am able to read the file fine. Furthermore, the 1.2.1 source cross-compiled in Cygwin for Windows also works fine (but some operations crash when using lots of threads in a Visual Studio 2005 program, a problem that seems to go away with the Visual Studio 2012 builds. The file details are: 768x576 yuvj422p mjpeg file time_base=1/25 (0.0400) duration=690600000 (690.6000) Codec time_base=1/25 (0.0400) ticks_per_frame=1 has_b_frames=0 Stream time_base=1/25 (0.0400) r_frame_rate=25/1 (25.0000) avg_frame_rate=25/1 (25.0000) duration=17265 (690.6000) frames=17265 The Visual Studio 2012 builds (in MSYS) were done with ./configure --toolchain=msvc --arch=i686 --enable-shared --disable-static --disable-programs --disable-doc --disable-swresample --disable-postproc --disable-zlib --disable-bzlib --enable-runtime-cpudetect --prefix=$ARGUSLIBS/lib/ffmpeg/other --libdir=$ARGUSLIBS/lib/ffmpeg --shlibdir=$ARGUSLIBS/lib/ffmpeg --incdir=$ARGUSLIBS/include/ffmpeg --extra-ldflags="-DEBUG -INCREMENTAL:NO -OPT:REF" --optflags="-Zi -O2 -Oy-" --extra-cflags="-I/m" The cygwin cross compile build was done with ./configure --target-os=mingw32 --cross-prefix=i686-pc-mingw32- --enable-shared --disable-static --extra-cflags=-mno-cygwin --extra-libs=-mno-cygwin --disable-programs --disable-doc --disable-swresample --disable-postproc --disable-zlib --disable-bzlib --disable-pthreads --disable-os2threads --enable-w32threads --arch=x86 --enable-runtime-cpudetect --prefix=$HOME/argus-libs/lib/ffmpeg/other --libdir=$HOME/argus-libs/lib/ffmpeg --shlibdir=$HOME/argus-libs/lib/ffmpeg --incdir=$HOME/argus-libs/include/ffmpeg -------------- next part -------------- An HTML attachment was scrubbed... URL: From brado at bighillsoftware.com Wed May 22 23:22:37 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Wed, 22 May 2013 14:22:37 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> Message-ID: On May 22, 2013, at 1:29 PM, Kalileo wrote: > Please don't complain if you don't find many willing to discuss these theories with you, most here are looking for answers or trying to help others. I've never been wanting to "discuss theories" -- I am one of those people looking for concrete answers, with source code no less. The only reason people have conjecture about how things work is because it isn't documented anywhere, and the typical one-liner response on this mailing list frequently isn't any roadmap. Want an example? Sure -- let's take the example of another thread of mine from yesterday. Can you please produce a code example and accompanying description of exactly how to use AudioFrameQueue? That would help me tremendously. Neither resampling_audio.c, decoding_encoding.c, nor API doc to my knowledge explain this. > It's all open source, no secrets there, no need for theories. Everybody would appreciate that. That comment demonstrates exactly the reason why barring a dev doing it, the probability of a solid set of FFmpeg documentation materializing is low. Any perception that because FFmpeg is open source, everything is out there is obvious and someone should be able to walk up and independently document it seems at best an extremely ambitious (and likely to be outdated by the time it is completed), if not dead wrong, perception. Audio/video encoding/decoding/streaming is a fairly challenging domain to begin with, there is a lot of code, and there are many nuances that are not clear or obvious. Those have to be known. Anyone writing documentation would have to ask many and continual detailed questions and get detailed responses, to produce good documentation. While I might otherwise be interested, I've done my level best to ask detailed questions just to solve a few problems, and it is pretty clear such inquisition isn't going to be received well here (and one list member's offline explanation to me of why that is makes it a virtual impossibility). That doesn't even touch on the effort to hash through conflicting responses that don't always agree with one another. So I don't see my being able to do it as a realistic possibility. I would however encourage the devs to do it. The best way to avoid having to have detailed discussions with anyone is for them to do it themselves. I'm sure everyone *would* appreciate that. Brad From klaussfreire at gmail.com Wed May 22 23:46:22 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Wed, 22 May 2013 18:46:22 -0300 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> Message-ID: On Wed, May 22, 2013 at 6:22 PM, Brad O'Hearne wrote: >> It's all open source, no secrets there, no need for theories. Everybody would appreciate that. > > That comment demonstrates exactly the reason why barring a dev doing it, the probability of a solid set of FFmpeg documentation materializing is low. The probability of solid documentation when the one doing it isn't a dev, is in the vecinity of epsilon. From klaussfreire at gmail.com Wed May 22 23:48:30 2013 From: klaussfreire at gmail.com (Claudio Freire) Date: Wed, 22 May 2013 18:48:30 -0300 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> Message-ID: On Wed, May 22, 2013 at 6:46 PM, Claudio Freire wrote: > On Wed, May 22, 2013 at 6:22 PM, Brad O'Hearne > wrote: >>> It's all open source, no secrets there, no need for theories. Everybody would appreciate that. >> >> That comment demonstrates exactly the reason why barring a dev doing it, the probability of a solid set of FFmpeg documentation materializing is low. > > > The probability of solid documentation when the one doing it isn't a > dev, is in the vecinity of epsilon. Let me double-post (sorry) to clarify: in any project. Documentation requires intimate knowledge. From krueger at lesspain.de Wed May 22 23:51:02 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Wed, 22 May 2013 23:51:02 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> Message-ID: On Wed, May 22, 2013 at 6:53 PM, Brad O'Hearne wrote: > On May 22, 2013, at 9:02 AM, Robert Kr?ger wrote: > >> After all, most of the work is >> done by people in their spare time and I haven't found many developers >> who enjoy writing documentation (no matter how important docs are, I >> think we all agree on that). > > The problem, Robert, is bigger than just finding someone to document FFmpeg, getting volunteers, or motivating people. The bigger problem is that producing good documentation and discussion of a particular technical domain requires an inquisitive and exhaustive approach, willing to drill down to details, and ask questions which put design decisions and potentially either weaknesses or needs in the spotlight. The tone of this mailing list just doesn't have a thick-enough skin for that. The discourse on this list consistently demonstrates an inability to treat machinery as machinery, nuts and bolts, and instead quickly degenerates into personal attacks when a good answer isn't quickly obvious, or when someone refuses to consider that there may be a problem in some part of FFmpeg which someone has adopted as their turf. > > There is absolutely zero question in my mind, from the several projects I've had to solve with FFmpeg, discussions with others, numerous blog posts which lament the undocumented and unknown nature of various parts of FFmpeg, that save bug-fixing, adding a single additional line of code to FFmpeg pales in importance to thoroughly documenting the API with adequate discussion, documenting use, and producing some examples that address real-world use-cases, not "let's just generate some audio samples or a sample images for video", which avoids the real problems of building a robust app. > > I love writing, have written technical documentation and technical articles, and had several book deals offered. Given my frustrations and time loss due to a lack of documentation, if it were mine to script, I'd document the whole thing myself, and produce either a book or user guide on this. But given both my personal experiences thus far and observing others as well on this mailing list, I won't go anywhere near it. Too much shoot-the-messenger on this mailing list. Too much condescension if you ask a question without demonstrating deep expertise of a particular concept. Too much passion for sniping people because they don't just by default know something. That, Robert, is the primary problem -- with people making personal attacks, and an inability to drill into minutia with patience, people who would otherwise offer their services are driven away. > > I'm not just referring to my own experiences here, I've been on this mailing list a year and a half, and I've watched it with others, too. It's a shame. Entirely unnecessary. > > Brad my last reply to that, I promise. For the record, in (I think) about 5 years on this list, I would say that in about 70% of the occasions I properly documented a problem (reproducible test case or comparable) I got help (for free). Have there been occasions when I thought someone could have been more polite? Yes, but that's people and that happens everywhere. It's not ffmpeg policy to drive people away AFAICS. Especially in the past two years IMHO the tone has changed quite a bit (not claiming it is perfect). Have there been occasions where I disagreed with things developers have decided to do or been frustrated about it? Yes, but I am not really a contributor so the people doing the work have their decision making process and that's what I have to live with or go find another project or product to get the job done. Do I have my own opinion what ffmpeg should have their priorities set to? Sure, but hey, for every person actually making something happen in this project, there are probably at least a hundred out there thinking they know how things should be done so I bite my tongue most of the time. It's not my company/project and the way to get a say in these things is contributing, it's as simple as that. Has sponsoring someone to get a problem solved worked? Yes. Maybe it is something you can consider if you're stuck in a situation with ffmpeg for a paid job. I guess you are still going to pay less than you would have to, if you were licensing a commercial library by Mainconcept et al. If you think betting on that to work is too risky you _have_ to get a commercial alternative. Has complaining about the way things were run in this project by a non-contributor ever worked making anything better? Not that I know of and I swear, this is just meant as advice/observation not an attempt to attack or to diss you. Cheers and peace, Robert From alexcohn at netvision.net.il Thu May 23 01:27:55 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 23 May 2013 02:27:55 +0300 Subject: [Libav-user] Making a static lib with -MD option In-Reply-To: <1369217263633-4657706.post@n4.nabble.com> References: <1368441454747-4657578.post@n4.nabble.com> <1368509911028-4657584.post@n4.nabble.com> <1369208563114-4657698.post@n4.nabble.com> <1369217263633-4657706.post@n4.nabble.com> Message-ID: On Wed, May 22, 2013 at 1:07 PM, Steffen wrote: > Unfortunately not. > Example: > 1. dll (cio.dll) links statically to av.libs > 2. dll (crecord.dll) links to both statically to av.libs and dynamically to cio.dll > > That gives me: > cio.lib(cio.dll) : error LNK2005: _avpriv_snprintf already defined in libavutil.lib(snprintf.o) > cio.lib(cio.dll) : error LNK2005: _avpriv_vsnprintf already defined in libavutil.lib(snprintf.o) > cio.lib(cio.dll) : error LNK2005: _avpriv_strtod already defined in libavutil.lib(strtod.o) I don't think the warnings about "locally defined symbol _avpriv_snprintf imported" have anything to do with your problem. I am afraid your procedure is wrong. You have snprintf.o included both in cio.dll and in crecord.dll. I would suggest that you link crecord.dll only to cio.dll, without libavutil.lib. You will probably get quite a few unresolved references this way. The next step will be to use [/INCLUDE directive](http://msdn.microsoft.com/en-us/library/2s3hwbhs(v=vs.110).aspx) for all these unresolved references, and rebuild the cio.dll. Now, cio.dll will contain all references necessary to resolve the needs of crecord,dll, BR, Alex Cohn From bjoern.drabeck at gmail.com Thu May 23 03:54:05 2013 From: bjoern.drabeck at gmail.com (Bjoern Drabeck) Date: Thu, 23 May 2013 09:54:05 +0800 Subject: [Libav-user] Failure to read quicktime movie with FFMPEG 1.2.1 when built with Visual studio, works fine with today's git though In-Reply-To: <0ED54485BDF923428E38AB27448A35771A0B79B7@de08ex3007.global.ds.honeywell.com> References: <0ED54485BDF923428E38AB27448A35771A0B79B7@de08ex3007.global.ds.honeywell.com> Message-ID: > I have a particular quicktime .mov file that is 2,586,525,646 bytes > (unfortunately, I cannot share it due to license restrictions). > > > > With a Visual Studio 2012 build of the 1.2.1 source I get > > [mov,mp4,m4a,3gp,3g2,mj2 @ 06FFAE60] moov atom not found > > When I try to open the file with av_format_open. > > > > When I do the same build with the source from git on 2013-05-22 I am able to > read the file fine. > > > > Furthermore, the 1.2.1 source cross-compiled in Cygwin for Windows also > works fine (but some operations crash when using lots of threads in a Visual > Studio 2005 program, a problem that seems to go away with the Visual Studio > 2012 builds. > > Hi, I believe this might be related to this problem: http://libav-users.943685.n4.nabble.com/Libav-user-Building-with-MSVC-toolchain-resulting-in-seeking-problem-td4656914.html There was a patch made for that (on March 12th): Commit:713ac21097555722257343494f83999068006653 * avutil/os_support: use 64-bit fstat/lseek variants for MSVC as well http://ffmpeg.org/pipermail/ffmpeg-cvslog/2013-March/061893.html This fix didn't make it into the 1.2 release of ffmpeg though If you need to use 1.2 then maybe you can apply this yourself. regards, Bjoern From olivier.harel at gmail.com Thu May 23 07:17:07 2013 From: olivier.harel at gmail.com (Olivier Harel) Date: Wed, 22 May 2013 22:17:07 -0700 Subject: [Libav-user] AVframe: motion vectors Message-ID: Hello, motion_val in AVFrame is now deprecated. I didn't see any reference to alternate structures. Is there any way, using the latest libav, to have access to decoded motion vectors or has the capacity to export decoded motion vectors been removed from libavcodec? Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Thu May 23 08:58:23 2013 From: kalileo at universalx.net (Kalileo) Date: Thu, 23 May 2013 13:58:23 +0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> Message-ID: <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> On May 23, 2013, at 04:22 , Brad O'Hearne wrote: > On May 22, 2013, at 1:29 PM, Kalileo wrote: > >> Please don't complain if you don't find many willing to discuss these theories with you, most here are looking for answers or trying to help others. > > I've never been wanting to "discuss theories" -- I am one of those people looking for concrete answers, with source code no less. The only reason people have conjecture about how things work is because it isn't documented anywhere, and the typical one-liner response on this mailing list frequently isn't any roadmap. Want an example? Some more examples: I just re-read last night other threads on the search for some Info about planar aac which I remembered having seen somewhere here, threads such as "AAC with FLV", "Audio quality loss while encoding ", and "av_samples_fill_arrays and memory". Please reread them. You'll find the theories you elaborate, the attempts to point you to the errors in the basic assumptions / misunderstandings on which you based your theories (alignment/ packed / planar), then your elaborate justifications of your theories, then some desperate attempts to point you to the errors, and at the end you revisit your assumptions and then it works. If you expect full code examples to be worked out for you it might indeed be better to hire someone. Otherwise the 'one-liner' you get here is giving you quite often exactly the hint you need to continue. To any visitors stumbling upon this thread, I apologize for the waste of time. Over and out. From Steffen.Roeber at hella.com Thu May 23 09:31:14 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Thu, 23 May 2013 00:31:14 -0700 (PDT) Subject: [Libav-user] Written mjpeg files have no duration Message-ID: <1369294274206-4657728.post@n4.nabble.com> Written mjpeg files have no duration. Is there any way to retrieve them from anywhere? -- View this message in context: http://libav-users.943685.n4.nabble.com/Written-mjpeg-files-have-no-duration-tp4657728.html Sent from the libav-users mailing list archive at Nabble.com. From onemda at gmail.com Thu May 23 11:20:30 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 23 May 2013 09:20:30 +0000 Subject: [Libav-user] Written mjpeg files have no duration In-Reply-To: <1369294274206-4657728.post@n4.nabble.com> References: <1369294274206-4657728.post@n4.nabble.com> Message-ID: On 5/23/13, Steffen wrote: > Written mjpeg files have no duration. Is there any way to retrieve them > from > anywhere? No, as raw mjpeg does not store durations. > > > > > -- > View this message in context: > http://libav-users.943685.n4.nabble.com/Written-mjpeg-files-have-no-duration-tp4657728.html > Sent from the libav-users mailing list archive at Nabble.com. > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From onemda at gmail.com Thu May 23 11:40:25 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 23 May 2013 09:40:25 +0000 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> Message-ID: On 5/22/13, Robert Krueger wrote: > On Wed, May 22, 2013 at 6:53 PM, Brad O'Hearne > wrote: >> On May 22, 2013, at 9:02 AM, Robert Krueger wrote: >> >>> After all, most of the work is >>> done by people in their spare time and I haven't found many developers >>> who enjoy writing documentation (no matter how important docs are, I >>> think we all agree on that). >> >> The problem, Robert, is bigger than just finding someone to document >> FFmpeg, getting volunteers, or motivating people. The bigger problem is >> that producing good documentation and discussion of a particular technical >> domain requires an inquisitive and exhaustive approach, willing to drill >> down to details, and ask questions which put design decisions and >> potentially either weaknesses or needs in the spotlight. The tone of this >> mailing list just doesn't have a thick-enough skin for that. The discourse >> on this list consistently demonstrates an inability to treat machinery as >> machinery, nuts and bolts, and instead quickly degenerates into personal >> attacks when a good answer isn't quickly obvious, or when someone refuses >> to consider that there may be a problem in some part of FFmpeg which >> someone has adopted as their turf. >> >> There is absolutely zero question in my mind, from the several projects >> I've had to solve with FFmpeg, discussions with others, numerous blog >> posts which lament the undocumented and unknown nature of various parts of >> FFmpeg, that save bug-fixing, adding a single additional line of code to >> FFmpeg pales in importance to thoroughly documenting the API with adequate >> discussion, documenting use, and producing some examples that address >> real-world use-cases, not "let's just generate some audio samples or a >> sample images for video", which avoids the real problems of building a >> robust app. >> >> I love writing, have written technical documentation and technical >> articles, and had several book deals offered. Given my frustrations and >> time loss due to a lack of documentation, if it were mine to script, I'd >> document the whole thing myself, and produce either a book or user guide >> on this. But given both my personal experiences thus far and observing >> others as well on this mailing list, I won't go anywhere near it. Too much >> shoot-the-messenger on this mailing list. Too much condescension if you >> ask a question without demonstrating deep expertise of a particular >> concept. Too much passion for sniping people because they don't just by >> default know something. That, Robert, is the primary problem -- with >> people making personal attacks, and an inability to drill into minutia >> with patience, people who would otherwise offer their services are driven >> away. >> >> I'm not just referring to my own experiences here, I've been on this >> mailing list a year and a half, and I've watched it with others, too. It's >> a shame. Entirely unnecessary. >> >> Brad > > my last reply to that, I promise. > > For the record, in (I think) about 5 years on this list, I would say > that in about 70% of the occasions I properly documented a problem > (reproducible test case or comparable) I got help (for free). > > Have there been occasions when I thought someone could have been more > polite? Yes, but that's people and that happens everywhere. It's not > ffmpeg policy to drive people away AFAICS. Especially in the past two > years IMHO the tone has changed quite a bit (not claiming it is > perfect). > > Have there been occasions where I disagreed with things developers > have decided to do or been frustrated about it? Yes, but I am not > really a contributor so the people doing the work have their decision > making process and that's what I have to live with or go find another > project or product to get the job done. About what you are refering to? > > Do I have my own opinion what ffmpeg should have their priorities set > to? Sure, but hey, for every person actually making something happen > in this project, there are probably at least a hundred out there > thinking they know how things should be done so I bite my tongue most > of the time. It's not my company/project and the way to get a say in > these things is contributing, it's as simple as that. There is place where everyone can open new bug/feature request report. > > Has sponsoring someone to get a problem solved worked? Yes. Maybe it > is something you can consider if you're stuck in a situation with > ffmpeg for a paid job. I guess you are still going to pay less than > you would have to, if you were licensing a commercial library by > Mainconcept et al. If you think betting on that to work is too risky > you _have_ to get a commercial alternative. > > Has complaining about the way things were run in this project by a > non-contributor ever worked making anything better? Not that I know of > and I swear, this is just meant as advice/observation not an attempt > to attack or to diss you. > > Cheers and peace, > > Robert > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > From Steffen.Roeber at hella.com Thu May 23 12:03:53 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Thu, 23 May 2013 03:03:53 -0700 (PDT) Subject: [Libav-user] Written mjpeg files have no duration In-Reply-To: References: <1369294274206-4657728.post@n4.nabble.com> Message-ID: <1369303433841-4657731.post@n4.nabble.com> Ok. Thanx. -- View this message in context: http://libav-users.943685.n4.nabble.com/Written-mjpeg-files-have-no-duration-tp4657728p4657731.html Sent from the libav-users mailing list archive at Nabble.com. From krueger at lesspain.de Thu May 23 13:17:08 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Thu, 23 May 2013 13:17:08 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> Message-ID: On Thu, May 23, 2013 at 11:40 AM, Paul B Mahol wrote: > On 5/22/13, Robert Krueger wrote: >> On Wed, May 22, 2013 at 6:53 PM, Brad O'Hearne >> wrote: >>> On May 22, 2013, at 9:02 AM, Robert Krueger wrote: >>> >> >> my last reply to that, I promise. >> Have there been occasions where I disagreed with things developers >> have decided to do or been frustrated about it? Yes, but I am not >> really a contributor so the people doing the work have their decision >> making process and that's what I have to live with or go find another >> project or product to get the job done. > > About what you are refering to? Very few things that I am not bringing up here because I just think it's normal to disagree on things and this was not meant as criticism. > >> >> Do I have my own opinion what ffmpeg should have their priorities set >> to? Sure, but hey, for every person actually making something happen >> in this project, there are probably at least a hundred out there >> thinking they know how things should be done so I bite my tongue most >> of the time. It's not my company/project and the way to get a say in >> these things is contributing, it's as simple as that. > > There is place where everyone can open new bug/feature request report. Which I do use on a regular basis it is a good thing. The point I am making is that my experience is that when it comes to making decisions (where almost always trade-offs are involved), the voice of people who contribute code is more likely to count and that IMHO is the only way it can work (not only for ffmpeg but probably at almost any organisation, team, company people who take responsibility get to decide things at the end of the day). The point of my posting was to make clear that while I do understand that it sometimes can become frustrating trying to find out a particular thing about ffmpeg code or functionality, I think one has to remind oneself that you get probably the most comprehensive/capable media codec/format library on the planet for free (even if you use it in a commercial product and happen to get rich because of that) including a lot of support and then you have to also live with the implications of this not being a product you have a paid support contract for. IMHO this means you - should be humble when telling people how they should or should not run things - should not come here with a demanding attitude, expecting ffmpeg devs to take the time to post working code examples for your case even if they probably could or even expect anything. see anything that comes as a free gift. - if you think things should/could be improved, get involved by one of the following: - contribute code or docs - make good bug reports (concise, reproducible, taking away as much work from the dev as possible) or feature requests (and live with it if nobody works on them, because nobody really has to) - sponsor development Cheers, Robert Hope that clears up potential misunderstandings. From brado at bighillsoftware.com Thu May 23 17:24:22 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Thu, 23 May 2013 08:24:22 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> Message-ID: <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> On May 22, 2013, at 11:58 PM, Kalileo wrote: > Some more examples: I just re-read last night other threads on the search for some Info about planar aac which I remembered having seen somewhere here, threads such as "AAC with FLV", "Audio quality loss while encoding ", and "av_samples_fill_arrays and memory". > > Please reread them. You'll find the theories you elaborate, the attempts to point you to the errors in the basic assumptions / misunderstandings on which you based your theories (alignment/ packed / planar), then your elaborate justifications of your theories, then some desperate attempts to point you to the errors, and at the end you revisit your assumptions and then it works. If you had actually bothered to read my posts, or looked at the source code I provided, and were interested in helping rather than taking another condescending swipe at me, you'd know that I quit using the AAC encoder nearly a month ago, when two of the more vocal personalities on this list were diametrically opposed on the view of whether the AAC encoder was "worthless" and not being developed further, or whether it was very important, and surely to be supported and improved further. I've been using libmp3lame for nearly a month. And the quality loss issue was solved soon after switching codecs. That issue hasn't been on the table for some time now. I have had source code posted for 2 months, and my questions during this time have derived directly from the things I was seeing, which you and everyone else have been able to read yourself and run. I even put a nice UI and log file on it so anyone could run and demonstrate the use case without reading source code. Furthermore, it has been posted that most or all of the devs don't run OS X.-- exactly how is everyone so sure and can rule out that what I'm seeing couldn't possibly be an aberration which manifests itself specifically on OS X? Has such a thing ever been possible in the computing world, or is that just not a possibility? So who is talking in theories here, the guy with source code saying "here is what I'm seeing", or the guy who obviously hasn't looked at the source code, likely doesn't run on the same platform, and isn't even aware of what the current problem on the table is? > If you expect full code examples to be worked out for you it might indeed be better to hire someone. Otherwise the 'one-liner' you get here is giving you quite often exactly the hint you need to continue. You were asked a direct question yesterday -- no "theory" -- how do you use AudioFrameQueue. I have found zero discussion of it. The code examples don't address it -- in fact grepping the FFmpeg source shows it is barely referenced throughout FFmpeg. And you have neglected to answer it. If you have no clue, just say you don't know. Otherwise, don't try to cover the fact that you have no answer with a condescending jab insinuating that another developer needs to hire someone because he isn't up to the task. This is exactly what I've been talking about in regards to the tone on this list. There is more passion on this list for knocking someone and telling them they are wrong, then actually listening to the problem and helping them. It isn't a climate that breeds either civility or productivity. Kalileo -- why don't you just delete my posts and not reply to them. I'm not much interested in taking continual digs from you, or for that matter, Paul -- and even more so, I am wearying of having to respond continually to both of you guys with explanation as to why whatever zinger you fired off did not solve the problem, so those others on the list who might be interested in giving actual help know the question is still on the table. I've tried to be friendly with you guys, but it is clear neither of you are interested in that, and I'm not interested in conflict. I need to get a problem solved. So just delete any posts from me and don't reply. I and I'm sure everyone else would appreciate the end of these exchanges. Brad From onemda at gmail.com Thu May 23 17:41:50 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 23 May 2013 15:41:50 +0000 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> Message-ID: On 5/23/13, Brad O'Hearne wrote: > On May 22, 2013, at 11:58 PM, Kalileo wrote: > >> Some more examples: I just re-read last night other threads on the search >> for some Info about planar aac which I remembered having seen somewhere >> here, threads such as "AAC with FLV", "Audio quality loss while encoding >> ", and "av_samples_fill_arrays and memory". >> >> Please reread them. You'll find the theories you elaborate, the attempts >> to point you to the errors in the basic assumptions / misunderstandings on >> which you based your theories (alignment/ packed / planar), then your >> elaborate justifications of your theories, then some desperate attempts to >> point you to the errors, and at the end you revisit your assumptions and >> then it works. > > If you had actually bothered to read my posts, or looked at the source code > I provided, and were interested in helping rather than taking another > condescending swipe at me, you'd know that I quit using the AAC encoder > nearly a month ago, when two of the more vocal personalities on this list > were diametrically opposed on the view of whether the AAC encoder was > "worthless" and not being developed further, or whether it was very > important, and surely to be supported and improved further. I've been using > libmp3lame for nearly a month. And the quality loss issue was solved soon > after switching codecs. That issue hasn't been on the table for some time > now. > > I have had source code posted for 2 months, and my questions during this > time have derived directly from the things I was seeing, which you and > everyone else have been able to read yourself and run. I even put a nice UI > and log file on it so anyone could run and demonstrate the use case without > reading source code. Furthermore, it has been posted that most or all of the > devs don't run OS X.-- exactly how is everyone so sure and can rule out that > what I'm seeing couldn't possibly be an aberration which manifests itself > specifically on OS X? Has such a thing ever been possible in the computing > world, or is that just not a possibility? So who is talking in theories > here, the guy with source code saying "here is what I'm seeing", or the guy > who obviously hasn't looked at the source code, likely doesn't run on the > same platform, and isn't even aware of what the current problem on the table > is? > >> If you expect full code examples to be worked out for you it might indeed >> be better to hire someone. Otherwise the 'one-liner' you get here is >> giving you quite often exactly the hint you need to continue. > > You were asked a direct question yesterday -- no "theory" -- how do you use > AudioFrameQueue. I have found zero discussion of it. The code examples don't > address it -- in fact grepping the FFmpeg source shows it is barely > referenced throughout FFmpeg. And you have neglected to answer it. If you > have no clue, just say you don't know. Otherwise, don't try to cover the > fact that you have no answer with a condescending jab insinuating that > another developer needs to hire someone because he isn't up to the task. > > This is exactly what I've been talking about in regards to the tone on this > list. There is more passion on this list for knocking someone and telling > them they are wrong, then actually listening to the problem and helping > them. It isn't a climate that breeds either civility or productivity. > Kalileo -- why don't you just delete my posts and not reply to them. I'm not > much interested in taking continual digs from you, or for that matter, Paul > -- and even more so, I am wearying of having to respond continually to both > of you guys with explanation as to why whatever zinger you fired off did not > solve the problem, so those others on the list who might be interested in > giving actual help know the question is still on the table. > > I've tried to be friendly with you guys, but it is clear neither of you are > interested in that, and I'm not interested in conflict. I need to get a > problem solved. So just delete any posts from me and don't reply. I and I'm > sure everyone else would appreciate the end of these exchanges. > You know, devs are humans too and they need to work on paid job to have something to eat. So expecting that anybody should reply to your request in less than 24h is unrealistic. If you actually paid for support I would understand your frustration but otherwise I just can't consider your mails seriously. From brado at bighillsoftware.com Thu May 23 18:28:16 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Thu, 23 May 2013 09:28:16 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <711DC548-C20B-4C5F-A1BB-B96CA495AB74@bighillsoftware.c om> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> Message-ID: <44A284B2-229A-4AEF-ABCA-11F69B5D2B20@bighillsoftware.com> On May 23, 2013, at 8:41 AM, Paul B Mahol wrote: > You know, devs are humans too and they need to work on paid job to > have something to eat. That pressing job seems to provide ample time to call me "troll", label my questions and reports of FFmpeg behavior "FUD", which interferes in my communication with others on this list and make it more difficult for me to get my problems solved, which is *my* job and feeds my family. > So expecting that anybody should reply to your request in less than > 24h is unrealistic. I never said anything about response time. > If you actually paid for support I would understand your frustration > but otherwise > I just can't consider your mails seriously. Well that pretty much explains it...because I'm not paying you, you aren't interested in taking my posts seriously. Open source is kind of a dubious place for that perspective. There's no need for you to respond to any more of my posts...I'd like serious responses, not someone who is posting noise, and interfering in my ability to communicate with those on this mailing list who are serious. B From krueger at lesspain.de Thu May 23 23:04:23 2013 From: krueger at lesspain.de (=?UTF-8?Q?Robert_Kr=C3=BCger?=) Date: Thu, 23 May 2013 23:04:23 +0200 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <44A284B2-229A-4AEF-ABCA-11F69B5D2B20@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> <44A284B2-229A-4AEF-ABCA-11F69B5D2B20@bighillsoftware.com> Message-ID: On Thu, May 23, 2013 at 6:28 PM, Brad O'Hearne wrote: > On May 23, 2013, at 8:41 AM, Paul B Mahol wrote: is posting noise, and interfering in my ability to communicate with those on this mailing list who are serious. now this (the claim he does not belong to the serious people on this list) addressed to someone probably belonging to the current top five devs in terms of effort and productivity for this project (both in terms of contributed code and help provided to users on this list)... Please, take a step back and reality-check your statements. You're so off-track here. And sorry, I had promised I wasn't going to comment on this anymore. From brado at bighillsoftware.com Thu May 23 23:54:05 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Thu, 23 May 2013 14:54:05 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> <44A284B2-229A-4AEF-ABCA-11F69B5D2B20@bighillsoftware.com> Message-ID: <6E1A4B01-8968-46F2-96B4-92CD721DE115@bighillsoftware.com> On May 23, 2013, at 2:04 PM, Robert Kr?ger wrote: > On Thu, May 23, 2013 at 6:28 PM, Brad O'Hearne > wrote: >> On May 23, 2013, at 8:41 AM, Paul B Mahol wrote: > is posting noise, and interfering in my ability to communicate with > those on this mailing list who are serious. > > now this (the claim he does not belong to the serious people on this > list) addressed to someone probably belonging to the current top five > devs in terms of effort and productivity for this project (both in > terms of contributed code and help provided to users on this list)... > Please, take a step back and reality-check your statements. You're so > off-track here. This isn't debatable anymore, Robert -- this isn't my opinion, these are Paul's words: > If you actually paid for support I would understand your frustration > but otherwise > I just can't consider your mails seriously. Paul's made a willful effort to impugn both me and my efforts here (and by extension my customer), calling me "troll" and labeling my questions and reported problems "FUD" multiple times, admitting that because money hasn't changed hands, he admits he's not taking my posts seriously. His words, not mine, argue the point with him. If this is what you choose to exalt as "Top five...", I'm fine with being considered "off-track". I don't want to share in any ideology or number myself with those that considers this kind of behavior professional or acceptable. It is completely counter to the principles of community, collaboration, and productivity. B From onemda at gmail.com Thu May 23 23:56:18 2013 From: onemda at gmail.com (Paul B Mahol) Date: Thu, 23 May 2013 21:56:18 +0000 Subject: [Libav-user] qscale for vorbis encoder In-Reply-To: References: Message-ID: On 5/20/13, YIRAN LI wrote: > Hi Guys, > > I'm trying encoding ogg video with native experimental vorbis encoder. > While documentation here says the max qscale is 10 for vorbis audio, and > default is 6, http://ffmpeg.org/trac/ffmpeg/wiki/TheoraVorbisEncodingGuide > > But I found that even if I pass 150 to -qscale:a I still can get files with > larger size than -qscale:10 (I keep same qscale for video, so I assume the > size increment is caused by audio part). > > and the code fragment for vorbis quality is here > > avccontext->bit_rate = 0; > if (avccontext->flags & CODEC_FLAG_QSCALE) > venc->quality = avccontext->global_quality / (float)FF_QP2LAMBDA; > else > venc->quality = 8; > venc->quality *= venc->quality; > > > So could anyone tell me what's the maximum value I can set > AVCodecCtx->global_quality for Vorbis encoder? Why not just use libvorbis encoder wrapper? The native vorbis encoder is experimental because its development stalled once bitstream generated by it becomes valid. So native vorbis experimental encoder is worse than most other exerimental encoders in lavc. From cnelson at ina.fr Fri May 24 09:40:39 2013 From: cnelson at ina.fr (Christophe Nelson) Date: Fri, 24 May 2013 07:40:39 +0000 Subject: [Libav-user] Hevc In-Reply-To: References: <853FB49B5740B24B965337850CCA7E1538E84C7D@AMSPRD0410MB375.eurprd04.prod.outlook.com> Message-ID: <853FB49B5740B24B965337850CCA7E1538E87385@AMSPRD0410MB375.eurprd04.prod.outlook.com> Sorry i'm not a dev Christophe -----Message d'origine----- De?: libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] De la part de Carl Eugen Hoyos Envoy??: mercredi 22 mai 2013 11:33 ??: libav-user at ffmpeg.org Objet?: Re: [Libav-user] Hevc Christophe Nelson writes: > I am wondering if some of the developers of ffmpeg have any intention > to implement HEVC in ffmpeg ? Yes. If you are interested in contributing, please setup your own git clone and join #ffmpeg-devel on freenode. Carl Eugen _______________________________________________ Libav-user mailing list Libav-user at ffmpeg.org http://ffmpeg.org/mailman/listinfo/libav-user From soho123.2012 at gmail.com Fri May 24 10:46:05 2013 From: soho123.2012 at gmail.com (Soho Soho123) Date: Fri, 24 May 2013 16:46:05 +0800 Subject: [Libav-user] ffserver lost ffm header Message-ID: hiAnyone know the issue fixed or not? Issue855:ffserver hangs when feeding it via http -------------- next part -------------- An HTML attachment was scrubbed... URL: From cnelson at ina.fr Fri May 24 14:56:09 2013 From: cnelson at ina.fr (Christophe Nelson) Date: Fri, 24 May 2013 12:56:09 +0000 Subject: [Libav-user] X264 issue : Black Frame In-Reply-To: References: Message-ID: <853FB49B5740B24B965337850CCA7E1538E875A4@AMSPRD0410MB375.eurprd04.prod.outlook.com> Hello I?ve got a problem to play files encoded with x264. I ?ve done this : ffmpeg.exe -i InputFile -c:v libx264 -preset slow -crf 20 -c:a copy OutputFile.avi When I read this file in VLC, GraphEdit, there?s no problem But when I read it in VirtualDub, MSU quality measurement, avitoyuv.exe I have 5 black frames at the beginning ! I?m pretty sure I use FFDshow in all this software (exepted in VLC). Could someone help me ? Do I need to install codecs ? Do I need to changed my ffmpeg command line ? Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Sat May 25 09:36:55 2013 From: kalileo at universalx.net (Kalileo) Date: Sat, 25 May 2013 14:36:55 +0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <6E1A4B01-8968-46F2-96B4-92CD721DE115@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> <44A284B2-229A-4AEF-ABCA-11F69B5D2B20@bighillsoftware.com> <6E1A4B01-8968-46F2-96B4-92CD721DE115@bighillsoftware.com> Message-ID: On May 24, 2013, at 04:54 , Brad O'Hearne wrote: > If this is what you choose to exalt as "Top five...", I'm fine with being considered "off-track". I don't want to share in any ideology or number myself with those that considers this kind of behavior professional or acceptable. It is completely counter to the principles of community, collaboration, and productivity. > As Paul said, please, please, please: "Please, take a step back and reality-check your statements. You're so off-track here." Please! From kalileo at universalx.net Sat May 25 10:03:53 2013 From: kalileo at universalx.net (Kalileo) Date: Sat, 25 May 2013 15:03:53 +0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> <44A284B2-229A-4AEF-ABCA-11F69B5D2B20@bighillsoftware.com> <6E1A4B01-8968-46F2-96B4-92CD721DE115@bighillsoftware.com> Message-ID: <163C4308-CCA5-49DC-8022-C6743528ABA3@universalx.net> On May 25, 2013, at 14:36 , Kalileo wrote: > > On May 24, 2013, at 04:54 , Brad O'Hearne wrote: > >> If this is what you choose to exalt as "Top five...", I'm fine with being considered "off-track". I don't want to share in any ideology or number myself with those that considers this kind of behavior professional or acceptable. It is completely counter to the principles of community, collaboration, and productivity. >> > > As Paul said, please, please, please: "Please, take a step back and reality-check your statements. You're so off-track here." > Please! Sorry, correction: As Robert said, please, please, please: "Please, take a step back and reality-check your statements. You're so off-track here." Please! From brado at bighillsoftware.com Sat May 25 19:31:42 2013 From: brado at bighillsoftware.com (Brad O'Hearne) Date: Sat, 25 May 2013 10:31:42 -0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <163C4308-CCA5-49DC-8022-C6743528ABA3@universalx.net> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> <44A284B2-229A-4AEF-ABCA-11F69B5D2B20@bighillsoftware.com> <6E1A4B01-8968-46F2-96B4-92CD721DE115@bighillsoftware.com> <163C4308-CCA5-49DC-8022-C6743528ABA3@universalx.net> Message-ID: <1DE51F5D-44FF-4831-8AFA-E23EAE9AF397@bighillsoftware.com> On May 25, 2013, at 1:03 AM, Kalileo wrote: > As Robert said, please, please, please: "Please, take a step back and reality-check your statements. You're so off-track here." I am going to conclude my discourse here by passing on one more nugget of info about how "off-track" I am. I was contacted off-list by a self-proclaimed list-vetteran (5+ years) who explained to me that because most of the list devs first language wasn't English, posting anything of substance or length provides an obstacle to them. Furthermore, these non-first-language-English speakers considered my "style" of communication "colloquial", and didn't like it. Even my writing proper English on an English mailing list is a foul -- the pettiness here apparently has few bounds. All I have done here is point out inconsistencies in explanations I was given, omissions in documentation and examples, reported what I was seeing in source code I provided, and reported a verified crash in avcodec_encode_audio2. For that I've been called "troll" and had my posts publicly written off as "FUD", and now I'm "off-track" simply for quoting the ones who said so. I'm not all that slow on the uptake -- I've been around these mailing lists for 20+ years, and I've seen many open source projects that are driven by personality, and willingly set aside potential progress to protect personal fiefdoms. I had thoughts a while back of attempting to document FFmpeg, or putting some more pragmatic HOW-TO examples together, or maybe even putting a whole OS X Cocoa wrapper around FFmpeg (which would have produced another public API for Mac users which *could* be documented). But it is clear that there's no point in such an attempt. I get that you want me gone...and as my presence here is merely an extension of my customer's FFmpeg needs, I've already recommended to them that they need to migrate off of FFmpeg for support reasons. Provided they agree to do it, that will happen, and I'll take our user feedback (which in other places is welcomed, in the commercial world, even paid for) elsewhere. In the meantime, you can label it however you want, excoriate me for it again for merely reporting it if that floats your boat, but you've got a bug in libavcodec. It may well be caused by a usage issue, but it is an error condition FFmpeg doesn't catch either by assertion or error handling, and it crashes inside FFmpeg code. Investigate it or ignore it...that's up to you. That's the last I have to say about any of this. Brad From onemda at gmail.com Sat May 25 20:46:44 2013 From: onemda at gmail.com (Paul B Mahol) Date: Sat, 25 May 2013 18:46:44 +0000 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <1DE51F5D-44FF-4831-8AFA-E23EAE9AF397@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> <44A284B2-229A-4AEF-ABCA-11F69B5D2B20@bighillsoftware.com> <6E1A4B01-8968-46F2-96B4-92CD721DE115@bighillsoftware.com> <163C4308-CCA5-49DC-8022-C6743528ABA3@universalx.net> <1DE51F5D-44FF-4831-8AFA-E23EAE9AF397@bighillsoftware.com> Message-ID: On 5/25/13, Brad O'Hearne wrote: > On May 25, 2013, at 1:03 AM, Kalileo wrote: > >> As Robert said, please, please, please: "Please, take a step back and >> reality-check your statements. You're so off-track here." > > I am going to conclude my discourse here by passing on one more nugget of > info about how "off-track" I am. I was contacted off-list by a > self-proclaimed list-vetteran (5+ years) who explained to me that because > most of the list devs first language wasn't English, posting anything of > substance or length provides an obstacle to them. Furthermore, these > non-first-language-English speakers considered my "style" of communication > "colloquial", and didn't like it. It was not about first language or overly long text, but because of overal tone of post you make. And posing anything of substance or length does not provide obstacle to me. > > Even my writing proper English on an English mailing list is a foul -- the > pettiness here apparently has few bounds. All I have done here is point out > inconsistencies in explanations I was given, omissions in documentation and > examples, reported what I was seeing in source code I provided, and reported > a verified crash in avcodec_encode_audio2. For that I've been called "troll" > and had my posts publicly written off as "FUD", and now I'm "off-track" > simply for quoting the ones who said so. Its not exactly FUD or troll, you were doing neither of that, and I must admit I did mistake and was wrong when saying you behave as such. > > I'm not all that slow on the uptake -- I've been around these mailing lists > for 20+ years, and I've seen many open source projects that are driven by > personality, and willingly set aside potential progress to protect personal > fiefdoms. I had thoughts a while back of attempting to document FFmpeg, or > putting some more pragmatic HOW-TO examples together, or maybe even putting > a whole OS X Cocoa wrapper around FFmpeg (which would have produced another > public API for Mac users which *could* be documented). But it is clear that > there's no point in such an attempt. I get that you want me gone...and as my > presence here is merely an extension of my customer's FFmpeg needs, I've > already recommended to them that they need to migrate off of FFmpeg for > support reasons. Provided they agree to do it, that will happen, and I'll > take our user feedback (which in other places is welcomed, in the commercial > world, even paid for) elsewhere. Nobody wants you gone. > > In the meantime, you can label it however you want, excoriate me for it > again for merely reporting it if that floats your boat, but you've got a bug > in libavcodec. It may well be caused by a usage issue, but it is an error > condition FFmpeg doesn't catch either by assertion or error handling, and it > crashes inside FFmpeg code. Investigate it or ignore it...that's up to you. Is this some kind of puzzle? > > > That's the last I have to say about any of this. > > Brad From kalileo at universalx.net Sat May 25 23:04:45 2013 From: kalileo at universalx.net (Kalileo) Date: Sun, 26 May 2013 04:04:45 +0700 Subject: [Libav-user] Encoding with variable frame rate In-Reply-To: <1DE51F5D-44FF-4831-8AFA-E23EAE9AF397@bighillsoftware.com> References: <1369042005385-4657639.post@n4.nabble.com> <49CD2120-5C73-4F5B-9ABC-F0E2AF084343@bighillsoftware.com> <6A7D881F-7543-42F9-AED3-32CB870A917D@universalx.net> <8B4BC32B-9348-49E3-B1B6-C4C5CBF54583@bighillsoftware.com> <83828B81-388C-4F06-91A4-EE4A421AEE2F@universalx.net> <410D6CF8-FE3A-43BD-B650-90D2D20FC8A5@bighillsoftware.com> <519BACE6.70201@jetheaddev.com> <26906E8E-F150-4212-9D78-D3E59427648A@bighillsoftware.com> <519BC2DC.1060309@jetheaddev.com> <3F6085E4-D90F-41BA-8311-1FDD6608FE98@bighillsoftware.com> <1A462908-6F17-4CB4-8202-B8F3E563199B@bighillsoftware.com> <4C524240-8DE1-4159-A517-ED4E8CDAFC02@universalx.net> <3E0326A6-5605-4651-9F80-A6936480DD18@universalx.net> <0E793D05-40B5-4A0E-9B88-306A7A49A2C2@bighillsoftware.com> <44A284B2-229A-4AEF-ABCA-11F69B5D2B20@bighillsoftware.com> <6E1A4B01-8968-46F2-96B4-92CD721DE115@bighillsoftware.com> <163C4308-CCA5-49DC-8022-C6743528ABA3@universalx.net> <1DE51F5D-44FF-4831-8AFA-E23EAE9AF397@bighillsoftware.com> Message-ID: <39752EAE-FC10-4A5B-93AE-7CCB8E2E0918@universalx.net> On May 26, 2013, at 00:31 , Brad O'Hearne wrote: > On May 25, 2013, at 1:03 AM, Kalileo wrote: > >> As Robert said, please, please, please: "Please, take a step back and reality-check your statements. You're so off-track here." > > ? > I get that you want me gone? This is where you are so off-track. Nobody wants you (or anyone else) to be gone. Please consider the possibility that everyone who replied to you here genuinely was trying to help you. From hamidi at gmail.com Mon May 27 12:02:51 2013 From: hamidi at gmail.com (hamidi) Date: Mon, 27 May 2013 14:32:51 +0430 Subject: [Libav-user] 920306 - avcodec_find_encoder(CODEC_ID_H264) returns NULL Message-ID: i also tried make install on source of ffmpeg (libav), but it didn't solve the problem. OS: precise what may be the reason and how can i resolve the problem? thx -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Mon May 27 14:10:02 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 27 May 2013 12:10:02 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?920306_-_avcodec=5Ffind=5Fencoder=28CODEC?= =?utf-8?q?=5FID=5FH264=29_returns_NULL?= References: Message-ID: hamidi writes: > i also tried make install on source of ffmpeg (libav) Please understand that libav contains several hundred known, user-reported bugs that are not reproducible with FFmpeg, some of them security- relevant, and we therefore cannot support it. > what may be the reason and how can i resolve the problem? Use the configure option --enable-libx264 Carl Eugen From hamidi at gmail.com Mon May 27 15:49:22 2013 From: hamidi at gmail.com (hamidi) Date: Mon, 27 May 2013 18:19:22 +0430 Subject: [Libav-user] 920306 - avcodec_find_encoder(CODEC_ID_H264) returns NULL In-Reply-To: References: Message-ID: thanx 4 the reply i've already tried the option. after downloading and extracting the source, i tried the following: ./configure --enable-libx264 --enable-gpl make install but the function still returns NULL. what can i do? thx On Mon, May 27, 2013 at 4:40 PM, Carl Eugen Hoyos wrote: > hamidi writes: > > > i also tried make install on source of ffmpeg (libav) > > Please understand that libav contains several > hundred known, user-reported bugs that are not > reproducible with FFmpeg, some of them security- > relevant, and we therefore cannot support it. > > > what may be the reason and how can i resolve the problem? > > Use the configure option --enable-libx264 > > Carl Eugen > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Mon May 27 16:04:47 2013 From: kalileo at universalx.net (Kalileo) Date: Mon, 27 May 2013 21:04:47 +0700 Subject: [Libav-user] 920306 - avcodec_find_encoder(CODEC_ID_H264) returns NULL In-Reply-To: References: Message-ID: <22F732B1-4A2A-4C73-A1FE-68AB4CEC53B2@universalx.net> On May 27, 2013, at 20:49 , hamidi wrote: > thanx 4 the reply > i've already tried the option. after downloading and extracting the source, i tried the following: > ./configure --enable-libx264 --enable-gpl > make install > but the function still returns NULL. > what can i do? > thx there should be a make in between, example: ./configure --enable-libx264 [your other options] make sudo make install Watch carefully for any error messages. Also, did you install x264 before ? From hamidi at gmail.com Mon May 27 16:30:26 2013 From: hamidi at gmail.com (hamidi) Date: Mon, 27 May 2013 19:00:26 +0430 Subject: [Libav-user] 920306 - avcodec_find_encoder(CODEC_ID_H264) returns NULL In-Reply-To: <22F732B1-4A2A-4C73-A1FE-68AB4CEC53B2@universalx.net> References: <22F732B1-4A2A-4C73-A1FE-68AB4CEC53B2@universalx.net> Message-ID: oh ic! so i forgot make. thx now, when i make my project i get the following errors: */hamidi/libav/libav-0.8.6/libavcodec/libx264.c:126: undefined reference to `x264_picture_init' /hamidi/libav/libav-0.8.6/libavcodec/libx264.c:128: undefined reference to `x264_bit_depth' /hamidi/libav/libav-0.8.6/libavcodec/libx264.c:146: undefined reference to `x264_encoder_reconfig' ... * i'm not sure about x264 whether installed. the installed packages including x264 in their names are: *libx264-120 * *libx264-dev * i got it from the following command: *dpkg -l|grep 264 * On Mon, May 27, 2013 at 6:34 PM, Kalileo wrote: > > On May 27, 2013, at 20:49 , hamidi wrote: > > > thanx 4 the reply > > i've already tried the option. after downloading and extracting the > source, i tried the following: > > ./configure --enable-libx264 --enable-gpl > > make install > > but the function still returns NULL. > > what can i do? > > thx > > there should be a make in between, example: > > ./configure --enable-libx264 [your other options] > make > sudo make install > > Watch carefully for any error messages. > > Also, did you install x264 before ? > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Mon May 27 16:38:09 2013 From: kalileo at universalx.net (Kalileo) Date: Mon, 27 May 2013 21:38:09 +0700 Subject: [Libav-user] 920306 - avcodec_find_encoder(CODEC_ID_H264) returns NULL In-Reply-To: References: <22F732B1-4A2A-4C73-A1FE-68AB4CEC53B2@universalx.net> Message-ID: <1D297534-7B8D-4447-8A33-426110F7D374@universalx.net> On May 27, 2013, at 21:30 , hamidi wrote: > oh ic! so i forgot make. thx > now, when i make my project i get the following errors: > > /hamidi/libav/libav-0.8.6/libavcodec/libx264.c:126: undefined reference to `x264_picture_init' > /hamidi/libav/libav-0.8.6/libavcodec/libx264.c:128: undefined reference to `x264_bit_depth' > /hamidi/libav/libav-0.8.6/libavcodec/libx264.c:146: undefined reference to `x264_encoder_reconfig' > ... > > i'm not sure about x264 whether installed. the installed packages including x264 in their names are: > > libx264-120 > libx264-dev > > i got it from the following command: > > dpkg -l|grep 264 > I recommend to install x264 from source, same as you try to install ffmpeg from source. Installing x264 from source will install the libx264 development headers and libraries, which you need to compile ffmpeg with option --enable-libx264 From hamidi at gmail.com Mon May 27 17:05:24 2013 From: hamidi at gmail.com (hamidi) Date: Mon, 27 May 2013 19:35:24 +0430 Subject: [Libav-user] 920306 - avcodec_find_encoder(CODEC_ID_H264) returns NULL In-Reply-To: <1D297534-7B8D-4447-8A33-426110F7D374@universalx.net> References: <22F732B1-4A2A-4C73-A1FE-68AB4CEC53B2@universalx.net> <1D297534-7B8D-4447-8A33-426110F7D374@universalx.net> Message-ID: what do u mean by 'from source'. i'm a newbie in ubuntu and ffmpeg. do u need to install it by using apt-get install? about x264, i thought it to be a command line utility. after installing x264 by apt-get install, i've to add -lx264 to g++ commands to make my project. On Mon, May 27, 2013 at 7:08 PM, Kalileo wrote: > > On May 27, 2013, at 21:30 , hamidi wrote: > > > oh ic! so i forgot make. thx > > now, when i make my project i get the following errors: > > > > /hamidi/libav/libav-0.8.6/libavcodec/libx264.c:126: undefined reference > to `x264_picture_init' > > /hamidi/libav/libav-0.8.6/libavcodec/libx264.c:128: undefined reference > to `x264_bit_depth' > > /hamidi/libav/libav-0.8.6/libavcodec/libx264.c:146: undefined reference > to `x264_encoder_reconfig' > > ... > > > > i'm not sure about x264 whether installed. the installed packages > including x264 in their names are: > > > > libx264-120 > > libx264-dev > > > > i got it from the following command: > > > > dpkg -l|grep 264 > > > > I recommend to install x264 from source, same as you try to install ffmpeg > from source. > > Installing x264 from source will install the libx264 development headers > and libraries, which you need to compile ffmpeg with option > --enable-libx264 > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user > -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Mon May 27 18:05:06 2013 From: kalileo at universalx.net (Kalileo) Date: Mon, 27 May 2013 23:05:06 +0700 Subject: [Libav-user] 920306 - avcodec_find_encoder(CODEC_ID_H264) returns NULL In-Reply-To: References: <22F732B1-4A2A-4C73-A1FE-68AB4CEC53B2@universalx.net> <1D297534-7B8D-4447-8A33-426110F7D374@universalx.net> Message-ID: <6EE94773-839B-404A-9848-20ABF26B7D6B@universalx.net> On May 27, 2013, at 22:05 , hamidi wrote: > what do u mean by 'from source'. i'm a newbie in ubuntu and ffmpeg. do u need to install it by using apt-get install? > about x264, i thought it to be a command line utility. > after installing x264 by apt-get install, i've to add -lx264 to g++ commands to make my project. To compile ffmpeg with x264, you don't need the x264 binary, but the libx264 headers and library. If you use apt-get, then you probably have to install also a package called x264-dev or x264-devel or libx264-dev or similar. I'm sure there are howtos in the ubuntu community. I would compile x264 from current sources though, simply to get the latest and greatest version. From cehoyos at ag.or.at Tue May 28 00:02:32 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Mon, 27 May 2013 22:02:32 +0000 (UTC) Subject: [Libav-user] =?utf-8?q?920306_-_avcodec=5Ffind=5Fencoder=28CODEC?= =?utf-8?q?=5FID=5FH264=29_returns_NULL?= References: <22F732B1-4A2A-4C73-A1FE-68AB4CEC53B2@universalx.net> Message-ID: hamidi writes: > /hamidi/libav/libav-0.8.6/libavcodec/libx264.c As said, this is unmaintained and buggy. Please see http://ffmpeg.org/download.html for supported versions and http://blog.pkh.me/p/13-the-ffmpeg-libav-situation.html for more information. Carl Eugen From Steffen.Roeber at hella.com Tue May 28 12:05:20 2013 From: Steffen.Roeber at hella.com (Steffen) Date: Tue, 28 May 2013 03:05:20 -0700 (PDT) Subject: [Libav-user] Making a static lib with -MD option In-Reply-To: References: <1368441454747-4657578.post@n4.nabble.com> <1368509911028-4657584.post@n4.nabble.com> <1369208563114-4657698.post@n4.nabble.com> <1369217263633-4657706.post@n4.nabble.com> Message-ID: <1369735520890-4657756.post@n4.nabble.com> I finally merged cio and crecord. But the warnings are not very nice. Especially there is no way to disable them. -- View this message in context: http://libav-users.943685.n4.nabble.com/Making-a-static-lib-with-MD-option-tp4657578p4657756.html Sent from the libav-users mailing list archive at Nabble.com. From soho123.2012 at gmail.com Tue May 28 12:58:21 2013 From: soho123.2012 at gmail.com (Soho Soho123) Date: Tue, 28 May 2013 18:58:21 +0800 Subject: [Libav-user] Fwd: ffserver can not get valid ffm header around ffm file size In-Reply-To: References: Message-ID: Hi All, I got the problem about ffserver can not get a valid ffm header. Such that ffserver can not get correct packet size and stream index around all ffm file size. how to reset the index for ffserver read video data for output stream? Does anyone have idea? -------------- next part -------------- An HTML attachment was scrubbed... URL: From cnelson at ina.fr Wed May 29 15:55:47 2013 From: cnelson at ina.fr (Christophe Nelson) Date: Wed, 29 May 2013 13:55:47 +0000 Subject: [Libav-user] X264 issue : Black Frame In-Reply-To: <853FB49B5740B24B965337850CCA7E1538E875A4@AMSPRD0410MB375.eurprd04.prod.outlook.com> References: <853FB49B5740B24B965337850CCA7E1538E875A4@AMSPRD0410MB375.eurprd04.prod.outlook.com> Message-ID: <853FB49B5740B24B965337850CCA7E1538E87F68@AMSPRD0410MB375.eurprd04.prod.outlook.com> Hi To add information to my last post, when I open it in MTS4ea (Tektronix measurement tool) I?ve got this message and can?t open the file : No sequence_header_code found within 5242880 bytes of start position Stream position: 0x0 (dec.0), bit 0 Bitstream context: [] I understand that there is a problem ;-) but that?s all So, I need help to do a h264 video in a avi file and I would like to use the quantification control (CRF) Hope someone help me De : libav-user-bounces at ffmpeg.org [mailto:libav-user-bounces at ffmpeg.org] De la part de Christophe Nelson Envoy? : vendredi 24 mai 2013 14:56 ? : This list is about using libavcodec, libavformat, libavutil, libavdevice and libavfilter. Objet : [Libav-user] X264 issue : Black Frame Hello I?ve got a problem to play files encoded with x264. I ?ve done this : ffmpeg.exe -i InputFile -c:v libx264 -preset slow -crf 20 -c:a copy OutputFile.avi When I read this file in VLC, GraphEdit, there?s no problem But when I read it in VirtualDub, MSU quality measurement, avitoyuv.exe I have 5 black frames at the beginning ! I?m pretty sure I use FFDshow in all this software (exepted in VLC). Could someone help me ? Do I need to install codecs ? Do I need to changed my ffmpeg command line ? Regards -------------- next part -------------- An HTML attachment was scrubbed... URL: From cehoyos at ag.or.at Wed May 29 15:59:31 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 29 May 2013 13:59:31 +0000 (UTC) Subject: [Libav-user] X264 issue : Black Frame References: <853FB49B5740B24B965337850CCA7E1538E875A4@AMSPRD0410MB375.eurprd04.prod.outlook.com> Message-ID: Christophe Nelson writes: > ffmpeg.exe -i InputFile -c:v libx264 -preset slow > -crf 20 -c:a copy OutputFile.avi Complete, uncut console output missing. For future questions: Please avoid highjacking threads. And please avoid top-posting here, Carl Eugen From ggarra13 at gmail.com Wed May 29 16:54:02 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Wed, 29 May 2013 11:54:02 -0300 Subject: [Libav-user] Missing a channel in Dolby 5:1 Message-ID: <51A6168A.6030702@gmail.com> I am using ffmpeg and libswresample to play back movie trailers. For stereo playback everything is good, but for Dolby 5.1, I get correct playback of all ambient noises but the audio track for voices is missing or too low of a sound, like a missing channel. My only weird implementation if that the audio tracks are split into frames before playback. I wonder if someone can suggest what it is I am doing wrong or missing. Here is some sample code: #if defined(_WIN32) || defined(_WIN64) mrv::AudioEngine::AudioFormat kIntSampleFormat = mrv::AudioEngine::kS16LSB; AVSampleFormat kInternalSampleFormat = AV_SAMPLE_FMT_S16; unsigned kFormatSize = (unsigned) sizeof(int16_t); #else mrv::AudioEngine::AudioFormat kIntSampleFormat = mrv::AudioEngine::kFloatLSB; AVSampleFormat kInternalSampleFormat = AV_SAMPLE_FMT_FLT; unsigned kFormatSize = (unsigned) sizeof(float); #endif ... int CMedia::decode_audio3(AVCodecContext *avctx, int16_t *samples, int *frame_size_ptr, AVPacket *avpkt) { AVFrame frame = { { 0 } }; int ret, got_frame = 0; ret = avcodec_decode_audio4(avctx, &frame, &got_frame, avpkt); if (ret >= 0 && got_frame) { int plane_size; int planar = av_sample_fmt_is_planar(avctx->sample_fmt); int data_size = av_samples_get_buffer_size(&plane_size, avctx->channels, frame.nb_samples, avctx->sample_fmt, 1); if (*frame_size_ptr < data_size) { IMG_ERROR( "decode_audio3 - Output buffer size is too small for " "the current frame (" << *frame_size_ptr << " < " << data_size << ")" ); return AVERROR(EINVAL); } if ( avctx->sample_fmt != kInternalSampleFormat ) { if (!forw_ctx) { char buf[256]; uint64_t in_ch_layout = get_valid_channel_layout(avctx->channel_layout, avctx->channels); if ( in_ch_layout == 0 ) in_ch_layout = AV_CH_LAYOUT_STEREO; av_get_channel_layout_string( buf, 256, avctx->channels, in_ch_layout ); IMG_INFO("Create audio conversion from " << buf << ", channels " << avctx->channels << ", " ); IMG_INFO( "format " << av_get_sample_fmt_name( avctx->sample_fmt ) << ", sample rate " << avctx->sample_rate << " to" ); uint64_t out_ch_layout = in_ch_layout; av_get_channel_layout_string( buf, 256, avctx->channels, out_ch_layout ); AVSampleFormat out_sample_fmt = kInternalSampleFormat; AVSampleFormat in_sample_fmt = avctx->sample_fmt; int in_sample_rate = avctx->sample_rate; int out_sample_rate = in_sample_rate; IMG_INFO( buf << ", channels " << avctx->channels << ", format " << av_get_sample_fmt_name( out_sample_fmt ) << ", sample rate " << out_sample_rate); forw_ctx = swr_alloc_set_opts(NULL, out_ch_layout, out_sample_fmt, out_sample_rate, in_ch_layout, in_sample_fmt, in_sample_rate, 0, NULL); if(!forw_ctx) { LOG_ERROR("Failed to alloc swresample library"); return 0; } if(swr_init(forw_ctx) < 0) { char buf[256]; av_get_channel_layout_string(buf, 256, -1, in_ch_layout); LOG_ERROR( "Failed to init swresample library with " << buf << " " << av_get_sample_fmt_name(in_sample_fmt) << " frequency: " << in_sample_rate ); return 0; } } swr_convert(forw_ctx, (uint8_t**)&samples, data_size / sizeof(int16_t), (const uint8_t **)frame.extended_data, frame.nb_samples ); // If S16, data is half the size after conversion if ( kInternalSampleFormat == AV_SAMPLE_FMT_S16 ) data_size /= 2; } else { memcpy(samples, frame.extended_data[0], data_size); if (planar && avctx->channels > 1) { uint8_t *out = ((uint8_t *)samples) + plane_size; for (int ch = 1; ch < avctx->channels; ch++) { memcpy(out, frame.extended_data[ch], plane_size); out += plane_size; } } } *frame_size_ptr = data_size; } else { *frame_size_ptr = 0; } return ret; } ... CMedia::DecodeStatus CMedia::decode_audio_packet( boost::int64_t& ptsframe, const boost::int64_t frame, const AVPacket& pkt ) { AVStream* stream = get_audio_stream(); if ( !stream ) return kDecodeNoStream; // Get the audio codec context AVCodecContext* ctx = stream->codec; assert( !_audio_packets.is_seek( pkt ) ); assert( !_audio_packets.is_flush( pkt ) ); assert( !_audio_packets.is_preroll( pkt ) ); assert( !_audio_packets.is_loop_end( pkt ) ); assert( !_audio_packets.is_loop_start( pkt ) ); ptsframe = get_frame( stream, pkt ); // Make sure audio frames are continous during playback to // accomodate weird sample rates not evenly divisable by frame rate if ( _audio_buf_used != 0 && (!_audio.empty()) ) { ptsframe = _audio_last_frame + 1; // assert( ptsframe <= last_frame() ); } #ifdef DEBUG if ( _audio_buf_used + pkt.size >= _audio_max ) { IMG_ERROR( _("Too much audio used:") << _audio_buf_used ); } #endif AVPacket pkt_temp; av_init_packet(&pkt_temp); pkt_temp.data = pkt.data; pkt_temp.size = pkt.size; assert( _audio_buf != NULL ); assert( pkt.size + _audio_buf_used < _audio_max ); int audio_size = AVCODEC_MAX_AUDIO_FRAME_SIZE; assert( pkt_temp.size <= audio_size ); while ( pkt_temp.size > 0 || pkt_temp.data == NULL ) { // Decode the audio into the buffer assert( _audio_buf_used + pkt_temp.size <= _audio_max ); assert( audio_size > 0 ); int ret = decode_audio3( ctx, ( int16_t * )( (char*)_audio_buf + _audio_buf_used ), &audio_size, &pkt_temp ); // If no samples are returned, then break now if ( ret <= 0 ) { pkt_temp.size = 0; IMG_ERROR( _("Audio missed for frame: ") << ptsframe << _(" ret: ") << ret << _(" audio max: ") << _audio_max << _(" audio used: ") << _audio_buf_used ); return kDecodeMissingSamples; } assert( audio_size > 0 ); assert( audio_size + _audio_buf_used <= _audio_max ); // Decrement the length by the number of bytes parsed pkt_temp.data += ret; pkt_temp.size -= ret; if ( audio_size <= 0 ) break; _audio_buf_used += audio_size; } if ( pkt_temp.size == 0 ) return kDecodeOK; return kDecodeMissingSamples; } bool CMedia::open_audio( const short channels, const unsigned nSamplesPerSec ) { close_audio(); _samples_per_sec = nSamplesPerSec; return _audio_engine->open( channels, nSamplesPerSec, kIntSampleFormat, kFormatSize*8); } I can show the implementation of _audio_engine and how I split the audio into frames if needed, too. From cehoyos at ag.or.at Wed May 29 17:57:34 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Wed, 29 May 2013 15:57:34 +0000 (UTC) Subject: [Libav-user] Missing a channel in Dolby 5:1 References: <51A6168A.6030702@gmail.com> Message-ID: Gonzalo Garramuno writes: > I am using ffmpeg and libswresample to play back > movie trailers. For stereo playback everything is > good, but for Dolby 5.1, I get correct playback of > all ambient noises but the audio track for voices > is missing or too low of a sound, like a missing > channel. I did not look at your code, but did you already test the following? $ ffmpeg -i input51 out.wav If out.wav shows your problem, please report how to reproduce the bug. Carl Eugen From ggarra13 at gmail.com Wed May 29 18:09:37 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Wed, 29 May 2013 13:09:37 -0300 Subject: [Libav-user] Missing a channel in Dolby 5:1 In-Reply-To: References: <51A6168A.6030702@gmail.com> Message-ID: <51A62841.2070000@gmail.com> On 29/05/13 12:57, Carl Eugen Hoyos wrote: > I did not look at your code, but did you already test the following? $ > ffmpeg -i input51 out.wav If out.wav shows your problem, please report > how to reproduce the bug. Carl Eugen Thanks, Carl. I already tested the problem with ffmpeg and ffplay. Both work fine. It is my code that is buggy. From ggarra13 at gmail.com Thu May 30 02:10:16 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Wed, 29 May 2013 21:10:16 -0300 Subject: [Libav-user] MSVC 2010 pre-built binaries In-Reply-To: <519B0651.6090809@gmail.com> References: <519AA483.8020207@gmail.com> <519B0651.6090809@gmail.com> Message-ID: <51A698E8.7060305@gmail.com> On 21/05/13 02:29, St?phane wrote: > Hi Gonzalo, > > I use the binaries from Zeranoe (64 bits dll) without problem. What I > just did, was to build my own lib files using "lib.exe" from MS SDK tools. > First, I modified the def files from Zeranoe by adding "LIBRARY ..." > statement at the begining of the file. > Then, I created the lib files. Command line for 64 bits libs should > look like this: > "C:\Program Files (x86)\Microsoft Visual Studio > 10.0\VC\bin\amd64\lib.exe" /MACHINE:x64 /DEF:avcodec-55.def > /OUT:avcodec.lib > > St?phane Thanks I found out my problem with the zeranoe build libraries was the lack of -OPT:NOREF switch in the linker. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vahid at kowsari.com Thu May 30 17:46:44 2013 From: vahid at kowsari.com (Vahid Kowsari) Date: Thu, 30 May 2013 08:46:44 -0700 Subject: [Libav-user] Receiving MPEGTS and fifo buffer overflows Message-ID: <51A77464.1010205@kowsari.com> Hi All, I am working on a piece of code at the moment to receive HD H264 MPEG TS streams at around 7.5 mbps from a udp multicast. This code is running inside of ubuntu VM remotely. I am having problems because no matter what I do I get fifo buffer overflows after a certain period of time. I have done the following: 1. Increased the the fifo_size, set overrun non fatal 2. Made my avcodec_decode_video2 and my processing of the frame in different threads and use a queue of frames between them. 3. I tried changing process priorities and set the renice value I actually dont need to process every frame of the video and it would be nice if there was a way to make ffmpeg api drop every x frames. Any thoughts would be greatly appreciated. Thanks __________________________________________________________ Vahid Kowsari vahid at kowsari.com From alexcohn at netvision.net.il Thu May 30 18:00:28 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Thu, 30 May 2013 19:00:28 +0300 Subject: [Libav-user] Receiving MPEGTS and fifo buffer overflows In-Reply-To: <51A77464.1010205@kowsari.com> References: <51A77464.1010205@kowsari.com> Message-ID: On 30 May 2013 18:47, "Vahid Kowsari" wrote: > > Hi All, > > I am working on a piece of code at the moment to receive HD H264 MPEG TS streams at around 7.5 mbps from a udp multicast. > This code is running inside of ubuntu VM remotely. > > I am having problems because no matter what I do I get fifo buffer overflows after a certain period of time. I have done the following: Does simple arithmetics suggest that your decoding is slower than input? Maybe, you should simply use a more powerful machine? > 1. Increased the the fifo_size, set overrun non fatal > 2. Made my avcodec_decode_video2 and my processing of the frame in different threads and use a queue of frames between them. This could help if processing can be dropped for some frames. > 3. I tried changing process priorities and set the renice value > > I actually dont need to process every frame of the video and it would be nice if there was a way to make ffmpeg api drop every x frames. The decoder cannot drop frames unless it can fast-forward to the next IDR frame. > Any thoughts would be greatly appreciated. > Thanks > __________________________________________________________ > Vahid Kowsari > vahid at kowsari.com > ____________________ BR, Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From kalileo at universalx.net Thu May 30 18:11:06 2013 From: kalileo at universalx.net (Kalileo) Date: Thu, 30 May 2013 23:11:06 +0700 Subject: [Libav-user] Receiving MPEGTS and fifo buffer overflows In-Reply-To: <51A77464.1010205@kowsari.com> References: <51A77464.1010205@kowsari.com> Message-ID: <476F469B-9E2D-436A-A628-D885D3466DF7@universalx.net> On May 30, 2013, at 22:46 , Vahid Kowsari wrote: > Hi All, > > I am working on a piece of code at the moment to receive HD H264 MPEG TS streams at around 7.5 mbps from a udp multicast. > This code is running inside of ubuntu VM remotely. > > I am having problems because no matter what I do I get fifo buffer overflows after a certain period of time. Assuming that this is not an issue with your device lacking the power to keep up with decoding, have you checked what might trigger the overflow? I see such overflows happening whenever there are some bigger errors in the input stream. > I have done the following: > 1. Increased the the fifo_size, set overrun non fatal " overrun non fatal" in my experience is fatal, better reset / restart at that point. From andy.y.huang at gmail.com Thu May 30 18:46:06 2013 From: andy.y.huang at gmail.com (Andy Huang) Date: Thu, 30 May 2013 11:46:06 -0500 Subject: [Libav-user] av_probe_input_buffer Message-ID: Hi, I am trying to create an app on android that can play MPEG stream. So I have following code: AVFormatContext* LibavDecoder::openInput () { AVFormatContext *avFormatContextPtr = NULL; int err = 0; this->iobuffer = (unsigned char*) av_malloc(bufferSize); avFormatContextPtr = avformat_alloc_context(); avFormatContextPtr->pb = avio_alloc_context(this->iobuffer, bufferSize, 0, receiver, IORead, NULL, NULL); avFormatContextPtr->pb->seekable = 0; err = avformat_open_input(&avFormatContextPtr, "", NULL, NULL); if (err != 0) { error("Error while calling avformat_open_input", err); } else { err = avformat_find_stream_info(avFormatContextPtr, 0); if (err < 0) error("Error while calling avformat_find_stream_info", err); } return avFormatContextPtr; } But for some reason, the call "avformat_open_input" doesn't return. So I put logging into the libavformat and found out that, in the "utils.c", function "av_probe_input_buffer" called by "init_input", which is called by "avformat_open_input", doesn't return. The same code works fine on iOS, but not on Android 2.3.3 and above. Any help will be greatly appreciated. -------------- next part -------------- An HTML attachment was scrubbed... URL: From vahid at kowsari.com Thu May 30 19:19:47 2013 From: vahid at kowsari.com (Vahid Kowsari) Date: Thu, 30 May 2013 10:19:47 -0700 Subject: [Libav-user] Receiving MPEGTS and fifo buffer overflows In-Reply-To: <476F469B-9E2D-436A-A628-D885D3466DF7@universalx.net> References: <51A77464.1010205@kowsari.com> <476F469B-9E2D-436A-A628-D885D3466DF7@universalx.net> Message-ID: <51A78A33.2020103@kowsari.com> Thank you for your quick responses. I do see this problem happen usually when i start getting errors. How can I avoid getting errors? I dont think the errors are from the input stream but my inability to process the stream. The machine is an 8 CPU AMD Opeteron running at 2.1Ghz. I think that should be fast enough. How do I programmatically handle the errors? Is there a callback I can set to be called when I start getting errors? Thanks Kalileo wrote: > On May 30, 2013, at 22:46 , Vahid Kowsari wrote: > >> Hi All, >> >> I am working on a piece of code at the moment to receive HD H264 MPEG TS streams at around 7.5 mbps from a udp multicast. >> This code is running inside of ubuntu VM remotely. >> >> I am having problems because no matter what I do I get fifo buffer overflows after a certain period of time. > > Assuming that this is not an issue with your device lacking the power to keep up with decoding, have you checked what might trigger the overflow? > > I see such overflows happening whenever there are some bigger errors in the input stream. > >> I have done the following: >> 1. Increased the the fifo_size, set overrun non fatal > > " overrun non fatal" in my experience is fatal, better reset / restart at that point. > > _______________________________________________ > Libav-user mailing list > Libav-user at ffmpeg.org > http://ffmpeg.org/mailman/listinfo/libav-user -- __________________________________________________________ Vahid Kowsari vahid at kowsari.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From prathap.malempati at gmail.com Thu May 30 06:53:34 2013 From: prathap.malempati at gmail.com (prathap) Date: Wed, 29 May 2013 21:53:34 -0700 (PDT) Subject: [Libav-user] Error when creating .so file using .c program and ffmpeg using android NDK Message-ID: <1369889614119-4657764.post@n4.nabble.com> Hi everybody when i am trying to create .so file using .c file and ffmpeg and android NDK i got this errors Install : libmylib.so => libs/armeabi-v7a/libmylib.so Install : libmylib.so => libs/armeabi/libmylib.so Compile x86 : mylib <= mylib.c cc1: error: unrecognized command line option '-mfloat-abi=softfp' cc1: error: unrecognized command line option '-mfpu=neon' jni/mylib.c:1:0: error: bad value (armv7-a) for -march= switch make: *** [obj/local/x86/objs/mylib/mylib.o] Error 1 ---------------------------------------------------------------------------------------------------------------------- My android.mk file is LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_LDLIBS = -L$(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm/usr/lib -L$(LOCAL_PATH)/../obj/local/armeabi/ -lavformat -lavcodec -lpostproc -lswscale -lavutil -llog -ljnigraphics -lz -ldl -lgcc LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg LOCAL_SRC_FILES := mylib.c LOCAL_CFLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=neon LOCAL_MODULE := mylib #LOCAL_SRC_FILES := mylib.c include $(BUILD_SHARED_LIBRARY) LOCAL_PATH := $(call my-dir) LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg include $(all-subdir-makefiles) ----------------------------------------------------------------------------------------------------------------------- My .c program is like this #include #include #include #include #include #include #include #include #define LOG_TAG "mylib" #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, __VA_ARGS__) #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, __VA_ARGS__) JNIEXPORT jint JNICALL Java_com_myffmpegtest_MainActivity_logFileInfo (JNIEnv *env, jclass this, jstring filename) { av_register_all(); AVFormatContext *pFormatCtx; const jbyte *str; str = (*env)->GetStringUTFChars(env, filename, NULL); if(avformat_open_input(&pFormatCtx, str, NULL, NULL)!=0) { LOGE("Can't open file '%s'\n", str); return 1; } else { LOGI("File was opened\n"); LOGI("File '%s', Codec %s", pFormatCtx->filename, pFormatCtx->iformat->name ); } return 0; } ------------------------------------------------------------------------------------------------------------------- Thanks for you suggestions Regards Prathap.M -- View this message in context: http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764.html Sent from the libav-users mailing list archive at Nabble.com. From andrey.krieger.utkin at gmail.com Thu May 30 21:07:35 2013 From: andrey.krieger.utkin at gmail.com (Andrey Utkin) Date: Thu, 30 May 2013 22:07:35 +0300 Subject: [Libav-user] Receiving MPEGTS and fifo buffer overflows In-Reply-To: <51A77464.1010205@kowsari.com> References: <51A77464.1010205@kowsari.com> Message-ID: 2013/5/30 Vahid Kowsari : > 1. Increased the the fifo_size, set overrun non fatal > 2. Made my avcodec_decode_video2 and my processing of the frame in different > threads and use a queue of frames between them. Doing 1 and 2, you are near to the right way. Make separate thread for av_read_frame(), and another for decoding and processing. Decoding (key)frame may take significant time, and at this moment connection buffer gets overflowed. If you do av_read_frame() all the time without waiting for anything else (and working on anything else) you don't get such error. Even simpler, you may proceed increasing fifo_size, and it should make problem go away. Setting its size to something like stream bitrate (in bytes per second) * 1 second should do that. Note that -fifo_size option takes value in units of 188 bytes. One more point: when you get such error of losing MPEGTS data, but having overrun_nonfatal set to 1, you get decoding errors, but consequence is just quality degradation, and possibly lost frames. Correctly working application can live with it without need to restart etc. -- Andrey Utkin From cehoyos at ag.or.at Thu May 30 21:48:10 2013 From: cehoyos at ag.or.at (Carl Eugen Hoyos) Date: Thu, 30 May 2013 19:48:10 +0000 (UTC) Subject: [Libav-user] Error when creating .so file using .c program and ffmpeg using android NDK References: <1369889614119-4657764.post@n4.nabble.com> Message-ID: prathap writes: > My android.mk file is The only thing needed (and the only thing supported here) is your configure line. Carl Eugen From alexcohn at netvision.net.il Fri May 31 07:45:10 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Fri, 31 May 2013 08:45:10 +0300 Subject: [Libav-user] Error when creating .so file using .c program and ffmpeg using android NDK In-Reply-To: <1369889614119-4657764.post@n4.nabble.com> References: <1369889614119-4657764.post@n4.nabble.com> Message-ID: On May 30, 2013 9:36 PM, "prathap" wrote: > > Hi everybody > > when i am trying to create .so file using .c file and ffmpeg and android NDK > i got this errors > > > Install : libmylib.so => libs/armeabi-v7a/libmylib.so > Install : libmylib.so => libs/armeabi/libmylib.so > Compile x86 : mylib <= mylib.c > cc1: error: unrecognized command line option '-mfloat-abi=softfp' > cc1: error: unrecognized command line option '-mfpu=neon' > jni/mylib.c:1:0: error: bad value (armv7-a) for -march= switch > make: *** [obj/local/x86/objs/mylib/mylib.o] Error 1 > > ---------------------------------------------------------------------------------------------------------------------- > > > My android.mk file is > > LOCAL_PATH := $(call my-dir) > > include $(CLEAR_VARS) > > LOCAL_LDLIBS = -L$(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm/usr/lib > -L$(LOCAL_PATH)/../obj/local/armeabi/ -lavformat -lavcodec -lpostproc > -lswscale -lavutil -llog -ljnigraphics -lz -ldl -lgcc > LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg > LOCAL_SRC_FILES := mylib.c > LOCAL_CFLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=neon > LOCAL_MODULE := mylib > #LOCAL_SRC_FILES := mylib.c > > include $(BUILD_SHARED_LIBRARY) > > LOCAL_PATH := $(call my-dir) > LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg > include $(all-subdir-makefiles) > > ----------------------------------------------------------------------------------------------------------------------- > > > My .c program is like this > > > #include > #include > #include > > #include > #include > #include > #include > #include > > #define LOG_TAG "mylib" > #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, > __VA_ARGS__) > #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, > __VA_ARGS__) > > JNIEXPORT jint JNICALL Java_com_myffmpegtest_MainActivity_logFileInfo > (JNIEnv *env, jclass this, jstring filename) > { > av_register_all(); > > AVFormatContext *pFormatCtx; > const jbyte *str; > str = (*env)->GetStringUTFChars(env, filename, NULL); > > if(avformat_open_input(&pFormatCtx, str, NULL, NULL)!=0) > { > LOGE("Can't open file '%s'\n", str); > return 1; > } > else > { > LOGI("File was opened\n"); > LOGI("File '%s', Codec %s", > pFormatCtx->filename, > pFormatCtx->iformat->name > ); > } > return 0; > } > > ------------------------------------------------------------------------------------------------------------------- > > > Thanks for you suggestions > > Regards > Prathap.M You set compiler options for ARM processor. In your ndk-build command, add APP_ABI=armeabi-v7a. If you really need x86 version, specify the relevant compilation options separately. BR, Alex Cohn -------------- next part -------------- An HTML attachment was scrubbed... URL: From prathap.malempati at gmail.com Fri May 31 05:30:36 2013 From: prathap.malempati at gmail.com (prathap) Date: Thu, 30 May 2013 20:30:36 -0700 (PDT) Subject: [Libav-user] Error when creating .so file using .c program and ffmpeg using android NDK In-Reply-To: References: <1369889614119-4657764.post@n4.nabble.com> Message-ID: <1369971036114-4657772.post@n4.nabble.com> Sorry i am new to this android ndk and ffmpeg, Can u guide me clearly , Thank you, Regards Prathap.M -- View this message in context: http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764p4657772.html Sent from the libav-users mailing list archive at Nabble.com. From prathap.malempati at gmail.com Fri May 31 08:13:09 2013 From: prathap.malempati at gmail.com (prathap) Date: Thu, 30 May 2013 23:13:09 -0700 (PDT) Subject: [Libav-user] Error when creating .so file using .c program and ffmpeg using android NDK In-Reply-To: References: <1369889614119-4657764.post@n4.nabble.com> Message-ID: Ok, thhank you.......... On Fri, May 31, 2013 at 11:15 AM, Alex Cohn [via libav-users] < ml-node+s943685n4657774h40 at n4.nabble.com> wrote: > On May 30, 2013 9:36 PM, "prathap" <[hidden email]> > wrote: > > > > Hi everybody > > > > when i am trying to create .so file using .c file and ffmpeg and android > NDK > > i got this errors > > > > > > Install : libmylib.so => libs/armeabi-v7a/libmylib.so > > Install : libmylib.so => libs/armeabi/libmylib.so > > Compile x86 : mylib <= mylib.c > > cc1: error: unrecognized command line option '-mfloat-abi=softfp' > > cc1: error: unrecognized command line option '-mfpu=neon' > > jni/mylib.c:1:0: error: bad value (armv7-a) for -march= switch > > make: *** [obj/local/x86/objs/mylib/mylib.o] Error 1 > > > > > ---------------------------------------------------------------------------------------------------------------------- > > > > > > My android.mk file is > > > > LOCAL_PATH := $(call my-dir) > > > > include $(CLEAR_VARS) > > > > LOCAL_LDLIBS = > -L$(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm/usr/lib > > -L$(LOCAL_PATH)/../obj/local/armeabi/ -lavformat -lavcodec -lpostproc > > -lswscale -lavutil -llog -ljnigraphics -lz -ldl -lgcc > > LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg > > LOCAL_SRC_FILES := mylib.c > > LOCAL_CFLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=neon > > LOCAL_MODULE := mylib > > #LOCAL_SRC_FILES := mylib.c > > > > include $(BUILD_SHARED_LIBRARY) > > > > LOCAL_PATH := $(call my-dir) > > LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg > > include $(all-subdir-makefiles) > > > > > ----------------------------------------------------------------------------------------------------------------------- > > > > > > My .c program is like this > > > > > > #include > > #include > > #include > > > > #include > > #include > > #include > > #include > > #include > > > > #define LOG_TAG "mylib" > > #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, > > __VA_ARGS__) > > #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, > > __VA_ARGS__) > > > > JNIEXPORT jint JNICALL Java_com_myffmpegtest_MainActivity_logFileInfo > > (JNIEnv *env, jclass this, jstring filename) > > { > > av_register_all(); > > > > AVFormatContext *pFormatCtx; > > const jbyte *str; > > str = (*env)->GetStringUTFChars(env, filename, NULL); > > > > if(avformat_open_input(&pFormatCtx, str, NULL, NULL)!=0) > > { > > LOGE("Can't open file '%s'\n", str); > > return 1; > > } > > else > > { > > LOGI("File was opened\n"); > > LOGI("File '%s', Codec %s", > > pFormatCtx->filename, > > pFormatCtx->iformat->name > > ); > > } > > return 0; > > } > > > > > ------------------------------------------------------------------------------------------------------------------- > > > > > > Thanks for you suggestions > > > > Regards > > Prathap.M > > You set compiler options for ARM processor. In your ndk-build command, add > APP_ABI=armeabi-v7a. If you really need x86 version, specify the relevant > compilation options separately. > > BR, > Alex Cohn > > _______________________________________________ > Libav-user mailing list > [hidden email] > http://ffmpeg.org/mailman/listinfo/libav-user > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764p4657774.html > To unsubscribe from Error when creating .so file using .c program and > ffmpeg using android NDK, click here > . > NAML > -- View this message in context: http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764p4657775.html Sent from the libav-users mailing list archive at Nabble.com. From prathap.malempati at gmail.com Fri May 31 08:39:09 2013 From: prathap.malempati at gmail.com (prathap) Date: Thu, 30 May 2013 23:39:09 -0700 (PDT) Subject: [Libav-user] Error when creating .so file using .c program and ffmpeg using android NDK In-Reply-To: References: <1369889614119-4657764.post@n4.nabble.com> Message-ID: Thanks for your previous solution , and now i have two Android.mk files in my project 1 .../(my_project_root)/jni/Android.mk 2 .../ (my_project_root)/jni/ffmpeg/android/arm/Android.mk and my first android.mk code is: ----------------------------------------------------------------------------- LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := framegrabber LOCAL_SRC_FILES := framegrabber.c LOCAL_LDLIBS := -llog -lz LOCAL_STATIC_LIBRARIES := libavformat_static libavcodec_static libavutil_static include $(BUILD_SHARED_LIBRARY) $(call import-module,ffmpeg/android/arm) ------------------------------------------------------------------------------- and my second android.mk code is: ----------------------------------------------------------------------------- LOCAL_PATH:= $(call my-dir) #static version of libavcodec include $(CLEAR_VARS) LOCAL_MODULE:= libavcodec_static LOCAL_SRC_FILES:= lib/libavcodec.a LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include include $(PREBUILT_STATIC_LIBRARY) #static version of libavformat include $(CLEAR_VARS) LOCAL_MODULE:= libavformat_static LOCAL_SRC_FILES:= lib/libavformat.a LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include include $(PREBUILT_STATIC_LIBRARY) #static version of libswscale include $(CLEAR_VARS) LOCAL_MODULE:= libswscale_static LOCAL_SRC_FILES:= lib/libswscale.a LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include include $(PREBUILT_STATIC_LIBRARY) #static version of libavutil include $(CLEAR_VARS) LOCAL_MODULE:= libavutil_static LOCAL_SRC_FILES:= lib/libavutil.a LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/include include $(PREBUILT_STATIC_LIBRARY) ---------------------------------------------------------------------------------------------------------- when i am trying to run ndk-build it shows Error like this: -------------------------------------------------------------------------------------------------- Android NDK: /home/ubuntu/workspace/MyFfmpegTest/jni/Android.mk: Cannot find module with tag 'ffmpeg/android/arm' in import path Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined ? Android NDK: The following directories were searched: Android NDK: /home/ubuntu/workspace/MyFfmpegTest/jni/Android.mk:8: *** Android NDK: Aborting. . Stop. ------------------------------------------------------------------------------------------------------ Could you please tell me where the mistake is? Thank you Regards Prathap.M On Fri, May 31, 2013 at 11:43 AM, Prathap Malempati < prathap.malempati at gmail.com> wrote: > Ok, thhank you.......... > > > On Fri, May 31, 2013 at 11:15 AM, Alex Cohn [via libav-users] < > ml-node+s943685n4657774h40 at n4.nabble.com> wrote: > >> On May 30, 2013 9:36 PM, "prathap" <[hidden email]> >> wrote: >> > >> > Hi everybody >> > >> > when i am trying to create .so file using .c file and ffmpeg and >> android NDK >> > i got this errors >> > >> > >> > Install : libmylib.so => libs/armeabi-v7a/libmylib.so >> > Install : libmylib.so => libs/armeabi/libmylib.so >> > Compile x86 : mylib <= mylib.c >> > cc1: error: unrecognized command line option '-mfloat-abi=softfp' >> > cc1: error: unrecognized command line option '-mfpu=neon' >> > jni/mylib.c:1:0: error: bad value (armv7-a) for -march= switch >> > make: *** [obj/local/x86/objs/mylib/mylib.o] Error 1 >> > >> > >> ---------------------------------------------------------------------------------------------------------------------- >> > >> > >> > My android.mk file is >> > >> > LOCAL_PATH := $(call my-dir) >> > >> > include $(CLEAR_VARS) >> > >> > LOCAL_LDLIBS = >> -L$(NDK_PLATFORMS_ROOT)/$(TARGET_PLATFORM)/arch-arm/usr/lib >> > -L$(LOCAL_PATH)/../obj/local/armeabi/ -lavformat -lavcodec -lpostproc >> > -lswscale -lavutil -llog -ljnigraphics -lz -ldl -lgcc >> > LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg >> > LOCAL_SRC_FILES := mylib.c >> > LOCAL_CFLAGS := -march=armv7-a -mfloat-abi=softfp -mfpu=neon >> > LOCAL_MODULE := mylib >> > #LOCAL_SRC_FILES := mylib.c >> > >> > include $(BUILD_SHARED_LIBRARY) >> > >> > LOCAL_PATH := $(call my-dir) >> > LOCAL_C_INCLUDES += $(LOCAL_PATH)/ffmpeg >> > include $(all-subdir-makefiles) >> > >> > >> ----------------------------------------------------------------------------------------------------------------------- >> > >> > >> > My .c program is like this >> > >> > >> > #include >> > #include >> > #include >> > >> > #include >> > #include >> > #include >> > #include >> > #include >> > >> > #define LOG_TAG "mylib" >> > #define LOGI(...) __android_log_print(ANDROID_LOG_INFO, LOG_TAG, >> > __VA_ARGS__) >> > #define LOGE(...) __android_log_print(ANDROID_LOG_ERROR, LOG_TAG, >> > __VA_ARGS__) >> > >> > JNIEXPORT jint JNICALL Java_com_myffmpegtest_MainActivity_logFileInfo >> > (JNIEnv *env, jclass this, jstring filename) >> > { >> > av_register_all(); >> > >> > AVFormatContext *pFormatCtx; >> > const jbyte *str; >> > str = (*env)->GetStringUTFChars(env, filename, NULL); >> > >> > if(avformat_open_input(&pFormatCtx, str, NULL, NULL)!=0) >> > { >> > LOGE("Can't open file '%s'\n", str); >> > return 1; >> > } >> > else >> > { >> > LOGI("File was opened\n"); >> > LOGI("File '%s', Codec %s", >> > pFormatCtx->filename, >> > pFormatCtx->iformat->name >> > ); >> > } >> > return 0; >> > } >> > >> > >> ------------------------------------------------------------------------------------------------------------------- >> > >> > >> > Thanks for you suggestions >> > >> > Regards >> > Prathap.M >> >> You set compiler options for ARM processor. In your ndk-build command, >> add APP_ABI=armeabi-v7a. If you really need x86 version, specify the >> relevant compilation options separately. >> >> BR, >> Alex Cohn >> >> _______________________________________________ >> Libav-user mailing list >> [hidden email] >> http://ffmpeg.org/mailman/listinfo/libav-user >> >> >> ------------------------------ >> If you reply to this email, your message will be added to the >> discussion below: >> >> http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764p4657774.html >> To unsubscribe from Error when creating .so file using .c program and >> ffmpeg using android NDK, click here >> . >> NAML >> > > -- View this message in context: http://libav-users.943685.n4.nabble.com/Error-when-creating-so-file-using-c-program-and-ffmpeg-using-android-NDK-tp4657764p4657776.html Sent from the libav-users mailing list archive at Nabble.com. From alexcohn at netvision.net.il Fri May 31 22:55:59 2013 From: alexcohn at netvision.net.il (Alex Cohn) Date: Fri, 31 May 2013 23:55:59 +0300 Subject: [Libav-user] Error when creating .so file using .c program and ffmpeg using android NDK In-Reply-To: References: <1369889614119-4657764.post@n4.nabble.com> Message-ID: On Fri, May 31, 2013 at 9:39 AM, prathap wrote: > Thanks for your previous solution , and now i have two Android.mk files > in my project > > 1 .../(my_project_root)/jni/Android.mk > > 2 .../ (my_project_root)/jni/ffmpeg/android/arm/Android.mk > > > and my first android.mk code is: > > ----------------------------------------------------------------------------- > LOCAL_PATH := $(call my-dir) > include $(CLEAR_VARS) > LOCAL_MODULE := framegrabber > LOCAL_SRC_FILES := framegrabber.c > LOCAL_LDLIBS := -llog -lz > LOCAL_STATIC_LIBRARIES := libavformat_static libavcodec_static > libavutil_static > include $(BUILD_SHARED_LIBRARY) > $(call import-module,ffmpeg/android/arm) ... > when i am trying to run ndk-build it shows Error like this: > > -------------------------------------------------------------------------------------------------- > Android NDK: /home/ubuntu/workspace/MyFfmpegTest/jni/Android.mk: Cannot find module with tag 'ffmpeg/android/arm' in import path > Android NDK: Are you sure your NDK_MODULE_PATH variable is properly defined? > Android NDK: The following directories were searched: > Android NDK: home/ubuntu/workspace/MyFfmpegTest/jni/Android.mk:8: *** Android NDK: Aborting. . Stop. > ------------------------------------------------------------------------------------------------------ > > Could you please tell me where the mistake is? > > Thank you > > Regards > Prathap.M Try $(call import-module,$(LOCAL_PATH)/ffmpeg/android/arm) I am afraid we have stirred too far from the topic of the libav-user mail list. You would be better served if you ask the questions about Android NDK in relevant user groups, or at stack-overflow. Regards, Alex Cohn From ggarra13 at gmail.com Fri May 31 23:40:47 2013 From: ggarra13 at gmail.com (Gonzalo Garramuno) Date: Fri, 31 May 2013 18:40:47 -0300 Subject: [Libav-user] Missing a channel in Dolby 5:1 In-Reply-To: References: <51A6168A.6030702@gmail.com> Message-ID: <51A918DF.3070508@gmail.com> On 29/05/13 12:57, Carl Eugen Hoyos wrote: > I did not look at your code, but did you already test the following? $ > ffmpeg -i input51 out.wav If out.wav shows your problem, please report > how to reproduce the bug. I digged into what's happening. LibSDLaudio does some swizzling of channels to bring the surround sound into place. As I am not using libSDL, this swizzling was missing. Once I added it, all worked like a charm.