Re: [FFmpeg-user] MP4 -> ADTS Headers

2019-10-03 Thread samuel . widmer
Sehr geehrte Damen und Herren

Besten Dank für Ihr Mail. Ich bin vom 3. Oktober bis 9. Oktober 2019 abwesend.

Die Mails werden in dieser Zeit nur sporadisch beantwortet.

In dringenden Fällen nehmen Sie bitte mit supp...@bluecall.ch Kontakt auf.


Herzlichen Dank für Ihr Verständnis und eine gute Zeit

Samuel Widmer



___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] MP4 -> ADTS Headers

2019-10-03 Thread Ronak Patel via ffmpeg-user


> On Oct 3, 2019, at 5:27 PM, Carl Eugen Hoyos  wrote:
> 
> Am Do., 3. Okt. 2019 um 06:49 Uhr schrieb Ronak via ffmpeg-user
> :
>> I’m writing a C++ program to validate the integrity of a Fragmented MP4 file 
>> containing AAC audio.
> 
> Note that when using the library, the libav-user mailing list is more 
> suitable:
> https://ffmpeg.org/contact.html#MailingLists

Ok I also emailed there. Do you have any ideas what to do here? From what I 
read in your code; the extra data seems like should have a fully formed adts 
header supplied.

If that’s true then why does the muxer even exist? I’m wondering if I’m missing 
some options on the input format context.

> 
> Carl Eugen
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] MP4 -> ADTS Headers

2019-10-03 Thread Ronak via ffmpeg-user

> On Oct 3, 2019, at 12:48 AM, Ronak via ffmpeg-user  
> wrote:
> 
> Hi,
> 
> I’m writing a C++ program to validate the integrity of a Fragmented MP4 file 
> containing AAC audio.
> This program would parse the FMP4 file, read each audio packet, attachment 
> ADTS headers, and then try to decode the AAC using libfdk_aac.
> 
> I am using libavformat, and I am able to parse the MP4 atoms correctly, 
> however I’m having issues figuring out the best way to attach the ADTS 
> headers.
> 
> The best sample I was able to find was:
> 
> https://patchwork.ffmpeg.org/patch/3184/ 
> 
> 
> Is there a better example for me to use?
> 


Hi,

So I managed to figure out how to do this, and I’m up to the part of figuring 
out what I need to write in the extradata field of the AVCodecParameters here:

// create another context used to append ADTS headers to the parsed segments, 
if we need them
bool isBufferWritable = true;
avformat_alloc_output_context2(>adtsMuxerContext, NULL, "adts", NULL);
this->adtsMuxerWriterContext = avio_alloc_context(this->adtsPacketBuffer, 
this->adtsPacketBufferSize, isBufferWritable, this, NULL, 
AudioAssetReader::writeADTSPacket, NULL);
this->adtsMuxerContext->pb = this->adtsMuxerWriterContext;

// initialize an ADTS stream
AVCodecID aacCodec = AVCodecID::AV_CODEC_ID_AAC;
AVCodec *codec = avcodec_find_encoder(aacCodec);
AVStream *stream = avformat_new_stream(this->adtsMuxerContext, codec);
stream->id = this->adtsMuxerContext->nb_streams - 1;
stream->time_base.den = input.getSampleRateHz();
stream->time_base.num = 1;

// configure the stream with the details of the AAC packets
AVCodecParameters *codecParameters = stream->codecpar;
codecParameters->codec_id = aacCodec;
codecParameters->bit_rate = input.getBitrateBps();
codecParameters->profile = this->getAACProfileForCodec(input.getCodec());
codecParameters->sample_rate = input.getSampleRateHz();
codecParameters->channels = input.getChannelCount();
codecParameters->codec_type = AVMEDIA_TYPE_AUDIO;
codecParameters->channel_layout = 
av_get_default_channel_layout(input.getChannelCount());
codecParameters->extradata = new uint8_t[AV_INPUT_BUFFER_PADDING_SIZE + 2];
codecParameters->extradata_size = 2;
memset(codecParameters->extradata, 2, AV_INPUT_BUFFER_PADDING_SIZE + 2);

But this is still not working with errors about: [adts @ 0x7f87c4803a00] MPEG-4 
AOT 0 is not allowed in ADTS


Reading the code in FFmpeg, it looks like I need to send in a full fledged ADTS 
header into extradata is that correct?

> Ronak
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
> 
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

Re: [FFmpeg-user] MP4 -> ADTS Headers

2019-10-02 Thread samuel . widmer
Sehr geehrte Damen und Herren

Besten Dank für Ihr Mail. Ich bin vom 3. Oktober bis 9. Oktober 2019 abwesend.

Die Mails werden in dieser Zeit nur sporadisch beantwortet.

In dringenden Fällen nehmen Sie bitte mit supp...@bluecall.ch Kontakt auf.


Herzlichen Dank für Ihr Verständnis und eine gute Zeit

Samuel Widmer



___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".

[FFmpeg-user] MP4 -> ADTS Headers

2019-10-02 Thread Ronak via ffmpeg-user
Hi,

I’m writing a C++ program to validate the integrity of a Fragmented MP4 file 
containing AAC audio.
This program would parse the FMP4 file, read each audio packet, attachment ADTS 
headers, and then try to decode the AAC using libfdk_aac.

I am using libavformat, and I am able to parse the MP4 atoms correctly, however 
I’m having issues figuring out the best way to attach the ADTS headers.

The best sample I was able to find was:

https://patchwork.ffmpeg.org/patch/3184/ 


Is there a better example for me to use?

Ronak
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".