View Poll Results: How many people have been able to get Ampache setup?

Voters
297. You may not vote on this poll
  • Yes

    160 53.87%
  • No

    137 46.13%
Page 62 of 88 FirstFirst ... 1252575859606162636465666772 ... LastLast
Results 1,221 to 1,240 of 1750
Like Tree2Likes
  1. #1221  
    Great job mbetter, this has fixed the problems with aacpluenc for Windows in a big way! I've tested the binary and it works fantastic, plus you beat our Grad School programmer to the punch (but he's writing stuff for finals right now, so this was just a side favor).

    For Windows users transcoding for the first time from MP3 to AAC+:

    OK, for sure to get it to work two files will need to be edited using a line editor like Notepad, but for this I recommend Notepad++ which you can Google and acquire for free (I thought about placing a lmgtfy.com tinyurl, but that would be mean). The first is ampache.cfg.php located in the *:\*\htdocs\ampache\cofig folder and song.class.php *:\*\htdocs\ampache\lib\class\ folders respectively, whever you have these placed in Windows for your Ampache server.

    First you will need to enable downsampling and input the transcoding commands in ampache.cfg.php by finding:
    ; Downsample Remote
    ; If this is set to true and access control is on any users who are not
    ; coming from a defined 'network' ACL will be automatically downsampled
    ; regardless of their preferences. Requires access_control to be enabled
    ; DEFAULT: false
    ;downsample_remote = "false"
    And changing it to:

    ; Downsample Remote
    ; If this is set to true and access control is on any users who are not
    ; coming from a defined 'network' ACL will be automatically downsampled
    ; regardless of their preferences. Requires access_control to be enabled
    ; DEFAULT: false
    downsample_remote = "true"
    Remember to remove ; as this indicates which lines are commented out. To comment it in the ; must be removed and Ampache will run the command. Next we need to change the target file for the MP3 to be changed:

    ; List of filetypes to transcode
    transcode_m4a = true
    transcode_m4a_target = mp3
    ;transcode_flac = true
    transcode_flac_target = mp3
    ;transcode_mp3 = false
    transcode_mp3_target = mp3
    ;transcode_ogg = false
    transcode_ogg_target = mp3
    is the default with the applicable commands listed in red. Keep in mind that you can transcode any supported file to any other support file, so if you have a mixed library of music you can run multiple commands to change the input files to ones playable by the Pre/Pixi, in this case AAC+. For simplicity, my codes only have MP3 commands, but this is because my collection is all MP3. Digressing, change this to:

    ; List of filetypes to transcode
    ;transcode_m4a = true
    ;transcode_m4a_target = mp3
    ;transcode_flac = true
    ;transcode_flac_target = mp3
    transcode_mp3 = true
    transcode_mp3_target = m4a
    ;transcode_ogg = false
    ;transcode_ogg_target = mp3
    In this instance I commented out the unused commands. The target I am setting is m4a as an AAC+ is an MPEG-4 file, just not in that container. Finally, the commands need to list which command line encoders to use. What this means is that you would need to specify the commands that would be used to run the encoder in a command line, with the appropriate or desired options. Also you will need to specify what file path Ampache will take to access the encoder. The example of 'transcode_cmd_mp3 = "mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -q 3 -b %SAMPLE% -S - -" ' for instance will require that you A) download and install each encoder and B) specify your file path, so this line would read 'transcode_cmd_mp3 = "*:\*\mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | *:\*\lame --mp3input -q 3 -b %SAMPLE% -S - -" when placed in ampache.cfg.php. So... for us, this means we will need to Google the encoders mp3Splt to provide header info, Lame to change the mp3 into a .wav file, and finally thanks to mbetter's hard labours aacPlusenc (New and Improved) http://markspark.net/slasha/aacplusenc-0.17.1.rar. Our new path will change:

    ; These are the commands that will be run to transcode the file
    transcode_cmd_flac = "flac -dc %FILE% | lame -b %SAMPLE% -S - - "
    transcode_cmd_m4a = "faad -f 2 -w %FILE% | lame -r -b %SAMPLE% -S - -"
    transcode_cmd_mp3 = "mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -q 3 -b %SAMPLE% -S - -"
    transcode_cmd_ogg = "oggsplt -qn %FILE% %OFFSET% %EOF% -o - | oggdec -Q -o - - | lame -S -q 3 -b %SAMPLE% -S - -"
    to

    ; These are the commands that will be run to transcode the file
    ;transcode_cmd_flac = "flac -dc %FILE% | lame -b %SAMPLE% -S - - "
    ;transcode_cmd_m4a = "faad -f 2 -w %FILE% | lame -r -x -b %SAMPLE% -S - -"
    transcode_cmd_mp3 = "mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -S --decode - - | aacplusenc - - %SAMPLE%"
    ;transcode_cmd_ogg = "oggsplt -qn %FILE% %OFFSET% %EOF% -o - | oggdec -Q -o - - | lame -S -q 3 -b %SAMPLE% -S - -"
    The main focus here being the new ' transcode_cmd_mp3 = "mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -S --decode - - | aacplusenc - - %SAMPLE%" '

    Next we need to set the new MIME type in song.class.php:

    The original will read:

    break;
    case 'aac':
    case 'mp4':
    case 'm4a':
    $this->mime = "audio/mp4";
    to

    break;
    case 'aac':
    case 'mp4':
    case 'm4a':
    $this->mime = "audio/aacp";
    Save all this and load your Ampache Web interface as the Administrator, and select the "Admin" menu and chose "Streaming" under the "Server Config" section and modify it to:
    Type of Playback - "Stream"
    Rate Limit - any, but default 8192 should be fine
    Transcode Bitrate - 48
    Transcoding - Always

    Make sure you check "Apply to All"

    A higher bitrate is not supported by aacPlusenc, but this encoder with the AAC+ format provides easily the same quality product as a 96 kbps MP3. For audiophiles who have awesome headsets (looking at you bhack), then for sure a native bitrate is preferable and re-encoding your entire library locally on your computer will suit your needs better as it will produce better quality AAC+ files, but for transcoding on the fly, the sound quality is excellent.

    Hope this helps, many thanks to bjgeiser, mbetter, moumatan, elryon, and the Interwebs for making this possible. I no return you to your regularly scheduled programming, enjoy!!!
  2. #1222  
    Quote Originally Posted by circuitjc View Post
    Ok... why is mplayer in that mix? Is it to encapsulate the file?

    Is that this mplayer?

    Thanks for everything!
    Sorry for being unclear, that's just how I tested the stdin / stdout functionality as I don't have a Windows Ampache setup running. Use the same string that I posted earlier:

    Code:
    transcode_cmd_mp3       = "mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -S --decode - - | aacplusenc - - %SAMPLE%"
  3. #1223  
    Nice work, ihooten.

    One thing you didn't mention is the bitrate issue. From a previous post:
    Now after that we still have two problems.. first off, I was losing the last few seconds of my files because aacPlusEnc doesn't seem to stick too well to the bitrate that you're asking for. The hack to get around this is to open /ampache-root-directory/lib/class/stream.class.php and look for this line:

    Code:
    $sample_ratio = $sample_rate/($song->bitrate/1000);
    Mine was on line 656. Change it to this:

    Code:
    $sample_ratio = ($sample_rate+2)/($song->bitrate/1000);
    This is an ugly hack and not thoroughly tested, it may break any other transcoding you've got going on. If you're having problems with songs not ending properly, try increasing or decreasing that 2 slightly.
    I've since changed the +2 to a +3. Ampache calculating a stream size that is too small is no good as then your song gets chopped off early.

    Now that I've got a build environment set up for aacPlusEnc, I'm working on a prettier solution but you might want to do this for now.
  4. #1224  
    About that, maybe I haven't used it long enough to notice but I haven't experienced the drop of the last parts of the song. But then again, I've only been testing it for a little while so may just not have run accros it yet.
  5. #1225  
    Quote Originally Posted by ihooten View Post
    About that, maybe I haven't used it long enough to notice but I haven't experienced the drop of the last parts of the song. But then again, I've only been testing it for a little while so may just not have run accros it yet.
    I think it's somewhat dependent on both the content and length of the original file. WMP reports bitrates of between 47 and 51/52 kbps with a stream that is nominally 48 kbps.

    If the stream is really 51 and Ampache is using 48, you're going to lose 3 kb per second of the song or 180 kb per minute. So in the worst-case scenario, you lose three and a half seconds per minute. With a five minute long song, this would work out to ~17.6 seconds lost, a not-insignificant amount. 49 kbps and a three minute long song, that's only three and a half seconds which could be all silence.
  6. circuitjc's Avatar
    Posts
    71 Posts
    Global Posts
    78 Global Posts
    #1226  
    Quote Originally Posted by mbetter View Post
    Sorry for being unclear, that's just how I tested the stdin / stdout functionality as I don't have a Windows Ampache setup running. Use the same string that I posted earlier:

    Code:
    transcode_cmd_mp3       = "mp3splt -qnf %FILE% %OFFSET% %EOF% -o - | lame --mp3input -S --decode - - | aacplusenc - - %SAMPLE%"
    No problem and thanks for the work! I will play with this when I have the time. Thanks to both of you. I am mobile so can't hit the thanks button but will when I can.
  7.    #1227  
    I'm working on translating all this to a wiki entry so it doesn't get lost when this thread is 150 pages long.
    Ampache Mobile allows you to stream all YOUR music and videos from your computer to your phone.

    Please take a look a these Common Issues before posting to the Ampache Mobile thread.
  8. #1228  
    Quote Originally Posted by bjgeiser View Post
    I'm working on translating all this to a wiki entry so it doesn't get lost when this thread is 150 pages long.
    Do you have any ideas on the best way to deal with the bitrate thing? I hate my hack but I hate losing ten or twenty seconds of half my tunes even more.

    I could change the encoder to shoot for 46kbps when you ask for 48kbps. No Ampache hack would be required in that case, though you'd be tossing away 5% of your (already limited) bandwidth. To get around this, I could add 50 or 51 kbps as accepted bitrates in Ampache. But now we're back to an Ampache hack. Vollmerk might consider mainlining that one, though.
  9.    #1229  
    Quote Originally Posted by mbetter View Post
    Do you have any ideas on the best way to deal with the bitrate thing? I hate my hack but I hate losing ten or twenty seconds of half my tunes even more.

    I could change the encoder to shoot for 46kbps when you ask for 48kbps. No Ampache hack would be required in that case, though you'd be tossing away 5% of your (already limited) bandwidth. To get around this, I could add 50 or 51 kbps as accepted bitrates in Ampache. But now we're back to an Ampache hack. Vollmerk might consider mainlining that one, though.
    Hmmm thats a hard one, from what I've see come out of the encoder its not a solid 48kbps is more like VBR (that track with what you're seeing?), so short of doing 2 passes with Ampache you will never truly know the size.

    Looks like the nero encoder does AAC+ CBR I wonder if we can get the encoder to do that.
    Ampache Mobile allows you to stream all YOUR music and videos from your computer to your phone.

    Please take a look a these Common Issues before posting to the Ampache Mobile thread.
  10. #1230  
    will ampache mobile transcode wma files?
  11. #1231  
    Quote Originally Posted by bjgeiser View Post
    Hmmm thats a hard one, from what I've see come out of the encoder its not a solid 48kbps is more like VBR (that track with what you're seeing?), so short of doing 2 passes with Ampache you will never truly know the size.

    Looks like the nero encoder does AAC+ CBR I wonder if we can get the encoder to do that.
    More like ABR, I think, though they call it CBR. I think that the encoder I'm using is pretty much straight from the reference code so the ABR thing might be inherent to the codec.

    Nero, I think, is a lost cause and I found a couple of posts on Hydrodgen Audio that suggest Nero does the ABR thing as well.
  12.    #1232  
    Quote Originally Posted by mbetter View Post
    More like ABR, I think, though they call it CBR. I think that the encoder I'm using is pretty much straight from the reference code so the ABR thing might be inherent to the codec.

    Nero, I think, is a lost cause and I found a couple of posts on Hydrodgen Audio that suggest Nero does the ABR thing as well.
    Ya... ABR (Average Bit Rate) is a simple form of VBR

    I agree about Nero, just wondering if we could get the bitrate a bit more predictable.

    Might be time to pose the question to the Ampache forum and see if anyone over there has any ideas. I've never looked at how they are collecting the stream from STDOUT.
    Ampache Mobile allows you to stream all YOUR music and videos from your computer to your phone.

    Please take a look a these Common Issues before posting to the Ampache Mobile thread.
  13. #1233  
    Quote Originally Posted by bjgeiser View Post
    Ya... ABR (Average Bit Rate) is a simple form of VBR

    I agree about Nero, just wondering if we could get the bitrate a bit more predictable.

    Might be time to pose the question to the Ampache forum and see if anyone over there has any ideas. I've never looked at how they are collecting the stream from STDOUT.
    They're grabbing a handle to stdout with popen:

    $fp = popen($downsample_command, 'rb');
  14.    #1234  
    Quote Originally Posted by mbetter View Post
    They're grabbing a handle to stdout with popen:

    $fp = popen($downsample_command, 'rb');
    Line 361 of index.php
    Code:
    // Actually do the streaming 
    do {
    	$read_size = min(2048,$stream_size-$bytes_streamed); 
    	if ($read_size < 1) { break; } 
    	$buf = fread($fp, $read_size);
    	print($buf);
    	$bytes_streamed += strlen($buf);
    } while (!feof($fp) && (connection_status() == 0) AND $bytes_streamed < $stream_size);
    I wonder if they can't just get by looking for EOF and not caring about the size.
    Ampache Mobile allows you to stream all YOUR music and videos from your computer to your phone.

    Please take a look a these Common Issues before posting to the Ampache Mobile thread.
  15. #1235  
    Quote Originally Posted by bjgeiser View Post
    Line 361 of index.php
    Code:
    // Actually do the streaming 
    do {
    	$read_size = min(2048,$stream_size-$bytes_streamed); 
    	if ($read_size < 1) { break; } 
    	$buf = fread($fp, $read_size);
    	print($buf);
    	$bytes_streamed += strlen($buf);
    } while (!feof($fp) && (connection_status() == 0) AND $bytes_streamed < $stream_size);
    I wonder if they can't just get by looking for EOF and not caring about the size.
    Ohhhh I see where you're going with this, make Ampache keep going until EOF regardless of the stream_size. Seems worth a shot. What does fread do if you EOF before the # of bytes requested?
  16. #1236  
    I changed:

    Code:
    // Actually do the streaming 
    do {
    	$read_size = min(2048,$stream_size-$bytes_streamed); 
    	if ($read_size < 1) { break; } 
    	$buf = fread($fp, $read_size);
    	print($buf);
    	$bytes_streamed += strlen($buf);
    } while (!feof($fp) && (connection_status() == 0) AND $bytes_streamed < $stream_size);
    To:

    Code:
    // Actually do the streaming 
    373 do {
    374         $read_size = 2048;
    375         $buf = fread($fp, $read_size);
    376         if ($buf == '') { break;}
    377         print($buf);
    378         $bytes_streamed += strlen($buf);
    379 } while (!feof($fp) && (connection_status() == 0));
    Seems to be working, let me play around and see what happens.

    Edit: It looks like Ampache Mobile (or WebOS) kills the song on playback when it hits Content-Length (or duration?), even if Ampache doesn't. Is this something that you could change, maybe use the duration pulled from the XML-API (which should always be legit when we're transcoding) instead of a calculated duration?
    Last edited by mbetter; 05/04/2010 at 11:00 PM.
  17.    #1237  
    Quote Originally Posted by mbetter View Post
    I changed:

    Code:
    // Actually do the streaming 
    do {
    	$read_size = min(2048,$stream_size-$bytes_streamed); 
    	if ($read_size < 1) { break; } 
    	$buf = fread($fp, $read_size);
    	print($buf);
    	$bytes_streamed += strlen($buf);
    } while (!feof($fp) && (connection_status() == 0) AND $bytes_streamed < $stream_size);
    To:

    Code:
    // Actually do the streaming 
    373 do {
    374         $read_size = 2048;
    375         $buf = fread($fp, $read_size);
    376         if ($buf == '') { break;}
    377         print($buf);
    378         $bytes_streamed += strlen($buf);
    379 } while (!feof($fp) && (connection_status() == 0));
    Seems to be working, let me play around and see what happens.

    Edit: It looks like Ampache Mobile (or WebOS) kills the song on playback when it hits Content-Length (or duration?), even if Ampache doesn't. Is this something that you could change, maybe use the duration pulled from the XML-API (which should always be legit when we're transcoding) instead of a calculated duration?
    Ampache Mobile depends on the playback ended event fired by webOS to go to the next track. Which happens when webOS thinks its hit the end of the stream, and not in my control
    Ampache Mobile allows you to stream all YOUR music and videos from your computer to your phone.

    Please take a look a these Common Issues before posting to the Ampache Mobile thread.
  18.    #1238  
    Maybe take the mp3splt out of the mix since size doesn't matter.
    Ampache Mobile allows you to stream all YOUR music and videos from your computer to your phone.

    Please take a look a these Common Issues before posting to the Ampache Mobile thread.
  19. #1239  
    Good evening,
    Is there a way to increase the buffering for a movie or video clip? I was watching Happy Feet and the video kept pausing
  20.    #1240  
    Quote Originally Posted by mamouton View Post
    Good evening,
    Is there a way to increase the buffering for a movie or video clip? I was watching Happy Feet and the video kept pausing
    I'm using the included palm video player to play the videos so I have zero control over how it gets played back. Even if wrote my own player, I don't think any SDK app including palms own apps have any control over the amount of video that gets buffered, that's controlled by the linux portion of the operating system.

    Were you on Wifi or 3G? How large is the file and how long (minutes:secs)? You may need to compress it more so it streams better.
    Ampache Mobile allows you to stream all YOUR music and videos from your computer to your phone.

    Please take a look a these Common Issues before posting to the Ampache Mobile thread.

Tags for this Thread

Posting Permissions