This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM68A: Microphone work with video

Part Number: AM68A

Tool/software:

 

I am working on a GStreamer pipeline on the AM68A board to capture video from a camera and audio from a microphone simultaneously, encode them, and save to a file (e.g., MKV).

The pipeline works and records correctly, but when I press Ctrl+C to stop, the application repeatedly prints:

Interrupt received, sending EOS...

and never exits properly. It seems the pipeline is stuck waiting for EOS (end-of-stream) and does not shut down cleanly.

Here is the GStreamer command I am running:

gst-launch-1.0 -e \
  v4l2src device=/dev/video2 ! videoconvert ! queue ! v4l2h264enc ! h264parse ! queue ! mux. \
  alsasrc do-timestamp=true ! queue ! audioconvert ! audioresample ! avenc_aac ! aacparse ! queue ! mux. \
  matroskamux name=mux ! filesink location=test.mkv sync=false

Could you please advise on:

  1. Best practices or recommended pipeline structure for simultaneous video/audio capture on AM68A?

  2. How to properly handle EOS and Ctrl+C to cleanly exit the pipeline without hanging?

  3. Any example code or documentation for handling EOS messages and graceful shutdown on TI GStreamer?


  • Hello,

    Thanks for your question. We will be looking into this. It seems this requires some collaboration with our audio experts so I will loop them in.

    Regards,
    Sarabesh S.

  • Hi Mohammed,

    Remove the -e from the pipeline.

    With the -e:

    $ gst-launch-1.0 -e \
      videotestsrc ! videoconvert ! queue ! v4l2h264enc ! h264parse ! queue ! mux. \
      audiotestsrc ! queue ! audioconvert ! queue ! mux. \
      matroskamux name=mux ! filesink location=test.mkv sync=false
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    Redistribute latency...
    Redistribute latency...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    Redistribute latency...
    New clock: GstSystemClock
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    EOS on shutdown enabled -- Forcing EOS on the pipeline
    Waiting for EOS...
    ^C04:14.8 / 99:99:99.

    Without the -e:

    $ gst-launch-1.0 \
      videotestsrc ! videoconvert ! queue ! v4l2h264enc ! h264parse ! queue ! mux. \
      audiotestsrc ! queue ! audioconvert ! queue ! mux. \
      matroskamux name=mux ! filesink location=test.mkv sync=false
    
    Setting pipeline to PAUSED ...
    Pipeline is PREROLLING ...
    Redistribute latency...
    Redistribute latency...
    Pipeline is PREROLLED ...
    Setting pipeline to PLAYING ...
    Redistribute latency...
    New clock: GstSystemClock
    ^Chandling interrupt.
    Interrupt: Stopping pipeline ...
    Execution ended after 0:00:01.397491955
    Setting pipeline to NULL ...
    Freeing pipeline ...

    Best,
    Jared