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

[HELP] playing raw PCM audio #205

Open
biGdada opened this issue Oct 29, 2022 · 12 comments
Open

[HELP] playing raw PCM audio #205

biGdada opened this issue Oct 29, 2022 · 12 comments

Comments

@biGdada
Copy link

biGdada commented Oct 29, 2022

hi.
can this plugin play raw PCM audio (16 bit little endian, 44100, stereo)?

ffmpeg from command line can read this file with the following parameters:
/usr/bin/ffmpeg -sample_rate 44100 -f s16le -ac 2

if it is possible, what #KODIPROP lines should be in strm file?
thanks.

@phunkyfish
Copy link
Collaborator

Does kodi play this correctly from the strm file? I.e. with no KODIPROPS?

@biGdada
Copy link
Author

biGdada commented Oct 30, 2022

i havent checked it with strm file, but it doesnt play when i choose it from the GUI.
thats exactly the reason i'm trying to use ffmpegdirect do play it.
AFAIK, kodis built-in player cant play raw pcm because the stream lacks the relevant headers.
BUT, ffmpeg (the command line version) can read the file and convert it if i provide the command line parameters describing the format (-sample_rate 44100 -f s16le -ac 2). i was hoping there is a way to do the same with the plugin, considering the fact that it is based on ffmpeg.

@phunkyfish
Copy link
Collaborator

You should be able to pass arguments to ffmpeg using a | after the URL.

@biGdada
Copy link
Author

biGdada commented Oct 31, 2022

its not a url, its a local file(a local pipe, to be exact)
tried it, and this is the error i'm getting :
ERROR <general>: AddOnLog: inputstream.ffmpegdirect: OpenWithCURL - error probing input format, /storage/.kodi/userdata/dockercdb/shairport-sync/tmp/shairport-sync-audio | -sample_rate 44100 -f s16le -ac 2
am i missing something?

@biGdada
Copy link
Author

biGdada commented Oct 31, 2022

this is the contents of the strm file:

#KODIPROP:inputstream=inputstream.ffmpegdirect
/storage/.kodi/userdata/dockercdb/shairport-sync/tmp/shairport-sync-audio | -sample_rate 44100 -f s16le -ac 2

@phunkyfish
Copy link
Collaborator

phunkyfish commented Oct 31, 2022

It still needs to be a URL so must follow URL syntax, so like:

#KODIPROP:inputstream=inputstream.ffmpegdirect 
/storage/.kodi/userdata/dockercdb/shairport-sync/tmp/shairport-sync-audio|sample_rate=44100&f=s16le&ac=2

Assuming these are valid ffmpeg options of course.

@phunkyfish
Copy link
Collaborator

I’m not saying this will work, but it is how you can pass ffmpeg options to the addon.

@biGdada
Copy link
Author

biGdada commented Nov 1, 2022

it didnt work.
is there a way to enable logging to see what parameters are being passed to ffmpeg?

@phunkyfish
Copy link
Collaborator

You can enable debug logging in Kodi and there is also an option to enable ffmpeg logging in the addon settings

All of the supported options are available here: https://ffmpeg.org/ffmpeg.html. I don’t see sample_rate though which is strange.

Is there a MIME type for audio stream? Maybe that would work.

@biGdada
Copy link
Author

biGdada commented Nov 2, 2022

i've enabled debug logging and also ffmpeg logging in the addon but i cant see in the logs what are the exact parameters that are being passed to ffmpeg. i also tried to define the mime type, seems like its being ignored (mimetype=audio/wav;codec=pcm;rate=16000)

@phunkyfish
Copy link
Collaborator

phunkyfish commented Nov 2, 2022

As in:

#KODIPROP:mimetype=audio/wav;codec=pcm;rate=16000

@biGdada
Copy link
Author

biGdada commented Nov 2, 2022

exactly.
the .strm file:
#KODIPROP:inputstream=inputstream.ffmpegdirect
#KODIPROP:mimetype=audio/wav;codec=pcm;rate=16000
/storage/.kodi/userdata/dockercdb/shairport-sync/tmp/shairport-sync-audio

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

No branches or pull requests

2 participants