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

MP3: Support mp3 for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc. #296

Closed
13 of 14 tasks
winlinvip opened this issue May 15, 2015 · 2 comments · Fixed by #3333
Closed
13 of 14 tasks

MP3: Support mp3 for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc. #296

winlinvip opened this issue May 15, 2015 · 2 comments · Fixed by #3333
Assignees
Labels
Enhancement Improvement or enhancement. Feature It's a new feature. TransByAI Translated by AI/GPT.
Milestone

Comments

@winlinvip
Copy link
Member

winlinvip commented May 15, 2015

SRS 3/4 supports MP3 over RTMP/HTTP-FLV/HTTP-TS, however there is some bugs need to be fixed.

Usage

Start SRS server:

# For RTMP/HTTP-FLV/HLS
./objs/srs -c conf/mp3.conf

# For HTTP-TS
./objs/srs -c conf/mp3.ts.conf

# For HTTP-MP3
./objs/srs -c conf/mp3.http.conf

# For RTMP(MP3) to WebRTC
./objs/srs -c conf/mp3.rtc.conf

Publish RTMP stream with mp3 audio:

ffmpeg -stream_loop -1  -re -i doc/source.flv -vcodec copy -acodec libmp3lame \
    -f flv rtmp://localhost/live/livestream

Play live stream:

  • RTMP by VLC or ffplay: rtmp://localhost/live/livestream
  • HTTP-FLV by VLC, ffplay or H5(srs-player): http://localhost:8080/live/livestream.flv
  • HTTP-MP3 by VLC, ffplay or H5(srs-player): http://localhost:8080/live/livestream.mp3
  • HTTP-TS by VLC, ffplay or H5(srs-player): http://localhost:8080/live/livestream.ts
  • HLS by VLC, ffplay or H5(srs-player): http://localhost:8080/live/livestream.m3u8
  • Covert RTMP(MP3) to WebRTC, play by H5(srs-player): webrtc://localhost/live/livestream

Status

I tested the ability for MP3 over serval protocols, found that some is ok but others fail, and listed the test result bellow.

Note: There is a bug for playing HTTP-TS with mp3 audio by H5, see mpegts.js #83

midoks pushed a commit to midoks/srs that referenced this issue Apr 1, 2017
@winlinvip

This comment was marked as outdated.

@winlinvip winlinvip self-assigned this Aug 26, 2021
@radiorz

This comment was marked as outdated.

@winlinvip winlinvip added this to the 3.0 milestone Sep 4, 2021
@winlinvip winlinvip changed the title 支持mp3音频编码 MP3: Support mp3 codec for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc. 支持MP3编码。 Dec 24, 2022
@winlinvip winlinvip changed the title MP3: Support mp3 codec for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc. 支持MP3编码。 MP3: Support mp3 for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc. 支持MP3编码 Dec 24, 2022
@winlinvip winlinvip changed the title MP3: Support mp3 for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc. 支持MP3编码 MP3: Support mp3 for RTMP/HLS/FLV/TS/HLS etc. 支持MP3编码 Dec 24, 2022
@winlinvip winlinvip reopened this Dec 24, 2022
@winlinvip winlinvip added Enhancement Improvement or enhancement. Feature It's a new feature. labels Dec 24, 2022
@winlinvip winlinvip modified the milestones: 3.0, 5.0 Dec 24, 2022
@winlinvip winlinvip changed the title MP3: Support mp3 for RTMP/HLS/FLV/TS/HLS etc. 支持MP3编码 MP3: Support mp3 for RTMP/HLS/HTTP-FLV/HTTP-TS/HLS etc. Dec 24, 2022
winlinvip added a commit to winlinvip/srs that referenced this issue Dec 24, 2022
1. Refresh HLS audio codec if changed in stream.
2. Refresh TS audio codec if changed in stream.
3. Fix mp3 demux bug in SrsFormat::audio_mp3_demux.
4. Use 3(MPEG1) not 4(MPEG2) as PMT stream type, follow FFmpeg.
@winlinvip winlinvip linked a pull request Dec 24, 2022 that will close this issue
winlinvip added a commit that referenced this issue Dec 25, 2022
* MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296)

1. Refresh HLS audio codec if changed in stream.
2. Refresh TS audio codec if changed in stream.
3. Fix mp3 demux bug in SrsFormat::audio_mp3_demux.
4. Use 3(MPEG1) not 4(MPEG2) as PMT stream type, follow FFmpeg.
5. MP3: Update utest for mp3 sample parsing.
6. MP3: Ignore empty frame sample.
7. UTest: Fix utest failed, do not copy files.
winlinvip added a commit that referenced this issue Dec 25, 2022
1. MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296) (#3333)
winlinvip added a commit that referenced this issue Dec 25, 2022
1. MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296) (#3333)
2. MP3: Add config examples for MP3. #296
3. Script: Refine GitHub actions.
winlinvip added a commit that referenced this issue Dec 25, 2022
1. MP3: Fix bug for TS or HLS with mp3 codec. v4.0.269 (#296) (#3333)
2. MP3: Add config examples for MP3. #296
3. Script: Refine GitHub actions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement or enhancement. Feature It's a new feature. TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants