[Audio] "could not link avenc_aac0 to aacparse0"

Anonymous
2014-04-30
2014-05-01
  • Anonymous - 2014-04-30

    For some reason, getting audio out of Snowmix isn't happening. Here's the details:

    Format:

    #AUDIO='audio/x-raw-int'
    AUDIOFORMATOUT=$AUDIO', endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2'
    

    Audio Source:

    AUDIO_SRC='fdsrc fd=1 do-timestamp=true'
    $AUDIO_SRC ! audioconvert ! avenc_aac ! $AUDIOFORMATOUT ! aacparse ! queue ! muxer.
    

    Just in case... Audio snippet from INI

    audio feed verbose 1
    audio feed add 1 Audio Feed #1
    audio feed channels 1 2
    audio feed rate 1 48000
    audio feed format 1 16 signed
    audio feed mute off 1
    audio feed volume 1 1
    
    audio mixer verbose 1
    audio mixer add 1 Audio Mixer #1
    audio mixer channels 1 2
    audio mixer rate 1 48000
    audio mixer mute off 1
    
    audio mixer source feed 1 1
    audio mixer source feed 1 2
    
    audio mixer source mute off 1 1
    audio mixer source mute off 1 2
    
    audio sink verbose 1
    audio sink add 1 Audio Sink #1
    audio sink channels 1 2
    audio sink rate 1 48000
    audio sink format 1 16 signed
    audio sink mute off 1
    audio sink source mixer 1 1
    
    audio mixer start 1
    
     
    • Peter Maersk-Moller

      Please post the full script you use to get audio out of Snowmix, as what you have posted is incomplete and erroneous.

      First you need to define the AUDIOFORMATOUT correctly and then place it correctly.

      You write

      #AUDIO='audio/x-raw-int'
      AUDIOFORMATOUT=$AUDIO', endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2'
      

      Assuming you are using gstreamer-0.10, it should be

      AUDIO='audio/x-raw-int'
      AUDIOFORMATOUT=$AUDIO', endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2'
      

      Then you write

      $AUDIO_SRC ! audioconvert ! avenc_aac ! $AUDIOFORMATOUT ! aacparse ! queue ! muxer.
      

      This does not make sense unless you have something in front it and you need to move AUDIOFORMATOUTPUT to after AUDIOSRC and before audioconvert because your audio encoder is taking raw audio samples as input on the left side and output encoded samples on the right side.

      $AUDIO_SRC ! $AUDIOFORMATOUT ! audioconvert ! avenc_aac ! aacparse ! queue ! muxer.
      

      I use faac instead of avenc_aac. There may be smaller differences in parameters and formats. You can also try to use lamemp3enc.

      Let me know how it goes.

      Last but not least, it's considered polite to add your name in the bottom of your posting, if you post anonymous.

      Kind regards
      Peter

       
      Last edit: Peter Maersk-Moller 2014-05-01
  • Jordan Johnson

    Jordan Johnson - 2014-05-01

    Yeah, sorry about that. Here is the entire script. With your modifications. Ignore everything after the pipe and avconv.

     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    #!/bin/bash
    rm /tmp/x264.mmkv
    rm /tmp/tx.ts
    rm /tmp/video.ts
    mkfifo /tmp/x264.mkv
    mkfifo /tmp/tx.ts
    mkfifo /tmp/video.ts
    
    # IMPORTANT >>>>>You need to get port, ip and feed_id right<<<<<
    port=9999
    ip=127.0.0.1
    
    # Set video feed 
    audio_sink_id=1
    
    # Check for SM variable and the snowmix and gstreamer settings
    if [ X$SM = X -o ! -f $SM/scripts/gstreamer-settings -o ! -f $SM/scripts/snowmix-settings ] ; then
      echo "You need to se the environment variable SM to the base of the Snowmix directory"
      exit 1
    fi
    
    # Load the Snowmix and GStreamer settings
    . $SM/scripts/gstreamer-settings
    . $SM/scripts/snowmix-settings
    
    if [ X$ctrsocket = X -o X$system_width = X -o X$system_height = X ] ; then
      echo Failed to get control pipe or width or height from running snowmix
      exit 1
    fi
    
    VIDEOFORMAT=$VIDEOBGRA', width=(int)'$system_width', height=(int)'$system_height', framerate=(fraction)'$ratefraction
    OUTPUTFORMAT=$VIDEOBGRA', width=1920, height=1080'
    
    AUDIO='audio/x-raw-int'
    AUDIOFORMATOUT=$AUDIO', endianness=(int)1234, signed=(boolean)true, width=(int)16, depth=(int)16, rate=(int)48000, channels=(int)2'
    VIDEOFORMATOUT='video/x-h264, alignment=au, stream-format=byte-stream, profile=(string)main'
    AUDIO_SRC='fdsrc fd=1 do-timestamp=true'
    VIDEO_SRC='shmsrc socket-path='$ctrsocket' do-timestamp=true is-live=true'
    SERVER_PORT=5010
    
        $gstlaunch -m       \
          $VIDEO_SRC            !\
          $VIDEOFORMAT      !\
          queue         !\
              $VIDEOCONVERT     !\
          x264enc bitrate=9000 tune=zerolatency speed-preset=5 key-int-max=50 bframes=0 !\
          $VIDEOFORMATOUT   !\
          h264parse     !\
          queue         !\
          mpegtsmux name=muxer  !\
          queue         !\
          filesink location=/tmp/x264.mkv \
              $AUDIO_SRC ! $AUDIOFORMATOUT ! audioconvert ! avenc_aac ! aacparse ! queue ! muxer. | avconv -i /tmp/x264.mkv -vcodec mpeg2video -s 1920x1080 -flags +ilme+ildct -alternate_scan 1 -top 0 -b:v 16000k -minrate 14000k -maxrate 17000k -bufsize 36000k -streamid 0:60 -streamid 1:65 -acodec ac3 -ac 2 -ar 48000 -b:a 192000 -y -f mpegts /tmp/video.ts | /usr/bin/tscbrmuxer b:1710000 '/tmp/video.ts' b:4000 pat.ts b:4000 pmt.ts b:4000 8187.ts o:1910000 null.ts > tx.ts
    
     
    • Peter Maersk-Moller

      Hi Jordan.

      A couple of tips:

      1) You are using a named pipe/fifo to stream between gst-launch and avconv. Thats okay, but then you have to create the pipe first. It's easy to used an unnamed pipe like this

      gst-launch ..... fdsink fd=3 3>&1 1>&2 | avconv -i pipe:0
      

      2) I can now see, you are using GStreamer 1.0. Good. Which version are you using? Note that 1.2.0-1.2.2 and possibly 1.2.3 has issues mentioned in this forum and on GStreamers dev forum. Depending on version, there iare issues with alpha for input, performance for input and other things. Git-master of GStreamer, its 1.3.0, is fine.

      3) We have so far used gstreamer-0.10 settings for the format of audio and video. You can add echo in front of $gstlaunch in the scripts/av_output2screen to see the pipeline and format for audio and video for gstreamer-1.0, unless you have an old version of gstreamer, then it switch to 0.10. If it does that, then modify the script in scripts/gstreamer-settings to force version 1.0

      Regards
      Peter

       
  • Jordan Johnson

    Jordan Johnson - 2014-05-01

    Using faac, I get this. gst-inspect tells me that avenc_aac is my audio codec.

    (gst-launch-1.0:6547): GStreamer-WARNING **: 0.10-style raw audio caps are being created. Should be audio/x-raw,format=(string).. now.
    WARNING: erroneous pipeline: no element "faac"
    
     
    • Peter Maersk-Moller

      Yep, you are using 0.10 format. Use 1.0 format. See previous message.

      And yes, you don't seem to have faac. You should install a gstreamer version which include faac. With some tinkering, you should be able to use avenc_aac though. I have used it, although tend not to, as I'm more used to use faac and there are or has been differences between the two.

      Regards
      Peter

       


Anonymous

Cancel  Add attachments