sofiactl
sofiactl copied to clipboard
Download recording with audio
Is it possible to download the audio stream from a recording along with the h264 video? My camera supports it and the iCsee app support it as well.
I tried to modify the existing FileQuery code to look for common audio extensions but none has returned any match,
For devices that I've seen the captured stream saved to h264 file if the device has internal memory (i.e. dvr or camera with sd card slot). Camera can do live audio streaming in alaw format, but I don't see the way to get only alaw stream from the already recorded h264 video using sofia protocol. iCsee app could download h264 and extract audio data locally, didn't check how it work. The current app version could get raw audio or h264 video streaming for decoding by external app.
@Caian did you ever figure out how to get audio along with the video?
@667bdrm is the audio typically embedded in the h264 file?
@fogleman h264 file contains audio stream that playing when using supplied with seller General_DiskPlayer_Beta_V1.0.1.1.T.20210205.exe. I've tried to play it in VLC as described at https://reolink.com/blog/how-to-play-h264-files-in-vlc/ but there are no sound. ffprobe does not able to locate audio stream. Maybe someone could play with multiple demuxers audio codecs.
In the dump the highlighted part looks like alaw sound stream that used in audio commands (and can be played by the following command: play -t al -r 8000 -c 1
Here is the sample alaw file extracted from the cam firmware huanyingguanglin_english.zip
As I see from beta player file listing it contains libav files and debug files so hopefully decoding parameters could be extracted with debugger:
avcodec-58.dll avdevice-58.dll avfilter-7.dll avformat-58.dll avutil-56.dll Config.ini CrashDumpFile.dmp DiskPlayer.exe DiskPlayer.pdb DllDeinterlace.dll H264Play.dll H264Play.pdb Language lua5.1.dll Password.dll postproc-55.dll Skin StreamReader.dll StreamReader.pdb swresample-3.dll swscale-5.dll Uninstall uninstall.exe WndManager.ocx
Vendor player of my cam (be careful, this is a proprietary software from china vendor and I used it inside virtual machine and did not audited it) DiskPlayer2021-02-05.zip
I now have a working Go program that can convert my camera videos to MP4, including audio:
https://gist.github.com/fogleman/27f5e3beba1d4aba7d2860206607e67c
This is the camera that I am using: https://green-backyard.com/collections/bird-box-camera/products/wireless-bird-box-camera/
I tried to play downloaded video with mpv
, but it cannot detect format.
Forcing demuxer helped:
mpv --demuxer-lavf-format=hevc ./idea0_2023-03-17_004_13.30.39-13.30.49\[M\]\[@54f\]\[0\].h264