BC Media Format - Streaming audio to the cameras #187
-
Hi, Am working towards adding "TalkAbility" functionality to Neolink, but am having a problem getting my camera to accept the audio bites am sending @QuantumEntangledAndy has helped me out quite a bit, but I wanted to see if anyone else got some insights regarding the audio recordings. This is the
Here is a short WireShark capture of me streaming to the camera via the old Reolink client. The packages that the client is sending are in BC Media format, like how the camera is sending video to the client. So the most likely is that i need to encode by audio to DVI-4 adpcm. This is how I convert the audio am working with right now Wikipedia list that ffmpeg has DVI support but i cant find any information that i can understand on how to specify DVI4. Dose someone know more about this? Finally am also am confused about this part of the protocol documentation: `### ADPCM After the ADPCM header is another header of the form
Any and all insight is welcomed, right now it feels like am just throwing random bits at the camera haha |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 89 replies
-
Ok so I do not believe ffmpeg supports dvi4 adpcm (it is not the same as DVI movies). You can check which ones it supports with assuming linux/osx term with ffmpeg -codecs | grep adpcm The closest format that ffmpeg supports is the IMA one which is the same as DVI but with a different block header. So few things support it that we created a adpcm decoder in rust It is definitely NOT Now about the block part A block is a small chunk of audio. Every byte in adpcm depends on the previous byte. So what do you do if you want to start playing at 80% through the track? Do you load every byte before? No instead you only need to go back to the beginning of the block. In the block header is effectively a checkpoint saying this byte is this value no need to look further backwards to calculate it. How often this checkpoint is made depends on how the adpcm was implemented and may be configurable. You may want to read our discussion in #68 this is where we actually reverse engineered this stuff and I learnt all I know about ADPCM during that PR is the BC Media format. @twistedddx I remember you are good at this sort of less common audio formats do you have any recommended way to encode in DVI4 adpcm? |
Beta Was this translation helpful? Give feedback.
-
Recompiling the audio files
Q: Should i also remove the adpcm state? or should that still be in the recompiled audio file? 5, concatenating all the bytes and saving to file (repeat the process and writing more data to the file for every 202 type found in the capture)? Is this correct ? Also, do we know of any desktop media player that can play this format (to validate that the file works before sending it back to the camera)? |
Beta Was this translation helpful? Give feedback.
Ok so I do not believe ffmpeg supports dvi4 adpcm (it is not the same as DVI movies). You can check which ones it supports with assuming linux/osx term with
grep
ffmpeg -codecs | grep adpcm
The closest format that ffmpeg supports is the IMA one which is the same as DVI but with a different block header.
So few things support it that we created a adpcm decoder in rust
src/bc_protocol/adpcm.rs
. It may be necessary to write the encoder then you can just use more standard formats.It is definitely NOT
adpcm_ms
Now about the block part
A block is a small chunk of audio. Every byte in adpcm depends on the previous byte. So what do you do if you want to start playing at 80% through the track? D…