New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sending audio #75
Comments
Hello @josh-- , @dougsland do you know any particular format required on this case? |
@josh-- did you try something like this? camera.audio_stream_capture(httptype="singlepart", channel=1, path_file="/home/user/Desktop/audio.aac")
CTRL-C to stop the continuous audio flow or use a timer |
@tchellomello do you mean using singlepart vs multipart? if so then yes. With pretty much all the audio formats i tested, i attempted with both multi and singlepart. In testing both methods i haven't noticed a real difference in what gets output from the cam. thanks again! |
Hi @josh-- @tchellomello -- yes, for me it worked fine with G.711A. You can try: where:
According with amcrest docs, the supported codecs are: |
@dougsland thats pretty much what i have been trying however it always comes out completely garbled on the speaker end. If i use the lame amcrest web plugin audio sounds fine. do you perhaps have a sample wav file i could try out? or any idea what settings i would use (sox/ffmpeg) to produce the correct type of output?
that sort of works, but the camera output is weird. it starts up alright then it seems like it rapidly speed up and be to the point where it is inaudible. |
so i think i finally have this squared away unfortunately it doesn't work utilizing this script using the following i was able to encode to the correct G.711A codec (this was working all along)
however because of the speed up i mentioned before i thought perhaps it was just sending too much at once and voila. I rate limited curl to the same rate as audio file and it plays as expected... below is a sample of the curl call used
|
Hello @josh--, Then I converted it as you showed using sox: $ sox -v 0.8 352652__foolboymedia__piano-notification-2.mp3 -r 8k -c1 sox-piano-notification.al Then I tried to upload it using the amcrest-cli --camera amcrestcam1 --audio-send-stream singlepart 1 sox-piano-notification.al G.711A Which worked great!! It reproduced the same effect as using the curl command. Can you check with the command amcrest-cli about to see if that will work too? |
@tchellomello can confirm that particular file works fine using the amcrest-cli as well as with curl. I think the main issue was due to the length of the track i was using. I was attempting to send 30s plus audio files. I'm assuming sending something longer at full speed overwhelms the camera. the following track will produce the problems im running into. It works fine using the rate limited curl but sounds all jumbled after a few seconds using amcrest-cli |
Closing this issue since it worked as expected :) |
@tchellomello just wanted to point out that this still doesn't work. using the file you provided works because it less than a few seconds long. attempting to send anything else (a music track for instance) will not work correctly. I believe the camera is expecting an audio playback stream rather than a file upload. |
first off, this is awesome i figured i was going to end up having to put something like this together myself but it's already done!
on that note; has anyone had any luck sending audio to their cam? this utility appears to send the audio to the cam just fine. However it always sounds completely messed up when outputting through the cam. Initially i started with just curl with the same result until i stumbled upon this.
im assuming it's some type of audio encoding issue. I have tried sending in most of the available formats with different bit/sample rates with no luck.
so far this encoding gets me the closest but it's still FAR from correct
G.711A as content type
ffmpeg -i 4353.mp3 -c:a pcm_alaw -ac 1 -ar 16000 -sample_fmt s16 output.wav
The text was updated successfully, but these errors were encountered: