how to determin if it is mp3 or wav format of audio from GstCaps * caps from coming rtsp streaming
newcfd at yahoo.com
Wed Feb 8 23:00:37 UTC 2023
Great! Thank you so much.
On Wednesday, February 8, 2023, 05:38:53 p.m. EST, Michael Gruner <michael.gruner at ridgerun.com> wrote:
Maybe something like the following:
//Grab the first (and likely only) structure in the capsGstStructure *st = gst_caps_get_structure (caps, 0);
// Test if it is WAVgboolean is_wav = gst_structure_has_name (st, “audio/x-wav”);
// Test if it is MP3gboolean is_mpeg = gst_structure_has_name (st, “audio/mpeg”);
gint mpeg_layer;gst_structure_get_int (st, “layer”, &mpeg_layer);
gboolean is_mp3 = is_mpeg && mpeg_layer == 3;
Or you could use decodebin which will automatically choose the correct decoder for you.
On 8 Feb 2023, at 14:13, cfd new via gstreamer-devel <gstreamer-devel at lists.freedesktop.org> wrote:
need to set the right audio decoder for it.
Thanks for your help,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the gstreamer-devel