[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gstreamer-devel
Subject:    Dealing with "raw" AAC and appsrc
From:       Brian Dilley <bdilley () penguinpimps ! com>
Date:       2019-09-30 18:53:15
Message-ID: CAJvfSDpNiys56WLzTGe=YZT4jh7Ff4AW6iq2jxiW80QrinykXg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


MODS: sorry for the duplicate send, i used the wrong email address during
signup and had to change it.  Please disregard the last email :)

Hello friends.

I'm working on an RTMP ingestion server.  Currently I'm trying to figure
out how to handle the audio packets.  The audio packets come across as
AAC-HE 44kHz in an RTMP message (in this scenario).  They're packed in what
I think is called an FLV tag box?  Basically the first byte indicates the
codec (AAC in this case) and the second byte indicates whether or not it's
a configuration packet.  The configuration packets aren't very useful, and
i just ignore it for now (the very first audio packet is a configuration
packet).  So far so good - the rest of the RTMP message is the AAC data.
But it doesn't have an ADTS header, so I'm generating one (based on the
FFMPEG code).  So now i'm writing these packets (with a generated ADTS
header) into the following pipeline and was expecting it to dump decoded
audio into the file, but it results in error code 1: Internal data stream
error:

appsrc name=audioInput is-live=true caps=audio/mpeg ! faad ! filesink
name=output
location=/the/location.data


When I use the following pipeline the data makes it into the file, but it's
unplayable (mplayer just produces static):

appsrc name=audioInput is-live=true caps=audio/mpeg ! filesink name=output
location=/the/location.data


I've even tried both pipelines without the is-live and caps configuration
options on the appsrc.

I'm hoping someone out there has dealt with raw AAC and/or RTMP before and
knows what I'm overlooking.

Oh, and just incase it matters - I'm setting the presentation timestamp on
the Buffer before writing it to the AppSrc using the timestamp from the
RTMP client.


Thanks!

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail-m_-746724573912808034gmail-F0XO1GC-ed-a" \
style="margin:0px 0px 0px 44px;padding:0px 0px 0px 5px;border:0px"><div \
class="gmail-m_-746724573912808034gmail-F0XO1GC-nb-P" \
style="margin:0px;padding:0px;border:0px;line-height:normal"><div \
style="margin:0px;padding:0px;border:0px"><div \
style="margin:0px;padding:0px;border:0px;overflow:auto"><div \
style="margin:0px;padding:0px;border:0px;max-height:10000px"><div dir="ltr" \
style="margin:0px;padding:0px;border:0px"><div \
style="margin:0px;padding:0px;border:0px">MODS: sorry for the duplicate send, i used \
the wrong email address during signup and had to change it.   Please disregard the \
last email :)</div><div style="margin:0px;padding:0px;border:0px"><br></div><div \
style="margin:0px;padding:0px;border:0px">Hello friends.</div><div \
style="margin:0px;padding:0px;border:0px"><br></div><div \
style="margin:0px;padding:0px;border:0px">I&#39;m working on an RTMP ingestion \
server.   Currently I&#39;m trying to figure out how to handle the audio packets.   \
The audio packets come across as AAC-HE 44kHz in an RTMP message (in this scenario).  \
They&#39;re packed in what I think is called an FLV tag box?   Basically the first \
byte indicates the codec (AAC in this case) and the second byte indicates whether or \
not it&#39;s a configuration packet.   The configuration packets aren&#39;t very \
useful, and i just ignore it for now (the very first audio packet is a configuration \
packet).   So far so good - the rest of the RTMP message is the AAC data.   But it \
doesn&#39;t have an ADTS header, so I&#39;m generating one (based on the FFMPEG \
code).   So now i&#39;m writing these packets (with a generated ADTS header) into the \
following pipeline and was expecting it to dump decoded audio into the file, but it \
results in error code 1: Internal data stream error:</div><div \
style="margin:0px;padding:0px;border:0px"><br></div><div \
style="margin:0px;padding:0px;border:0px"><div \
style="margin:0px;padding:0px;border:1px solid \
rgb(187,187,187);background-color:rgb(250,250,250)"><code \
style="margin:0px;padding:0px;border:0px"><div \
style="margin:0px;padding:0px;border:0px"><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">appsrc name</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">audioInput  </span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,136)">is</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">-</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">live</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,136)">true</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">  caps</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">audio</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">/</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">mpeg  </span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">!</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">  faad  </span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">!</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">  filesink \
name</span><span style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">output \
location</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,136,0)">/the/</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">location</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">.</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">data</span></div></code></div></div><div \
style="margin:0px;padding:0px;border:0px"><br></div><div \
style="margin:0px;padding:0px;border:0px"><br></div><div \
style="margin:0px;padding:0px;border:0px">When I use the following pipeline the data \
makes it into the file, but it&#39;s unplayable (mplayer just produces \
static):</div><div style="margin:0px;padding:0px;border:0px"><br></div><div \
style="margin:0px;padding:0px;border:1px solid \
rgb(187,187,187);background-color:rgb(250,250,250)"><code \
style="margin:0px;padding:0px;border:0px"><div \
style="margin:0px;padding:0px;border:0px"><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">appsrc name</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">audioInput  </span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,136)">is</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">-</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">live</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,136)">true</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">  caps</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">audio</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">/</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">mpeg  </span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">!</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">  filesink \
name</span><span style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">output \
location</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">=</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,136,0)">/the/</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">location</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(102,102,0)">.</span><span \
style="margin:0px;padding:0px;border:0px;color:rgb(0,0,0)">data</span></div></code></div><br><br>I&#39;ve \
even tried both pipelines without the is-live and caps configuration options on the \
appsrc.<div style="margin:0px;padding:0px;border:0px"><br></div><div \
style="margin:0px;padding:0px;border:0px">I&#39;m hoping someone out there has dealt \
with raw AAC and/or RTMP before and knows what I&#39;m overlooking.</div><div \
style="margin:0px;padding:0px;border:0px"><br></div><div \
style="margin:0px;padding:0px;border:0px"><span style="font-size:13px">Oh, and just \
incase it matters - I&#39;m setting the presentation timestamp on the Buffer before \
writing it to the AppSrc using the timestamp from the RTMP client.</span><div \
style="margin:0px;padding:0px;border:0px;font-size:13px"><br \
class="gmail-m_-746724573912808034gmail-Apple-interchange-newline"></div></div><div \
style="margin:0px;padding:0px;border:0px"><br>Thanks!</div></div></div></div></div></div><div \
class="gmail-yj6qo"></div><div class="gmail-adL" \
style="margin:0px;padding:0px;border:0px"></div><div class="gmail-adL" \
style="margin:0px;padding:0px;border:0px"></div></div><div class="gmail-adL" \
style="margin:0px;padding:0px;border:0px"><div \
class="gmail-m_-746724573912808034gmail-F0XO1GC-ed-a" style="margin:0px 0px 0px \
44px;padding:0px 0px 0px 5px;border:0px"></div></div><div \
class="gmail-m_-746724573912808034gmail-F0XO1GC-nb-b gmail-adL" style="margin:0px 0px \
0px 39px;padding:0px 0px 0px 5px;border:0px"><div \
class="gmail-m_-746724573912808034gmail-F0XO1GC-nb-a \
gmail-m_-746724573912808034gmail-F0XO1GC-nb-cb" style="margin:0px;padding:4px \
0px;border:0px"><div style="margin:0px;padding:0px;border:0px"><div \
style="margin:0px;padding:0px;border:0px;font-size:13px;display:inline-block"></div><span \
style="font-size:13px"></span><div \
class="gmail-m_-746724573912808034gmail-F0XO1GC-md-a" style="margin:4px 0px \
0px;padding:0px;border:0px;height:34px;font-size:13px"><br \
class="gmail-m_-746724573912808034gmail-Apple-interchange-newline"></div></div></div></div></div>



[Attachment #6 (text/plain)]

_______________________________________________
gstreamer-devel mailing list
gstreamer-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic