question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Solved]: No Audio or no Eventvideos

See original GitHub issue

UPDATE: 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:closed
  • Created 2 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
WorthyAttemptcommented, Jan 4, 2022

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.

0reactions
Larosencommented, Feb 10, 2022

I have now the following output arguments: record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac I am gonna report back if the audio is working as soon as possible. You are right with the defined values at camera level. Due to the C800 which is a H265 Stream and the NC800 which is H264 I am quite unsure what needs to be global and what is local with more H264 cameras on the way I am probably going to define the H264 as global arguments

Can you please update if this resolved your issue?

Issue is solved, thanks to you and the new config is now attached at the origial posting. Thank you very much for the help 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix no sound and audio issues on Windows 10 - YouTube
This video shows you how to fix no audio or sound issues on Windows 10. Sound Issues which can be fixed in Windows...
Read more >
Sound Is Missing or Not Working on Windows 11 FIX [2022]
No Audio on Computer; Sound Is Missing or Not Working on Windows 11 FIX [2022] Windows 11 users complain about repeated sound issues....
Read more >
How To FIX No Sound and Audio Problems on Windows 10
This video will also cover the solutions for the problem that you have no sound or audio coming out of your devices like...
Read more >
No audio when watching downloaded events - Wyze Forum
When I download and play back the event, there is no sound. ... All three Event Videos produced sound when streamed in the...
Read more >
Audio: Predictions for 2023 - ExchangeWire.com
Audio has experienced rampant growth in recent years and shows no signs of slowing down. Over the last year, 11% of smartphone users...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found