spl0k / supysonic

Supysonic is a Python implementation of the Subsonic server API.
https://supysonic.readthedocs.io
GNU Affero General Public License v3.0
260 stars 57 forks source link

Transcoding issue from ogg to mp3 #172

Closed anayrat closed 4 years ago

anayrat commented 4 years ago

Hello,

Thanks for your tool it is very helpful!

I have an issue with ogg transcoding. It is a little bit weird, it seems supysonic do not detect when it have to transcode from ogg to mp3. I have an album with track in ogg format, and for some tracks it is able to transcode and other track it does nothing. When it can successfully convert ogg to mp3, I have a line Transcoding track... in logs. But for track where transcoding seems to failed I have no messages in logs even with DEBUG log_level.

Here is my transcoding configuration (I removed quit options):

transcoder_mp3_mp3 = lame --quiet --mp3input -b %outrate %srcpath -
transcoder = ffmpeg -i %srcpath -ab %outratek -v 0 -f %outfmt -
decoder_mp3 = mpg123 --quiet -w - %srcpath
decoder_ogg = oggdec  -o - %srcpath
decoder_flac = flac -d -c -s %srcpath
encoder_mp3 = lame -b %outrate - -
encoder_ogg = oggenc2  -M %outrate -

I think supysonic should provide more logging options to troubleshoot this kind of issue. Any help is welcome :)

anayrat commented 4 years ago

Ok, after investigation, I found existing but empty files in my cache. After cleaning everything where fine. Maybe you should add a check if the file is empty? https://github.com/spl0k/supysonic/blob/master/supysonic/api/media.py#L121

spl0k commented 4 years ago

Do subsequent plays of the same track with the same transcoding parameters work? It would be interesting to know why you have empty cached files in the first place...

anayrat commented 4 years ago

Do subsequent plays of the same track with the same transcoding parameters work? Yes

It would be interesting to know why you have empty cached files in the first place...

I think I did not have the tools to transcode. Since then the issue did not occur again. If it happen again I will reopen this issue ;)