problem using alawdec

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

problem using alawdec

Tiago Katcipis
I have a file that is alaw encoded, but the file has the bytes swaped, every two bytes must be swaped so the alaw decoder can decode properly. I started to try to build a pipe but i got stuck.

The pipe:

gst-launch -v filesrc location=alaw_inv.dat ! audio/x-raw-int, endianness=4321, channels=1, rate=8000, width=16, depth=16, signed=false ! audioconvert ! audio/x-raw-int, endianess=1234, channels=1, rate=8000, width=16, depth=16, signed=false ! queue ! audio/x-alaw, rate=8000, channels=1 ! alawdec ! audioconvert ! wavenc ! filesink location=exemplo_convertido.
wav

I basically use audioconvert to make the swap, my problem was that the audioconvert cant connect to the alawdec, so i got the idea to use a queue to conect the audioconvert output to the alawdec. But it simply does not connect, and dont gives any good error msg, its just "ATENTION: wrong connection: it is not possible to connect queue0 to alawdec0". If i take out the alawdec and try to connect to audioconvert it works just fine (but the audio is a mess because i didnt decoded the alaw).

any hint of what im doing wrong? queue documentation does not have any example :-(.

http://gstreamer.freedesktop.org/data/doc/gstreamer/0.10.1/gstreamer-plugins/html/gstreamer-plugins-queue.html

best regards,
Katcipis

--
"it might be a profitable thing to learn Java, but it has no intellectual value whatsoever" Alexander Stepanov

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem using alawdec

Tiago Katcipis
setting debug level to 5 on the queue i get this:

0:00:00.020086126  5865  0x84a7050 DEBUG                queue gstqueue.c:419:gst_queue_init:<GstQueue@0x85d40e8> initialized queue's not_empty & not_full conditions
0:00:00.022986445  5865  0x84a7050 DEBUG                queue gstqueue.c:489:gst_queue_link_src:<queue0> queue linking source pad
0:00:00.023041017  5865  0x84a7050 DEBUG                queue gstqueue.c:502:gst_queue_link_src:<queue0> not starting task reason wrong-state

i dont know if im not searching on the right place...or if i am not seeing something...but neither the documentation of the queue ou gst-inspect is helping me to find out what is missing =/

On Mon, Jul 13, 2009 at 12:54 PM, Tiago Katcipis <[hidden email]> wrote:
I have a file that is alaw encoded, but the file has the bytes swaped, every two bytes must be swaped so the alaw decoder can decode properly. I started to try to build a pipe but i got stuck.

The pipe:

gst-launch -v filesrc location=alaw_inv.dat ! audio/x-raw-int, endianness=4321, channels=1, rate=8000, width=16, depth=16, signed=false ! audioconvert ! audio/x-raw-int, endianess=1234, channels=1, rate=8000, width=16, depth=16, signed=false ! queue ! audio/x-alaw, rate=8000, channels=1 ! alawdec ! audioconvert ! wavenc ! filesink location=exemplo_convertido.
wav

I basically use audioconvert to make the swap, my problem was that the audioconvert cant connect to the alawdec, so i got the idea to use a queue to conect the audioconvert output to the alawdec. But it simply does not connect, and dont gives any good error msg, its just "ATENTION: wrong connection: it is not possible to connect queue0 to alawdec0". If i take out the alawdec and try to connect to audioconvert it works just fine (but the audio is a mess because i didnt decoded the alaw).

any hint of what im doing wrong? queue documentation does not have any example :-(.

http://gstreamer.freedesktop.org/data/doc/gstreamer/0.10.1/gstreamer-plugins/html/gstreamer-plugins-queue.html

best regards,
Katcipis

--
"it might be a profitable thing to learn Java, but it has no intellectual value whatsoever" Alexander Stepanov



--
"it might be a profitable thing to learn Java, but it has no intellectual value whatsoever" Alexander Stepanov

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem using alawdec

michael smith-6-3
In reply to this post by Tiago Katcipis
On Mon, Jul 13, 2009 at 8:54 AM, Tiago Katcipis<[hidden email]> wrote:

> I have a file that is alaw encoded, but the file has the bytes swaped, every
> two bytes must be swaped so the alaw decoder can decode properly. I started
> to try to build a pipe but i got stuck.
>
> The pipe:
>
> gst-launch -v filesrc location=alaw_inv.dat ! audio/x-raw-int,
> endianness=4321, channels=1, rate=8000, width=16, depth=16, signed=false !
> audioconvert ! audio/x-raw-int, endianess=1234, channels=1, rate=8000,
> width=16, depth=16, signed=false ! queue ! audio/x-alaw, rate=8000,
> channels=1 ! alawdec ! audioconvert ! wavenc ! filesink
> location=exemplo_convertido.
> wav

This won't work, because audioconvert won't just do byteswapping on
unknown data, which is basically what you want.

It also won't work because you seem to have 16 bit a-law? GStreamer's
alaw decoder doesn't support that; I've never heard of it being used -
are you sure it's a-law? Regardless, you'll need a special decoder.

Once you have written a decoder for this format, you can make that
decoder accept the endianness your data is in, so you don't need to
byteswap beforehand.

Mike

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem using alawdec

Tiago Katcipis
Its not 16 bit alaw, i have to swap every 2 bytes, so i tell the audioconvert to get a sample of 16bits and swap it from 4321 to 1234. so the bytes (alaw samples) will be on the right position. I know its kinda odd, but my alaw file has the samples on the wrong order, so the bytes must be swaped, something like swap byte[0] with byte[1], byte[2] with byte[3]...and so goes on. I know i can make a element to do this, but i was trying to already use what is already done to acomplish the swaping.

Its not a endianess problem, its the alaw samples that are on the wrong order, i just use the audioconvert endianess to try to swap the samples for me.

On Mon, Jul 13, 2009 at 2:30 PM, Michael Smith <[hidden email]> wrote:
On Mon, Jul 13, 2009 at 8:54 AM, Tiago Katcipis<[hidden email]> wrote:
> I have a file that is alaw encoded, but the file has the bytes swaped, every
> two bytes must be swaped so the alaw decoder can decode properly. I started
> to try to build a pipe but i got stuck.
>
> The pipe:
>
> gst-launch -v filesrc location=alaw_inv.dat ! audio/x-raw-int,
> endianness=4321, channels=1, rate=8000, width=16, depth=16, signed=false !
> audioconvert ! audio/x-raw-int, endianess=1234, channels=1, rate=8000,
> width=16, depth=16, signed=false ! queue ! audio/x-alaw, rate=8000,
> channels=1 ! alawdec ! audioconvert ! wavenc ! filesink
> location=exemplo_convertido.
> wav

This won't work, because audioconvert won't just do byteswapping on
unknown data, which is basically what you want.

It also won't work because you seem to have 16 bit a-law? GStreamer's
alaw decoder doesn't support that; I've never heard of it being used -
are you sure it's a-law? Regardless, you'll need a special decoder.

Once you have written a decoder for this format, you can make that
decoder accept the endianness your data is in, so you don't need to
byteswap beforehand.

Mike

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
"it might be a profitable thing to learn Java, but it has no intellectual value whatsoever" Alexander Stepanov

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: problem using alawdec

Tiago Katcipis
i made a huge mistake, sorry. Endianess will not solve my problem.

what i need is
0xABCD -> SWAP -> 0xCDAB

what endianness will do is
0xABCD -> ENDIANESS -> 0xDCBA

if i am mistake...again :-), someone please let me know.

Is there any element to do byte swapping? its very simple i know, but i just dont want to redo something that already exists.

Sorry for the newbieness, and thanks for the help.

best regards,
Katcipis

On Mon, Jul 13, 2009 at 3:40 PM, Tiago Katcipis <[hidden email]> wrote:
Its not 16 bit alaw, i have to swap every 2 bytes, so i tell the audioconvert to get a sample of 16bits and swap it from 4321 to 1234. so the bytes (alaw samples) will be on the right position. I know its kinda odd, but my alaw file has the samples on the wrong order, so the bytes must be swaped, something like swap byte[0] with byte[1], byte[2] with byte[3]...and so goes on. I know i can make a element to do this, but i was trying to already use what is already done to acomplish the swaping.

Its not a endianess problem, its the alaw samples that are on the wrong order, i just use the audioconvert endianess to try to swap the samples for me.

On Mon, Jul 13, 2009 at 2:30 PM, Michael Smith <[hidden email]> wrote:
On Mon, Jul 13, 2009 at 8:54 AM, Tiago Katcipis<[hidden email]> wrote:
> I have a file that is alaw encoded, but the file has the bytes swaped, every
> two bytes must be swaped so the alaw decoder can decode properly. I started
> to try to build a pipe but i got stuck.
>
> The pipe:
>
> gst-launch -v filesrc location=alaw_inv.dat ! audio/x-raw-int,
> endianness=4321, channels=1, rate=8000, width=16, depth=16, signed=false !
> audioconvert ! audio/x-raw-int, endianess=1234, channels=1, rate=8000,
> width=16, depth=16, signed=false ! queue ! audio/x-alaw, rate=8000,
> channels=1 ! alawdec ! audioconvert ! wavenc ! filesink
> location=exemplo_convertido.
> wav

This won't work, because audioconvert won't just do byteswapping on
unknown data, which is basically what you want.

It also won't work because you seem to have 16 bit a-law? GStreamer's
alaw decoder doesn't support that; I've never heard of it being used -
are you sure it's a-law? Regardless, you'll need a special decoder.

Once you have written a decoder for this format, you can make that
decoder accept the endianness your data is in, so you don't need to
byteswap beforehand.

Mike

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel



--
"it might be a profitable thing to learn Java, but it has no intellectual value whatsoever" Alexander Stepanov



--
"it might be a profitable thing to learn Java, but it has no intellectual value whatsoever" Alexander Stepanov

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge  
This is your chance to win up to $100,000 in prizes! For a limited time,
vendors submitting new applications to BlackBerry App World(TM) will have
the opportunity to enter the BlackBerry Developer Challenge. See full prize  
details at: http://p.sf.net/sfu/Challenge
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gstreamer-devel