roflcoopter / viseron

Self-hosted, local only NVR and AI Computer Vision software. With features such as object detection, motion detection, face recognition and more, it gives you the power to keep an eye on your home, office or any other place you want to monitor.
MIT License
1.51k stars 155 forks source link

audio_codec setting #629

Closed ceewanna closed 12 months ago

ceewanna commented 1 year ago

When I tried setting the parameter under recorder as follows. audio_codec: null

I got this error. [2023-07-08 14:39:20] [ERROR ] [viseron.components] - Error validating config for domain camera and component ffmpeg: expected str for dictionary value @ data['ch1_door']['recorder']['audio_codec']. Got None

However, if I set it as follows. audio_codec: 'null'

The above error didn't turn up but there was an error on ffmpeg command.

[2023-07-08 14:38:09] [ERROR ] [viseron.components.ffmpeg.recorder.ch1_door] - Failed to concatenate segments: Command '['ffmpeg', '-hide_banner', '-loglevel', 'error', '-y', '-protocol_whitelist', 'file,pipe', '-f', 'concat', '-safe', '0', '-i', '-', '-c:v', 'copy', '-c:a', 'null', '-movflags', '+faststart', '/recordings/ch1_door/2023-07-08/143741.mp4']' returned non-zero exit status 1.

roflcoopter commented 1 year ago

Hmm audio_codec: null should definitely work. Will investigate.

roflcoopter commented 12 months ago

audio_codec can now be null in the dev branch, will create a release later. However, if your end goal is to not have audio in the recorded videos, a better option is to set audio_codec: null directly under the camera.

This way Viseron will believe that the stream has no audio and wont save it to disk in the first place. By setting audio_codec: null under recorder, Viseron will safe the audio to disk but then remove it when concatenating the segments to form a full video.

ceewanna commented 12 months ago

Actually, I didn't want to mute the cameras but it seems there are always invalid PTS's occurring when I play back the videos from those camera so I want to explore if turning off audio will get rid of those mismatches.

Thanks for your guidance.