how to use avdec_g726 to decode g726 raw data

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

how to use avdec_g726 to decode g726 raw data

strong
hi, all
    I want to use gstreamer/libav to encode$decode with g726, the command line I used is
encode:
gst-launch-1.0 alsasrc device=hw:0 ! audio/x-raw, rate=8000, channels=1, format=S16LE, layout=interleaved ! avenc_g726 code_size=5 ! filesink location=test.g726
it can work well, I can use ffplay to decode test.g726

decode:
gst-launch-1.0 filesrc location=test.g726 blocksize=100 ! audio/x-adpcm, bitrate=40000, rate=8000, channels=1, layout=g726 ! avdec_g726 ! filesink location=test.pcm

some issues are found

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data stream error.
Additional debug info:
../subprojects/gstreamer/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
streaming stopped, reason error (-5)
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

It seems that filesrc plugin can not parse g726 raw data, do anybody give me some suggestion to fix the issue?

Thanks

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: how to use avdec_g726 to decode g726 raw data

Nicolas Dufresne-5
Le jeudi 11 mars 2021 à 12:10 +0800, strong a écrit :

> hi, all
>     I want to use gstreamer/libav to encode$decode with g726, the command line
> I used is
> encode:
> gst-launch-1.0 alsasrc device=hw:0 ! audio/x-raw, rate=8000, channels=1, format=S16LE, layout=interleaved ! avenc_g726 code_size=5 ! filesink location=test.g726
> it can work well, I can use ffplay to decode test.g726
>
> decode:
> gst-launch-1.0 filesrc location=test.g726 blocksize=100 ! audio/x-adpcm,
> bitrate=40000, rate=8000, channels=1, layout=g726 ! avdec_g726 ! filesink
> location=test.pcm
>
> location=test.pcm

Took me a bit of research, but found this:

0:00:00.343734425 725274 0x55c94b173000 DEBUG           audiodecoder gstaudiodecoder.c:2396:gst_audio_decoder_sink_eventfunc:<avdec_g726-0> unsupported format; ignoring

Didn't search further, but the decoder refuses byte segments and fails everything. You can hack/workaround that with filesrc do-timestamp=TRUE.

gst-launch-1.0 filesrc do-timestamp=TRUE location=test.g726 blocksize=100 ! audio/x-adpcm,bitrate=40000, rate=8000, channels=1, layout=g726 ! avdec_g726 ! filesink location=test.pcm

Would be nice to open an issue in gst-ffmepg about that.

Nicolas

>
> some issues are found
>
> Setting pipeline to PAUSED ...
> Pipeline is PREROLLING ...
> ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Internal data
> stream error.
> Additional debug info:
> ../subprojects/gstreamer/libs/gst/base/gstbasesrc.c(3127): gst_base_src_loop
> (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
> streaming stopped, reason error (-5)
> ERROR: pipeline doesn't want to preroll.
> Setting pipeline to NULL ...
> Freeing pipeline ...
>
> It seems that filesrc plugin can not parse g726 raw data, do anybody give me
> some suggestion to fix the issue?
>
> Thanks
> _______________________________________________
> gstreamer-devel mailing list
> [hidden email]
> https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel


_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel