Skip to content
This repository has been archived by the owner on Oct 18, 2024. It is now read-only.

Download recording with audio #16

Open
Caian opened this issue Nov 4, 2021 · 5 comments
Open

Download recording with audio #16

Caian opened this issue Nov 4, 2021 · 5 comments

Comments

@Caian
Copy link

Caian commented Nov 4, 2021

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,

@667bdrm
Copy link
Owner

667bdrm commented Nov 19, 2021

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.

@fogleman
Copy link

@Caian did you ever figure out how to get audio along with the video?

@667bdrm is the audio typically embedded in the h264 file?

@667bdrm
Copy link
Owner

667bdrm commented Mar 14, 2023

@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 ). Probably if extract all these parts from .h264 stream file, concatenate it in the single file, it could be playable. At least using same technique when implemented audio playback (but in the audio commands it already transfered without video stream, only the audio parts). Looks like it needs to be converted to the media container with video/audio tracks supported by vlc, ffmpeg, etc.

sofia-h264-frame

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

@667bdrm 667bdrm pinned this issue Mar 14, 2023
@667bdrm 667bdrm unpinned this issue Mar 14, 2023
@fogleman
Copy link

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/

@anktx
Copy link

anktx commented Mar 17, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants