Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Frigate issue due to use of ffmpeg v4 on arm64 #179

Closed
jherby2k opened this issue Jan 17, 2023 · 12 comments
Closed

Frigate issue due to use of ffmpeg v4 on arm64 #179

jherby2k opened this issue Jan 17, 2023 · 12 comments
Labels
bug Something isn't working

Comments

@jherby2k
Copy link

jherby2k commented Jan 17, 2023

Bear with me as i'm using go2rtc via the latest frigate beta (-4) and i'm struggling to get debug logging to show up...

I'm trying to transcode audio from my camera from a-law to opus and/or aac.

This appears to crash go2rtc with exit code 1:

  streams:
    driveway: ffmpeg:rtsp://192.168.2.206:80/ch0_0.264#video=copy#audio=opus

This doesn't work either but at least lets me use the stream without opus:

  streams:
    driveway:
      - rtsp://192.168.2.206:80/ch0_0.264
      - ffmpeg:driveway#audio=opus

same behavior with AAC. This is on a raspberry Pi 4 tested with and without HW decode acceleration in ffmpeg.

2023-01-17 17:11:23.815818233 17:11:23.815 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:driveway#audio=aac#audio=opus

@jherby2k jherby2k changed the title Transcoding issues Transcoding audio issues Jan 17, 2023
@AlexxIT AlexxIT added the question Further information is requested label Jan 17, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Jan 17, 2023

You need to increase log level for exec to trace. And check details there

@jherby2k
Copy link
Author

jherby2k commented Jan 17, 2023

OK got my logs working.

When configured the first way, i see this:

2023-01-17 18:57:56.695387784  18:57:56.694 DBG [exec] run url="exec:ffmpeg -hide_banner -allowed_media_types audio -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i rtsp://192.168.2.206:80/ch0_0.264 -vn -map 0:a:0? -c:a:0 aac -map 0:a:0? -c:a:1 libopus -ar:a:1 48000 -ac:a:1 2 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://localhost:8554/b008b7886d713602c3dd78c244faafa5"
2023-01-17 18:57:57.207692182  [rtsp @ 0x557cd271b0] Unable to open RTSP for listening
2023-01-17 18:57:57.207816125  rtsp://192.168.2.206:80/ch0_0.264: Cannot assign requested address
2023-01-17 18:57:57.307795693  18:57:57.306 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:rtsp://192.168.2.206:80/ch0_0.264#audio=aac#audio=opus
2023-01-17 18:57:57.307813434  18:57:57.307 DBG [exec] run url="exec:ffmpeg -hide_banner -allowed_media_types audio -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i rtsp://192.168.2.206:80/ch0_0.264 -vn -map 0:a:0? -c:a:0 aac -map 0:a:0? -c:a:1 libopus -ar:a:1 48000 -ac:a:1 2 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://localhost:8554/b008b7886d713602c3dd78c244faafa5"
2023-01-17 18:57:57.701333959  [rtsp @ 0x5575d381b0] Unable to open RTSP for listening
2023-01-17 18:57:57.701456606  rtsp://192.168.2.206:80/ch0_0.264: Cannot assign requested address
2023-01-17 18:57:57.716437616  18:57:57.716 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:rtsp://192.168.2.206:80/ch0_0.264#audio=aac#audio=opus
2023-01-17 18:57:57.716724150  18:57:57.716 WRN [rtsp] error="source 0 error: exec: exit status 1" stream=driveway

when configured in the latter way, i get something a bit different:

2023-01-17 18:55:01.650929231  18:55:01.650 DBG [exec] run url="exec:ffmpeg -hide_banner -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i rtsp://localhost:8554/driveway?audio -vn -map 0:a:0? -c:a:0 aac -map 0:a:0? -c:a:1 libopus -ar:a:1 48000 -ac:a:1 2 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://localhost:8554/b334914056eb823bfaa66de47fbb1272"
2023-01-17 18:55:02.090995958  [rtsp @ 0x55a5a281a0] Unable to open RTSP for listening
2023-01-17 18:55:02.091008699  rtsp://localhost:8554/driveway?audio: Address already in use
2023-01-17 18:55:02.185832196  18:55:02.185 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:driveway#audio=aac#audio=opus
2023-01-17 18:56:04.194329251  18:56:04.193 DBG [exec] run url="exec:ffmpeg -hide_banner -fflags nobuffer -flags low_delay -timeout 5000000 -user_agent go2rtc/ffmpeg -rtsp_transport tcp -i rtsp://localhost:8554/driveway?audio -vn -map 0:a:0? -c:a:0 aac -map 0:a:0? -c:a:1 libopus -ar:a:1 48000 -ac:a:1 2 -user_agent ffmpeg/go2rtc -rtsp_transport tcp -f rtsp rtsp://localhost:8554/b334914056eb823bfaa66de47fbb1272"
2023-01-17 18:56:04.585998881  [rtsp @ 0x55acd121a0] Unable to open RTSP for listening
2023-01-17 18:56:04.586119213  rtsp://localhost:8554/driveway?audio: Address already in use
2023-01-17 18:56:04.605556566  18:56:04.605 ERR github.com/AlexxIT/go2rtc/cmd/streams/producer.go:52 > error="exec: exit status 1" url=ffmpeg:driveway#audio=aac#audio=opus

@jherby2k
Copy link
Author

Confirmed this is a Frigate issue due to use of ffmpeg v4 on arm64. They will fix in the next beta.

@AlexxIT
Copy link
Owner

AlexxIT commented Jan 18, 2023

"Unable to open RTSP for listening" maybe because your camera support only UDP protocol. So you need to use network mode host in container with ffmpeg.

Go2rtc support this cameras only via ffmpeg source

@NickM-27
Copy link
Contributor

We know the issue already, due to using ffmpeg4 on arm devices 👍

@danielkucera
Copy link

This is the solution:
blakeblackshear/frigate#5137 (comment)

@AlexxIT , would it be possible to implement some version detection for ffmpeg and adjust the parameters accordingly?

@NickM-27
Copy link
Contributor

NickM-27 commented Jun 6, 2023

There's no need to implement version detection imo the user is able to customize the args to match the version of ffmpeg they are using

@danielkucera
Copy link

That is true but from the error message it is really not obvious that the problem is wrong ffmpeg command.

@AlexxIT
Copy link
Owner

AlexxIT commented Jun 7, 2023

@NickM-27 Any reason to use outdated ffmpeg?

@NickM-27
Copy link
Contributor

NickM-27 commented Jun 7, 2023

@AlexxIT because hardware acceleration on the pi doesn't work with newer ffmpeg on many setups, so we use older ffmpeg for the arm build and newer for amd64.

blakeblackshear/frigate#3780

@AlexxIT AlexxIT changed the title Transcoding audio issues Frigate issue due to use of ffmpeg v4 on arm64 Jun 7, 2023
@AlexxIT AlexxIT added bug Something isn't working and removed question Further information is requested labels Jun 7, 2023
@AlexxIT AlexxIT reopened this Jun 7, 2023
@NickM-27
Copy link
Contributor

NickM-27 commented Jun 7, 2023

To be clear as far as Frigate goes this has been fixed https://github.com/blakeblackshear/frigate/blob/dev/docker/rootfs/usr/local/go2rtc/create_config.py#L73-L82

@AlexxIT
Copy link
Owner

AlexxIT commented May 28, 2024

FFmpeg v4 will not be supported. Minimum v5 version

@AlexxIT AlexxIT closed this as not planned Won't fix, can't repro, duplicate, stale May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants