Ok added the code from filtering_audio.c to create a filterchain, changed my 
code to take the decoded frames and push into the filter.
filt_frame is returned and this is pushed into the avcodec_encode_audio2 and 
guess what error i get

[mp2 @ xxxxxxxxxxx] nb_samples (1024) != frame_size (1152) 
(avencode_encoder_audio2)
So question one, How do i fix this
Question Two
In this example code a filter string is passed 
"aresample=32000,aformat=sample_fmts=s16,channel_layout=stereo", to init_filter 
and parsed by a call to avfilter_graph_parse_ptr 

but also in the code these values are set 

static const enum AVSampleFormat out_sample_fmts[] = { AV_SAMPLE_FMT_S16, 
-1);static const int64_t out_channel_layouts[] = { AV_CH_LAYOUT_STEREO, -1 
};static const int out_sample_rates[] = { 32000, -1 };etc
Is this duplication needed?
joolz


    On Thursday, 28 April 2016, 15:11, Andrey Utkin <[email protected]> 
wrote:
 
 

 On Thu, Apr 28, 2016 at 01:00:37PM +0000, JULIAN GARDNER wrote:
> So my question is do I have to split the input to be the correct size or am i 
> missing something in the audio encoding setup to allow it to do the buffering 
> correctly?

Apparently yes.
I believe libavfilter API can do both parts (resampling and splitting)
for you, filtering is easier to setup than handling of every aspect of
conversion manually.


 
   
_______________________________________________
Libav-user mailing list
[email protected]
http://ffmpeg.org/mailman/listinfo/libav-user

Reply via email to