Ampache flac transcoding problem
Hi, Something goes wrong when Ampache is set up to transcode flac (downsample) to mp3. The same stream will be requested (and sent) 4 times and stream is corrupted. It looks like a handshake problem. It is not a delay problem, since I modified Ampache to send mp3 only when transcoding was complete. That does not solve the problem. Just Player 3.37. Android 4.0.2
Comments (3)
-
-
repo owner えーと、この問題としてまずAndroid2.3以前のMediaPlayerではURLの拡張子にmp3がついていないので再生をキャンセルするという仕様に問題がありました。 これは別の言い方をすると、たとえデータがMP3であっても拡張子がMP3でなければ再生してくれないということです。だからAmpacheのようにFlacをMP3に変換するような仕組みの場合URLがMP3のままなので再生されません。 そこで、今年の頭に暫定的な対応として、Flacの拡張子の部分をMP3に置き換えるように修正をしました。これによって再生ができるようになったことを確認しています。 しかし、そもそもURLに拡張子がついていないものを生成する場合はこれはできません。たとえば、OwnCloudなんかはURLに拡張子がついていません、Ampacheのバージョンによってはつけないものもあるかもしれないです。 あと、Andorid2.3以外の端末でも再生をキャンセルする仕様で実装しているものもあるかもしれないです。
あと、考えられるケースとして、ContentLengthの違いです、AmpacheはTranscodeする前のサイズをContentLengthにいれているようです、Lenghtが違うと再生をしてくれないデバイスもありえます。
--- translate in english
On this issue To occur will AndroidOS2.3 below. Extension is because not play MediaPlayer the URL is not a ". mp3" in AndoidOS2.3 following reason.
Once again, it will be canceled and not play. In other words, MediaPlayer is to determine whether or not to play in extension.
Ampache will be able to be converted to MP3 Transcode by the Flac, but the path of the URL remains. Flac. So it does not play.
The head of this year, it will be a temporary fix, but it has implemented a process to replace the MP3 when compulsory extension is not MP3. It has been confirmed that I was able to play by this.
However, this would not fix enough. Maybe there is a case that does not play in devices other than 2.3, and you can not avoid this in Ampache to generate the URL in the first place have no extension.
Then as in other cases, there will be problems in the ContentLength Ampache generated. It does not seem to correctly calculate the size of the file when you Transcode. There is also a device that this is not an issue in particular, but there might be some device also be a problem.
-
I have the same issue using the ampache transcoding to downsample an mp3. I'm using the latest ampache from github master. The problem seems to be the content-range header in the http-request. Ampache debug output:
(play) -> Bad client behaviour. Content-Range header received, which we cannot fulfill due to transcoding
Switching to http-client in the advanced settings of JustPlayer solved the problem for me.
- Log in to comment
Ampache can be configured to transcode files on demand (ie. FLAC to MP3). JUSTPLAYER can't read those files properly.
In Ampache logs, it seems that JUSTPLAYER closes the connection too early.
JUSTPLAYER sends a Range header in Http Request to Ampache server. (Related to the position of the progressbar in the UI, we wan't to get the media file at the position of the progressbar).
But, when transcoding is enabled, Ampache has no other choice than replying with a full response (HTTP/200). Content-Length and Content-Range header won't be set.
JUSTPLAYER seems to have trouble with this situation, requesting a partial content and reading a full HTTP response.
Here is Ampache LOG when starting a FLAC file with MP3 transcoding configured. The same song is working on Ampache official client.
See Stream ended at 279131, representing only a few seconds of music.