[FFmpeg-devel] [PATCH]ExtraData computation for aac in -acodec copy

Sailaja Mahendrakar smahendrakar at rgbnetworks.com
Wed Sep 2 16:09:22 CEST 2015


Hendrik,

When you say decoder cant allocate and write extradata, why does the flv decoder do it?

if (read) {
            if (vcodec->extradata_size != 1) {
                ff_alloc_extradata(vcodec, 1);
            }
            if (vcodec->extradata)
                vcodec->extradata[0] = avio_r8(s->pb);
            else
                avio_skip(s->pb, 1);
        }

What will be the resolution for not having extradata in the copyts mode i.e stream copy for the below commandline?

/opt/ripcode/bin/ffmpeg -copyts -i /root/ModernFamilyVMGCapture.ts -async 0 -vsync 0 -f flv -mpegts_pmt_start_pid 480 -map 0:2,0:0 -vcodec copy -b:v 544000 -muxdelay 0 -map 0:0 -codec:a:0 copy -flags +global_header -metadata:s:a:0 language=fra -b:a:0 128000 -bsf:a aac_adtstoasc rtmp://172.16.93.31/live/rtmpgit


-----Original Message-----
From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf Of Hendrik Leppkes
Sent: Tuesday, September 01, 2015 10:04 AM
To: FFmpeg development discussions and patches
Subject: Re: [FFmpeg-devel] [PATCH]ExtraData computation for aac in -acodec copy

On Tue, Sep 1, 2015 at 4:34 PM, Sailaja Mahendrakar <smahendrakar at rgbnetworks.com> wrote:
> Thank you for the comments Carl!
> I have applied the review comments and attached is the updated patch.
>
> Sailaja
>
> -----Original Message-----
> From: ffmpeg-devel [mailto:ffmpeg-devel-bounces at ffmpeg.org] On Behalf 
> Of Carl Eugen Hoyos
> Sent: Tuesday, September 01, 2015 2:37 AM
> To: ffmpeg-devel at ffmpeg.org
> Subject: Re: [FFmpeg-devel] [PATCH]ExtraData computation for aac in 
> -acodec copy
>
> Sailaja Mahendrakar <smahendrakar <at> rgbnetworks.com> writes:
>
>> Please find attached the patch for ExtraData computation for aac in 
>> -acodec copy.  With audio codec copy, there is no extradata 
>> computation and RTMP fails with no audio in playback.
>
> I don't know if it is acceptable what the patch does, so please wait for a review from an api expert, but before the patch can be applied, please fix the style to make it similar to the rest of the file:
>

Carl is correct to worry - a decoder cannot allocate and write extradata, thats not allowed in the API contract. Otherwise it may end up not being free'ed, or potentially free'ed by the wrong function.
I'm afraid your approach is not practical.

- Hendrik
_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel at ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list