mildsunrise / dcs-utils

Utilities for the DCS-2121 IP camera.
2 stars 2 forks source link

Completely Distorted sound #1

Open alireza-hosseini opened 9 years ago

alireza-hosseini commented 9 years ago

I am using this tool to stream my microphone audio to DCS-2136L speaker, This is the command(as you suggested in your documentations):

avconv -f alsa -i hw:0 -f s16le -ac 1 -ar 8000 - | node speaker 192.168.14.25 admin:

There is no problem in connecting to camera using this tool, but the output of the speaker is completely distorted and i'm getting following error while streaming:

"Application provided invalid, non monotonically increasing dts to muxer in stream 0: 604275 >= 604275"

mildsunrise commented 9 years ago

First of all, a reminder that I wrote these utilities for the DCS-2121, and have not been tested on other models.

Okay, so: have you tried using the camera's web interface to stream audio to the speaker? Did it sound distorted as well? What Node version are you running? What firmware version is the camera running?

Also, to make sure avconv is not the issue here, I've encoded a test sound, could you download it and send it to the speaker like:

cat sound.wav | node speaker 192.168.14.25 admin:
alireza-hosseini commented 9 years ago

yes, i have tested the camera using Internet Explorer, and every thing was right. I am using ubuntu 14.04,Node version is 0.10.28 and the firmware version of my camera is 1.00.13. I am getting following error on using above command: events.js:72 throw er; // Unhandled 'error' event Error: read ECONNRESET at errnoException (net.js:904:11) at TCP.onread (net.js:558:19)

mildsunrise commented 9 years ago

Weird. The avconv command worked but this one doesn't? Is that all the output you get?

alireza-hosseini commented 9 years ago

Yes that's all the output, by the way i'm getting same error when i'm adding "-acodec copy" at the end of avconv command:

avconv -f alsa -i hw:0 -f s16le -ac 1 -ar 8000 -acodec copy - | node speaker 192.168.14.25 admin:

which results to following output:

/home/alireza/Desktop/dcs-utils-master/acas/speaker avconv version 9.16-6:9.16-0ubuntu0.14.04.1, Copyright (c) 2000-2014 the Libav developers built on Aug 10 2014 18:16:02 with gcc 4.8 (Ubuntu 4.8.2-19ubuntu1) [alsa @ 0x26370e0] Estimating duration from bitrate, this may be inaccurate Guessed Channel Layout for Input Stream #0.0 : stereo Input #0, alsa, from 'hw:0': Duration: N/A, start: 16012.728673, bitrate: N/A Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s Output #0, s16le, to 'pipe:': Metadata: encoder : Lavf54.20.4 Stream #0.0: Audio: pcm_s16le, 48000 Hz, stereo, 1536 kb/s Stream mapping: Stream #0:0 -> #0:0 (copy) Press ctrl-c to stop encoding events.js:72 throw er; // Unhandled 'error' event ^ Error: read ECONNRESET at errnoException (net.js:904:11) at TCP.onread (net.js:558:19)

On Fri, Feb 13, 2015 at 10:35 PM, Xavier Mendez notifications@github.com wrote:

Weird. The avconv command worked but this one doesn't? Is that all the output you get?

— Reply to this email directly or view it on GitHub https://github.com/jmendeth/dcs-utils/issues/1#issuecomment-74307783.

_Alireza Hosseini, _Graduate Research Assistant Department of Mechatronics & Medical Engineering, Qazvin Islamic Azad University http://qiau.ac.ir/en/ Mechatronics Research Laboratory(MRL) Search & Rescue Mobile Robots Laboratory alireza.hosseini@qiau.ac.ir alireza.hosseini@qiau.ac.ir

mildsunrise commented 9 years ago

I wonder why did it work the first time, then...

Could you load the web interface with Devtools active, spot the applet that is doing the job (it should be something like Speaker.jar or so, and upload it so I can take a look?

riknedsin commented 4 years ago

@jmendeth Hey there, i have the same problem :( How can i contact with you?

mildsunrise commented 4 years ago

Yes, what model do you have?

riknedsin commented 4 years ago

Yes, what model do you have?

@jmendeth Hi, DCS-942L. I know that you wrote these utilities for the DCS-2121. But i hope you can help me and i want to ask some details at you. If you do not mind.

llemtt commented 4 years ago

Hi, same problem with DCS-942L.

After some testing/trials I suspect that /dev/speaker.cgi, beeing deprecated, is somehow broken. iOS dlink app uses /dev2/dgtalkie.cgi.

I can add that IE plugin uses /dev/speaker2.cgi but no sound comes out of the speaker and after 16 seconds it returns a "Audio line already occupied" error. Actually the error on the wire is "HTTP/1.0 414 Request-URI Too Long"!! Very strange.

riknedsin commented 4 years ago

Hi, same problem with DCS-942L.

After some testing/trials I suspect that /dev/speaker.cgi, beeing deprecated, is somehow broken. iOS dlink app uses /dev2/dgtalkie.cgi.

Interesting, thanks. Did you manage to play the audio file on the camera?

llemtt commented 4 years ago

@kirdden

"Did you manage to play the audio file on the camera?"

If you mean the sound.wav test file above no, I can't download it...

riknedsin commented 4 years ago

@kirdden

"Did you manage to play the audio file on the camera?"

If you mean the sound.wav test file above no, I can't download it...

I mean, can you streaming to the speaker(camera) any sound file?

llemtt commented 4 years ago

@kirdden

Yes of course I can stream a sound file (now I've managed to use also /dev/speaker2.cgi like the IE plugin) but volume is always very low and very distorted.

I suspect that the 942L doesn't expect a true 16 bit linear PCM (s16le) because the sound is there but it doesn't sound right, whereas with the dlink app the sound is perfect.

Unfortunately I don't have any working browser/plugin, and the /dev2/dgtalkie.cgi, used by the app, is a little bit harder to use...

riknedsin commented 4 years ago

Yes of course I can stream a sound file (now I've managed to use also /dev/speaker2.cgi like the IE plugin) but volume is always very low and very distorted.

What command do you use for this? If I understood correctly, you edited the file "speaker.js"

llemtt commented 4 years ago

Sorry but I'm back to work so I had to stop working on this.

Yes I edited the speaker.js file changing the url and the Content-Length -> 2000000000

riknedsin commented 4 years ago

Sorry but I'm back to work so I had to stop working on this.

Yes I edited the speaker.js file changing the url and the Content-Length -> 2000000000

Thanks for reply. Do you remember with which command you started the stream a sound file?

llemtt commented 4 years ago

Yes

ffmpeg -re -i /Users/teo/Desktop/Bridge\ Over\ Troubled\ Water.m4a -f s16le -ac 1 -ar 8000 - | node speaker 192.168.1.12 user:user

but it sounds really bad...