[Solved]: No Audio or no Eventvideos
See original GitHub issueUPDATE: Solved Config attached, issue is solved
Describe the problem you are having
_I have my first H264 camera (called Sauna) and therefore I could not use the configuration from the previous H265 camera. Everything worked fine (except for some spam in the log) until I noticed that the event videos had no sound. The camera streams on the main stream H264 4k+AAC Audio. On the substream it is currently set to video only with no sound.
Unfortunately, adding the default Output_Args and replacing -an
with -c:a aac
does not work.
That’s when the struggle started.
With the current settings 30 seconds recordings are only 1 second long and consist of very few frames. One from the beginning of the event, one in the middle and one as the person leaves the scene again. There is now also audio in this 1 Second Videos , but not usable, due to the duration and compression.
What do I need to do to get this H264 stream with AAC audio to process and save the clips correctly?_
Version
0.9.4-26AE608
Frigate config file
host: 10.20.60.79
port: 1883
user: censored
password: censored
detectors:
coral:
type: edgetpu
device: usb
cameras:
Summer_patio:
rtmp:
enabled: False
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
output_args:
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c copy -tag:v hvc1 -c:a aac
rtmp: -c copy -f flv -tag:v hvc1
detect: -f rawvideo -pix_fmt yuv420p
inputs:
- path: rtsp://censored:censored@IP:554/Streaming/Channels/102
roles:
- detect
- path: rtsp://censored:censored@IP:554/Streaming/Channels/101
roles:
- record
- rtmp
detect:
width: 640
height: 480
fps: 4
objects:
track:
- person
- backpack
- handbag
- cell phone
motion:
mask:
- 640,177,640,0,531,0,429,0,455,52
- 435,382,531,480,553,426,495,357,441,358
- 266,70,250,313,167,353,155,83
mqtt:
enabled: True
timestamp: True
bounding_box: True
crop: True
height: 270
quality: 70
Sauna:
rtmp:
enabled: False
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
output_args:
# Optional: output args for detect streams (default: shown below)
detect: -f rawvideo -pix_fmt yuv420p
# Optional: output args for record streams (default: shown below)
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
# Optional: output args for rtmp streams (default: shown below)
rtmp: -c:v copy -c:a aac -f flv
inputs:
- path: rtsp://censored:censored@IP:556/Streaming/Channels/103
roles:
- detect
- path: rtsp://censored:censored@IP:556/Streaming/Channels/101
roles:
- record
- rtmp
motion:
mask:
- 37,105,501,102,506,47,37,42
- 1920,0,1920,281,1485,313,1109,269,1054,0
- 1072,464,1242,472,1255,341,1082,201
- 1513,958,1724,613,1344,514,1189,563,1099,652,863,850,1184,1080
- 1646,174,1920,217,1920,546,1795,532,1742,551,1698,543,1615,529,1558,446,1563,342
detect:
width: 1920
height: 1080
fps: 5
objects:
track:
- person
- backpack
- handbag
- cat
- cell phone
mqtt:
enabled: True
timestamp: True
bounding_box: True
crop: True
height: 270
quality: 70
Hintereingang:
rtmp:
enabled: False
ffmpeg:
input_args: -avoid_negative_ts make_zero -fflags +genpts+discardcorrupt -rtsp_transport tcp -stimeout 5000000 -use_wallclock_as_timestamps 1
output_args:
# Optional: output args for detect streams (default: shown below)
detect: -f rawvideo -pix_fmt yuv420p
# Optional: output args for record streams (default: shown below)
record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
# Optional: output args for rtmp streams (default: shown below)
rtmp: -c:v copy -c:a aac -f flv
inputs:
- path: rtsp://censored:censored@IP:556/Streaming/Channels/103
roles:
- detect
- path: rtsp://censored:censored@IP:556/Streaming/Channels/101
roles:
- record
- rtmp
detect:
width: 1920
height: 1080
fps: 5
objects:
track:
- person
- backpack
- handbag
- cat
- cell phone
- car
- bycicle
motion:
mask:
- 743,0,1800,0,1781,242,1114,237,553,370,426,571,178,710,0,639,0,469,0,0
mqtt:
enabled: True
timestamp: True
bounding_box: True
crop: True
height: 270
quality: 70
record:
enabled: True
retain_days: 3
events:
retain:
default: 5
Relevant log output
[2021-12-23 16:05:17] ffmpeg.NC-800-1.record_rtmp ERROR : [NULL @ 0x55c5fc3f8c80] Unable to find a suitable output format for 'copy'
[2021-12-23 16:05:17] ffmpeg.NC-800-1.record_rtmp ERROR : copy: Invalid argument
[2021-12-23 16:05:17] watchdog.NC-800-1 INFO : Terminating the existing ffmpeg process...
[2021-12-23 16:05:17] watchdog.NC-800-1 INFO : Waiting for ffmpeg to exit gracefully...
[2021-12-23 16:05:27] ffmpeg.NC-800-1.record_rtmp ERROR : [rtsp @ 0x55f7fcbaad40] DTS discontinuity in stream 1: packet 3 with DTS 52488701389211, packet 4 with DTS 52488701397689
[2021-12-23 16:05:27] ffmpeg.NC-800-1.record_rtmp ERROR : Multiple -c, -codec, -acodec, -vcodec, -scodec or -dcodec options specified for stream 1, only the last option '-c:a aac' will be used.
[...]
FFprobe output from your camera
Frigate stats
Operating system
Synology DS920+ with DSM 7.0.1 and a VMM with HassOS
Install method
HassOS Addon
Coral version
USB
Network connection
Wired
Camera make and model
Annke NC 800
Any other information that may be helpful
Regarding the Output I have tried to remove the copy
argument from record for the NC-800-1 Cam, but then I get this Log:
[2021-12-23 16:11:06] ffmpeg.NC-800-1.record_rtmp ERROR : [h264 @ 0x55d95f27e140] error while decoding MB 218 43, bytestream -28
[2021-12-23 16:11:06] ffmpeg.NC-800-1.record_rtmp ERROR : Output file #0 does not contain any stream
[2021-12-23 16:11:06] watchdog.NC-800-1 INFO : Terminating the existing ffmpeg process...
[2021-12-23 16:11:06] watchdog.NC-800-1 INFO : Waiting for ffmpeg to exit gracefully...
[2021-12-23 16:11:16] ffmpeg.NC-800-1.record_rtmp ERROR : Output file #0 does not contain any stream
[2021-12-23 16:11:16] watchdog.NC-800-1 INFO : Terminating the existing ffmpeg process...
[2021-12-23 16:11:16] watchdog.NC-800-1 INFO : Waiting for ffmpeg to exit gracefully...
[2021-12-23 16:11:26] ffmpeg.NC-800-1.record_rtmp ERROR : Output file #0 does not contain any stream
[2021-12-23 16:11:26] watchdog.NC-800-1 INFO : Terminating the existing ffmpeg process...
[2021-12-23 16:11:26] watchdog.NC-800-1 INFO : Waiting for ffmpeg to exit gracefully...
Issue Analytics
- State:
- Created 2 years ago
- Comments:5
Top GitHub Comments
Try changing record output to read -c:v copy -c:a aac. This was updated in the FAQ section https://docs.frigate.video/faqs, however has not been updated in the config reference file https://docs.frigate.video/configuration/index#full-configuration-reference.
I am by no means an expert at this so could be incorrect, however you also define elements at camera level that a) are default values so could possibly be omitted? and b) can be defined at a global level to reduce repetition and simplify config file.
Issue is solved, thanks to you and the new config is now attached at the origial posting. Thank you very much for the help 😃