When songs have to be transcoded, they get paused as transcoding occurs multiple times
Opened this issue · 3 comments
When transcoding a file (say from mpc), jamstash will usually pause mid-way through the song, buffering. After the song continues, pauses will become increasingly longer and more frequent.
Inspecting the server where subsonic is running, I see that the song is being transcoded again during the pause (which explains why the buffering time gets longer as the song moves on).
I'm not sure if this is a problem Jamstash can work around. AFAICT, subsonic does not provide a way to tell ffmpeg "start transcoding from time X". Perhaps jamstash could cache the whole song while it is played?
Hi, thanks for filing the issue!
I think I have the same problem but I could not tell if it was due to some setup or due to Jamstash itself, so I'm not sure yet how to address this problem. The thing is that we're using a third-party library, jplayer
to play the songs and handle caching etc. I'll have to see if what you're suggesting can be done using jplayer
.
I now see that subsonic sets the following header:
Expires: Thu, 01 Jan 1970 00:00:00 GMT
I suppose that may prevent jplayer from caching (a quick google suggests it does so by default).
There is a preload
option in jPlayer.
http://jplayer.org/latest/developer-guide/#jPlayer-option-preload
The other thing we can look at is having 2 jPlayer instances, one for the current playing song and another for the next song. I've tried to implement it before, without much luck, to add gapless playback. This could also be used to cache songs.
https://groups.google.com/forum/#!topic/jplayer/ceZ_HbS2ico