h264 passthrough hikvision audio

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

h264 passthrough hikvision audio

Post by Pedulla »

Hi ZM'rs,
Anyone figure out what ffmpeg options are needed to capture audio in the h264 passthrough of Hikvision 2dc2xx2 cams?

I stabilized the video recording by using: allowed_media_types=video

The other Important thing I discovered along the way is that it is critical the cameras dimension match those put in the source tab.... seems obvious but easily overlooked.


I'm running:
ZM1.32.2, UB18.04, LAMP, local spinners for storage.
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: h264 passthrough hikvision audio

Post by Pedulla »

okay, is anybody with any camera capturing audio with H264 passthrough?

[Edit] on play back of course... There is no audio on live monitor.
tra
Posts: 19
Joined: Tue Jan 10, 2017 10:56 am

Re: h264 passthrough hikvision audio

Post by tra »

I have one camera audio works fine. It is Reolink RLC-410 and it outputs aac audio.
According to ffmpeg audio is: Stream #0:1: Audio: aac, 16000 Hz, mono, fltp

But I have several cheap Chinese brand HJT cameras.
According to ffmpeg audio is: Stream #0:1: Audio: pcm_mulaw, 8000 Hz, mono, s16, 64 kb/s
And I can not get audio to work with zoneminder by these cameras. From log I can see error message (with these cameras):
[could not open codec (-22) (Invalid argument)]

I would appreciate a lot if somebody could give me some ideas how to get these cameras also works with audio. They should work because audio is working fine with pure ffmpeg.

I have wondered that in other thread here.

--
- TRa
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: h264 passthrough hikvision audio

Post by iconnor »

The best way would be to give Isaac access to the camera in question.
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: h264 passthrough hikvision audio

Post by Pedulla »

Status Update:

When capturing directly with this

Code: Select all

ffmpeg -i rtsp://user:password@192.0.0.99:554/Streaming/Channels/101 -c:v copy -c:a aac foo.mp4

Code: Select all

title           : Media Presentation
    encoder         : Lavf57.83.100
    Stream #0:0: Video: h264 (High) (avc1 / 0x31637661), yuv420p(progressive), 1920x1080, q=2-31, 15 fps, 30 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac (LC) (mp4a / 0x6134706D), 8000 Hz, mono, fltp, 48 kb/s
foo.mp4 has audio when played back.

I've upgraded to zoneminder_1.32.2_20181125102833-bionic_amd64.deb
I've tried putting the -c:v copy -c:a aac options in the storage tab (encoder parameters) and the source tab ffmpeg options.
Still no audio in the recorded event.

All of the Hikvision cameras, audio capable, exhibit this issue. (Chinese and Western Region)

Any ideas?
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: h264 passthrough hikvision audio

Post by Pedulla »

Further Update:

Getting closer....

In the Options field on the Source tab, I replaced the

Code: Select all

allowed_media_types=video

with

Code: Select all

-ar 8000

It started recording audio, HOWEVER, the recorded video was all jacked up and didn't quit seem to be in sync with the video.

"Jacked up" means strange compression artifacts and the lower part of the image just melting away.
For some reason, in the 1.32 series of ZM, the Hikvision cameras do not work at their configured frame rate unless allowed_media... is used as above. And, the live view and recorded events are jacked up. (Note: didn't need the option in 1.30.4)

So progress, but not a solution yet.

I couldn't figure out how to stack options; using a comma to separate did not behave as expected.

Is there maybe something wrong with the parser for multiple options?
Can the streams audio sample rate be tested and made part of the call?
Is there some more debug information I can provide?
Pedulla
Posts: 167
Joined: Thu Nov 27, 2014 11:16 am
Location: Portland, Or

Re: h264 passthrough hikvision audio

Post by Pedulla »

Update - Initial Success

Upgraded to zoneminder_1.32.2~20181129142911-bionic_amd64.deb (soon to be known as 1.32.3 I think) from the master repo.

I am getting audio from my Hikvision cams now w/o any ffmpeg parameters in the source tab or storage tab.

I also removed the values from the Max FPS and Alarm Max FPS, which I believe were contributing/causing the jack up images, and rebooted each camera.

Woo Hoo!
Thanks iconnor

I've got about 30 more cams to reconfigure and will report back with those results.
thefuzz4
Posts: 28
Joined: Sat Mar 01, 2014 5:43 am

Re: h264 passthrough hikvision audio

Post by thefuzz4 »

What kind of mic are you using for these cams? I've got a few hikvisions in my system that I'd like to add a mic to. But since I'm using POE I've noticed that you can't use a powered mic and instead need a passive one. Thanks.
Post Reply