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

Add support for transcode audio file to PCM format #10321

Merged
merged 3 commits into from
Oct 6, 2023

Conversation

feilongfl
Copy link
Contributor

Support transcoding audio to PCM format; this allows the client to play directly through the I2S bus without decoding. This feature is particularly useful when playing with MCUs.

Changes

Add support for transcode audio file to PCM format

  1. set file ext name to pcm when audiocodec is pcm_*
  2. add pcm params for ffmpegs

@nyanmisaka
Copy link
Member

@feilongfl In which client have you tested this?

@feilongfl
Copy link
Contributor Author

feilongfl commented Oct 3, 2023

I test audio both on linux and a MCU platform,Jellyfin is running in linux

linux

I couldn't find a direct method to test PCM music on Linux,
so I used the following command to convert PCM to MP3 and then listened to it:

wget -O wget.pcm http://192.168.10.109:8096/Audio/84f7cdda408d432361c29d6bda9cbc27/universal?Container=pcm&TranscodingContainer=pcm&AudioCodec=pcm_s16le&audioBitRate=16000&api_key=d1e79804ea3b4215aecfc7d9a2043e23
ffmpeg -y -f s16le -ac 2 -ar 16000 -acodec pcm_s16le -i wget.pcm mp3.mp3
mplayer mp3.mp3

MCU platform

I'm submitting this PR primarily for the following repository:
https://github.com/feilongfl/aipi-eyes-s1-jellyfin-demo

It's in Chinese, but based on your github profile, I think you can understand it.
This provides a method to play Jellyfin audio on an MCU device.

Test Video Here: https://www.bilibili.com/video/BV1j94y1h7kn

There are some noises on the MCU platform in video,
which are caused by the MCU's network communication processing.

There is no problem with the converted sound using ffmpeg on linux.

@nyanmisaka

Copy link
Member

@nyanmisaka nyanmisaka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Co-authored-by: Bond-009 <bond.009@outlook.com>
@Bond-009 Bond-009 merged commit 1141883 into jellyfin:master Oct 6, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants