[RFC] AAC bsf and rtp/rtsp
Right now calling ffmpeg -i s.aac -acodec copy -absf aac_adtstoasc -f rtp rtp://l:port won't produce an sdp since the bsf is kicks in later and we cannot use the hack we used for h264 since the bsf expect to see a packet. av_find_stream_info isn't aware of the fact we are going to use or not a bsf even if it knows if we need parsing or not. A wrong solution to make sdp/rtp/rtsp happy would be just putting the first packet as extradata, a nicer solution would be making av_find_stream aware of the bsf so it will provide the properly formatted extradata. Anybody has an opinion or a better place in which put this? lu -- Luca Barbato Gentoo/linux http://dev.gentoo.org/~lu_zero
Hi, On Wed, Sep 8, 2010 at 11:30 AM, Luca Barbato <lu_zero at gentoo.org> wrote:
A wrong solution to make sdp/rtp/rtsp happy would be just putting the first packet as extradata, a nicer solution would be making av_find_stream aware of the bsf so it will provide the properly formatted extradata.
That nice solution isn't completely impossible to implement, is it? Sounds nice to me (if others are OK with it also, of course). Ronald
On 9/8/10 6:28 PM, Ronald S. Bultje wrote:
That nice solution isn't completely impossible to implement, is it?
The simplest thing is passing the bsf in the context, anybody against that? lu
On Thu, Sep 09, 2010 at 03:08:33PM +0200, Luca Barbato wrote:
On 9/8/10 6:28 PM, Ronald S. Bultje wrote:
That nice solution isn't completely impossible to implement, is it?
The simplest thing is passing the bsf in the context, anybody against that?
until the problem has been explained i wont accept any solution to code i maintain the initial mail of this thread is so terse and full of grammer errors i have no idea at all what you talk about [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
... defining _GNU_SOURCE... For the love of all that is holy, and some that is not, don't do that. -- Luca & Mans
On 9/9/10 3:16 PM, Michael Niedermayer wrote:
On Thu, Sep 09, 2010 at 03:08:33PM +0200, Luca Barbato wrote:
On 9/8/10 6:28 PM, Ronald S. Bultje wrote:
That nice solution isn't completely impossible to implement, is it?
The simplest thing is passing the bsf in the context, anybody against that?
until the problem has been explained i wont accept any solution to code i maintain the initial mail of this thread is so terse and full of grammer errors i have no idea at all what you talk about
looks like that a stray "is" was left while I was rewriting the sentence, sorry. Anyway: - in order to produce the sdp lines for aac we need the aac extradata. - adts stream do not provide extradata - the bsf filter to reformat aac to asc would provide the extradata. - because how bsf works in the extradata would be updated once it starts to output packets. ffmpeg -i s.aac -acodec copy -absf aac_adtstoasc -f rtp rtp://l:port Won't work even if it should. To fix it the simplest way would be having the av_find_stream_info aware of the bsf in use so they will be called at the same level of the parsers, giving a consistent result. Clearer now? lu
On Thu, Sep 09, 2010 at 04:16:41PM +0200, Luca Barbato wrote:
On 9/9/10 3:16 PM, Michael Niedermayer wrote:
On Thu, Sep 09, 2010 at 03:08:33PM +0200, Luca Barbato wrote:
On 9/8/10 6:28 PM, Ronald S. Bultje wrote:
That nice solution isn't completely impossible to implement, is it?
The simplest thing is passing the bsf in the context, anybody against that?
until the problem has been explained i wont accept any solution to code i maintain the initial mail of this thread is so terse and full of grammer errors i have no idea at all what you talk about
looks like that a stray "is" was left while I was rewriting the sentence, sorry.
Anyway:
- in order to produce the sdp lines for aac we need the aac extradata. - adts stream do not provide extradata - the bsf filter to reformat aac to asc would provide the extradata. - because how bsf works in the extradata would be updated once it starts to output packets.
ffmpeg -i s.aac -acodec copy -absf aac_adtstoasc -f rtp rtp://l:port
Won't work even if it should.
To fix it the simplest way would be having the av_find_stream_info aware of the bsf in use so they will be called at the same level of the parsers, giving a consistent result.
the AVCodecParser.split() function exists to extract extradata from the packets at av_find_stream_info() level [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein
On 9/9/10 4:19 PM, Michael Niedermayer wrote:
On Thu, Sep 09, 2010 at 04:16:41PM +0200, Luca Barbato wrote:
On 9/9/10 3:16 PM, Michael Niedermayer wrote:
On Thu, Sep 09, 2010 at 03:08:33PM +0200, Luca Barbato wrote:
On 9/8/10 6:28 PM, Ronald S. Bultje wrote:
That nice solution isn't completely impossible to implement, is it?
The simplest thing is passing the bsf in the context, anybody against that?
until the problem has been explained i wont accept any solution to code i maintain the initial mail of this thread is so terse and full of grammer errors i have no idea at all what you talk about
looks like that a stray "is" was left while I was rewriting the sentence, sorry.
Anyway:
- in order to produce the sdp lines for aac we need the aac extradata. - adts stream do not provide extradata - the bsf filter to reformat aac to asc would provide the extradata. - because how bsf works in the extradata would be updated once it starts to output packets.
ffmpeg -i s.aac -acodec copy -absf aac_adtstoasc -f rtp rtp://l:port
Won't work even if it should.
To fix it the simplest way would be having the av_find_stream_info aware of the bsf in use so they will be called at the same level of the parsers, giving a consistent result.
the AVCodecParser.split() function exists to extract extradata from the packets at av_find_stream_info() level
So you'd suggest to use the extradata extraction logic there independently from the bsf presence? lu
On Thu, Sep 09, 2010 at 04:44:23PM +0200, Luca Barbato wrote:
On 9/9/10 4:19 PM, Michael Niedermayer wrote:
On Thu, Sep 09, 2010 at 04:16:41PM +0200, Luca Barbato wrote:
On 9/9/10 3:16 PM, Michael Niedermayer wrote:
On Thu, Sep 09, 2010 at 03:08:33PM +0200, Luca Barbato wrote:
On 9/8/10 6:28 PM, Ronald S. Bultje wrote:
That nice solution isn't completely impossible to implement, is it?
The simplest thing is passing the bsf in the context, anybody against that?
until the problem has been explained i wont accept any solution to code i maintain the initial mail of this thread is so terse and full of grammer errors i have no idea at all what you talk about
looks like that a stray "is" was left while I was rewriting the sentence, sorry.
Anyway:
- in order to produce the sdp lines for aac we need the aac extradata. - adts stream do not provide extradata - the bsf filter to reformat aac to asc would provide the extradata. - because how bsf works in the extradata would be updated once it starts to output packets.
ffmpeg -i s.aac -acodec copy -absf aac_adtstoasc -f rtp rtp://l:port
Won't work even if it should.
To fix it the simplest way would be having the av_find_stream_info aware of the bsf in use so they will be called at the same level of the parsers, giving a consistent result.
the AVCodecParser.split() function exists to extract extradata from the packets at av_find_stream_info() level
So you'd suggest to use the extradata extraction logic there independently from the bsf presence?
yes [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Everything should be made as simple as possible, but not simpler. -- Albert Einstein
participants (3)
-
lu_zero@gentoo.org -
michaelni@gmx.at -
rsbultje@gmail.com