2

I would like to store a file which has AAC audio frames,

For that i used the below pipeline,

gst-launch-1.0 filesrc location=Test_44100Hz_2ch_s16le.wav ! "audio/x-raw,rate=44100,format=s16le,channels=2" ! audioparse format=raw raw-format=s16le rate=44100 channels=2 ! faac ! aacparse ! queue ! filesink location=a1

While reading that file again to pulsesink using below pipeline,

gst-launch-1.0 filesrc location=a1 ! aacparse ! faad ! audioconvert ! audioresample ! pulsesink

I am Receiving below error, I used GST_DEBUG=3, but i am not able find the solution.

0:00:00.031924804  3379      0x2231d60 WARN                 basesrc gstbasesrc.c:3483:gst_base_src_start_complete:<filesrc0> pad not activated yet
Pipeline is PREROLLING ...
0:00:00.033044700  3379      0x2231050 WARN               baseparse gstbaseparse.c:3255:gst_base_parse_loop:<aacparse0> error: No valid frames found before end of stream
ERROR: from element /GstPipeline:pipeline0/GstAacParse:aacparse0: No valid frames found before end of stream
Additional debug info:
gstbaseparse.c(3255): gst_base_parse_loop (): /GstPipeline:pipeline0/GstAacParse:aacparse0
ERROR: pipeline doesn't want to preroll.

Can anybody help me, To solve this? I need to store AAC audio frames and need to stream that file as AAC audio stream.

2 Answers2

2

This is it, tested working:

gst-launch-1.0 filesrc location=WAV_44_16bit.wav ! decodebin ! audioconvert ! queue ! voaacenc ! aacparse ! queue ! mp4mux ! filesink location=aac.mp4


gst-launch-1.0 filesrc location=aac.mp4 ! decodebin ! audioconvert ! audioresample ! alsasink

In container there are metadata information stored.. without them the decoder does not know how to process the data.

nayana
  • 3,787
  • 3
  • 20
  • 51
  • yeah, i know this. If we use mux it can be easy and it will work. But i don't want to mux the data, i want to store only encoded data, without muxing. Can it possible? – Prasanth Kumar Arisetti May 30 '16 at 07:14
  • @PrasanthKumarArisetti yes but you must store also the metadata somewhere.. I never done this.. why cant you use the mp4? When you use mp4 the aac data are just wrapped by mp4.. there is no change of the aac data.. – nayana May 30 '16 at 07:45
  • Even if you could pass the metadata it might only work for Low Complexity streams, something like SSR nearly mandates the use of a container. – Josiah DeWitt Nov 17 '17 at 19:46
0

AAC Audio streams require a container in order to be useful within gstreamer

For decoder initialization it is necessary to know sampling frequency and Audio Object. In gstreamer we are unable to pass this metadata directly to the parser or the decoder. The parser collects this data instead from the mp4 header then the encoder inherits the frame structure/size and sample rate. So this is a deficiency in either aacparse(parser) or avdec_aac/faad(decoder), none of which have exposed parameters to specify frame size of a raw file, the afore mentioned metadata. That being said, I haven't found a compelling reason why anyone would need to do this. I found myself trying to do it before I discovered the aac simply needed to be muxed into an MP4(mp4mux) or another container to work and be portable. The container/framing only adds a small amount of data to the stream.

Josiah DeWitt
  • 1,594
  • 13
  • 15