1

Topic: Format of audio of a packet with DirectShow the filter

I can not define, in what format to me packets after capture - planar or not-planrnyj arrive audio. Video a source forms video with a sound with frequency of sampling 44100, a sample of 16 byte, length of the frame of 176400 byte per second, a stereo. To video to a source I connect regular Sample Grabber, from it audio packets in the size on 88200 byte which to me should be betrayed on  264 every half-second arrive. I need to define correctly their format - AV_SAMPLE_FMT_S16 or AV_SAMPLE_FMT_S16P. On idea should be AV_SAMPLE_FMT_S16P with decoder AV_CODEC_ID_PCM_S16BE_PLANAR, time goes to two . But with this format does not want to work. I can launch only  AV_SAMPLE_FMT_S16 with decoder AV_CODEC_ID_PCM_S16LE and that in with an output on , is shorter through a bum. Of adjustment  it is not assured, I collected it about 5 years ago, from now on  completely changed, so it was necessary to collect it anew. Therefore I want to define accurately a format of audio of the frame with DS the filter

2

Re: Format of audio of a packet with DirectShow the filter

Hello, Vicul, you wrote: V> I can not define, in what format to me packets after capture - planar or not-planrnyj arrive audio. V> Video the source forms video with a sound with frequency of sampling 44100, a sample of 16 byte, length of the frame of 176400 byte per second, a stereo. Most likely you mean 16-bit. What for frames in  a sound? V> to video to a source I connect regular Sample Grabber, from it audio packets in the size on 88200 byte every half-second arrive, All is true: 44100 * (2 bytes) * (2 channels) / (2 - a floor of second) = V> which to me should be betrayed 88200 byte on  264. I need to define correctly their format - AV_SAMPLE_FMT_S16 or AV_SAMPLE_FMT_S16P. H264 is video . What audio the compressor you use? V> on idea should be AV_SAMPLE_FMT_S16P with decoder AV_CODEC_ID_PCM_S16BE_PLANAR, time goes to two . But with this format does not want to work. I can launch only  AV_SAMPLE_FMT_S16 with decoder AV_CODEC_ID_PCM_S16LE and that in with an output on , is shorter through a bum. V> of adjustment  it is not assured, I collected it about 5 years ago, from now on  completely changed, so it was necessary to collect it anew. Therefore I want to define accurately a format of audio of the frame with DS the filter If to resort to terminology usage ffmpeg you certainly receive AV_SAMPLE_FMT_S16LE (not planar). Windows is not able at all and does not support planar audio-formats. Still it is important to remember that many audio-compressors ffmpeg want FLOAT32P or S32P and, to begin with, it is necessary to do conversion to one of them. Yes, yet do not forget to specify an amount of channels (channels) and a mask of channels (channel_layout). channel_layout, strangely enough, in Windows also it is supported, but only with WAVEFORMATEXTENSIBLE.

3

Re: Format of audio of a packet with DirectShow the filter

V> Most likely you mean 16-bit. What for frames in  a sound? Yes 16 bits. Yes normal frames, -, from a microphone. All see a picture V> truly: 44100 * (2 bytes) * (2 channels) / (2 - a floor of second) = 88200 byte Arrives the half-frame, and remaining second for the second the floor V> H264 is video . What audio the compressor you use? , . Here these I use - libmp3lame or aac. V> If to resort to terminology usage ffmpeg you certainly receive AV_SAMPLE_FMT_S16LE (not planar). Windows is not able at all and does not support planar audio-formats. Means, for a second I receive 176400 byte of the nonplanar frame V> Still important to remember that many audio-compressors ffmpeg want FLOAT32P or S32P and, to begin with, it is necessary to do conversion to one of them. There is a such. But because of  that I on an input adjusted them under the planar frame, they plainly and did not work V> Yes, yet do not forget to specify an amount of channels (channels) and a mask of channels (channel_layout). channel_layout, strangely enough, in Windows also it is supported, but only with WAVEFORMATEXTENSIBLE. On this rake I already came. Thanks for , tomorrow since morning I will try

4

Re: Format of audio of a packet with DirectShow the filter

Hello, Vicul, you wrote: V> yes 16 bits. Yes normal frames, -, from a microphone. See a picture Yes, all right, passed. I simply always thought that it  (the maximum quantity of samples) which this or that audio-codec encodes frames in one unit. V> , . Here these I use - libmp3lame or aac. MP3Lame accepts, on mine, S32P. AAC now accepts FLOAT32P. V> there is a such. But because of  that I on an input adjusted them under the planar frame, they plainly and did not work Look, how you adjust an input ffmpeg encoder, depends in what format it is necessary to give given to it on an input. If AAC supports only FLOAT32P it is necessary to convert the audio of the buffer from S16LE in FLOAT32P, it does not accept other format. For converting use AudioResampler (SwrContext). Also, it is necessary remember that buffers should to be strictly certain size in  (look a field frame_size). You should "cut" the audio of the buffer. The general algorithm such: - we Create necessary  - It is opened  and interrogates all its input formats and a field frame_size (on how many samples need to be cut) - one of offered formats Is sampled and installed in the field sample_fmt - we Look, if our input format differs, creates  from our format in input  - Is cut the buffers on the size of the frame then it is convertible  and we submit on an input  - On an output is received coded frames

5

Re: Format of audio of a packet with DirectShow the filter

Thanks, and I will do V> For converting use AudioResampler (SwrContext). And it is possible the link?

6

Re: Format of audio of a packet with DirectShow the filter

Hello, Vicul, you wrote: V> And it is possible the link? It is not assured that understood correctly. Here there is a description more low how to use.

7

Re: Format of audio of a packet with DirectShow the filter

Hello, Videoman, you wrote: V> it is not assured that understood correctly. Here there is a description more low how to use. Thanks that is necessary!