bluenviron / mediamtx

Ready-to-use SRT / WebRTC / RTSP / RTMP / LL-HLS media server and media proxy that allows to read, publish, proxy, record and playback video and audio streams.
MIT License
10.69k stars 1.39k forks source link

fix single aac file rtmp publish error. #3414

Closed suzp1984 closed 2 weeks ago

suzp1984 commented 4 weeks ago

Which version are you using?

current main branch.

Which operating system are you using?

Describe the issue

when I publish an aac file by ffmpeg to mediamtx, I met an error.

2024/06/01 17:10:55 INF [RTMP] [conn [::1]:57689] closed: not enough bits

The root cause is the mediamtx want to parse an audio message with empty payload.

Describe how to replicate the issue

  1. start the server: ./mediamtx
  2. publish an aac file with ffmpeg: ffmpeg -stream_loop -1 -re -i music.aac -c copy -f flv -y rtmp://localhost/live/test
  3. check the mediamtx log: INF [RTMP] [conn [::1]:57689] closed: not enough bits and ffmpeg cmd exit with error.

Did you attach the server logs?

yes

MediaMTX logs ``` 2024/06/01 17:10:53 INF MediaMTX v0.0.0 2024/06/01 17:10:53 INF configuration loaded from /Users/jacobsu/hack/media/mediamtx/mediamtx.yml 2024/06/01 17:10:53 INF [RTSP] listener opened on :8554 (TCP), :8000 (UDP/RTP), :8001 (UDP/RTCP) 2024/06/01 17:10:53 INF [RTMP] listener opened on :1935 2024/06/01 17:10:53 INF [HLS] listener opened on :8888 2024/06/01 17:10:53 INF [WebRTC] listener opened on :8889 (HTTP), :8189 (ICE/UDP) 2024/06/01 17:10:53 INF [SRT] listener opened on :8890 (UDP) 2024/06/01 17:10:55 INF [RTMP] [conn [::1]:57689] opened 2024/06/01 17:10:55 INF [RTMP] [conn [::1]:57689] closed: not enough bits ```

Did you attach a network dump?

no

codecov[bot] commented 2 weeks ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 56.24%. Comparing base (16d0bb7) to head (236209e). Report is 12 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3414 +/- ## ========================================== + Coverage 55.68% 56.24% +0.56% ========================================== Files 191 190 -1 Lines 18897 19078 +181 ========================================== + Hits 10522 10731 +209 + Misses 7570 7523 -47 - Partials 805 824 +19 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

aler9 commented 2 weeks ago

i added tests and merged, thanks!

github-actions[bot] commented 2 weeks ago

This issue is mentioned in release v1.8.3 🚀 Check out the entire changelog by clicking here