I know Runtime is picky about exhausting the stdout and stderr streams, so I'm not sure if it's something related to that, or if I somehow need to buffer the stdout before returning it, or if I need to run something in a different thread, or if I'm just completely barking up the wrong tree. (I'm fairly new to java, and this is the first time I've used Runtime.) My player just hangs there. So what I'm trying to do is have ffmpeg transcode to stdout, and then use Process.getInputStream() to return the InputStream that contains ffmpeg's stdout while the transcoding is still going on. But like I said, this is supposed to be a steaming music player, and the blocking for the ~30 seconds it takes to completely transcode to a file is too much of a delay. This works fine if I use ffmpeg to transcode to a temp file, and then return a FileInputStream constructed from that temp file. To do this, my plan is to transcode from MP3 to AAC using Runtime.exec() and ffmpeg, and then return an InputStream that contains the MP3. I'm trying to extend the music player to play AAC files with the extension ".m4a". Specifically, the method that handles incoming requests has to return an InputStream for further processing upstream (out of my visibility). I'm working on a streaming music player, and the platform only handles MP3 natively. I've got a lot of things going on here and I'm having trouble debugging.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |