On 08/07/2008, at 12:01 AM, emanuele fumagalli wrote: >> That's not a good way to detect scene changes, think for example of a >> stream with uncompressed video frames, also I-frames aren't >> necessarily used in correspondence of a scene change. > > Thanks for answering. > Yes, I agree, is there a way to extract motion vectors or something > else > to analyze in order to detect abrupt changes and so a probable scene > change?
For a test the simplest way to do this is do a diff between the two frames, vastly different scenes will show up as large values. (Although fast motion scenes may also display large values. Then you could do a short term average over, long term average.) As for listening out for silence, most scene changes fade to the audio of the next scene before the vision. Remember the scene from the matrix where you can hear his alarm clock in the night club, just before the scene of him waking in bed. You might be better off looking for black fades or still motion. I've been investigating these sort of tools using the mjpegutils library (using uncompressed yuv video) more so for advertisement detection. For what purpose are you looking for scene changes? > st want to detect when the audio fades out and then fades in, this > could help me to find other scene changes. > > When using: > avcodec_decode_audio2(audioCodec, (int16_t*)g_AudioBuffer, &data_size, > pkt.data, pkt.size) > > I got a sample buffer and the data_size is 8192. > > Is there a way to understand the "strenght" of this audio buffer, I > would say the amplitude of the signal. The simplest (but maybe not the most correct) is to sum the absolute value of all the samples. Although this doesn't take DC offset into consideration, but one would *hope* that the audio has been normalised. > > > Thanks for any tips on that If you are interested in discussing this sort of DSP analysis, mail me off list, I feel that this sort of discussion is beyond the scope of libav, as it certainly can apply to other audio and video libraries. Mark _______________________________________________ libav-user mailing list [email protected] https://lists.mplayerhq.hu/mailman/listinfo/libav-user
