|
|
09-17-2007, 10:46 AM
|
#1
|
New Member
Join Date: Sep 2007
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 14
|
mpeg4 stream on 8800
Please Login to Remove!
Hello,
I'm trying to develope an application that plays mpeg4 stream from a proprietry remote source (non-rtsp etc.). I know that the "classic" way to play video is by means of the java microedition multimedia framework (Player, DataSource, SourceStream an so on...). However I'd like to get more control over the process of decoding and playing the frames, so I'd like to decode & draw them on my own. The question is whether it's possible or not?
I tried to use java mpeg4 decoder but it is extremally slow. Is it possible to write the decoder in assemley and then use it from the java Midlet?
I'm a newbie in this area, so I'll appreciate any related information!
Thank you.
|
Offline
|
|
09-17-2007, 11:57 AM
|
#2
|
New Member
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 14
|
writing your own player (the drawing frames part) is the only way to get true streaming to work. Both the mmapi player and rim mediaplayer require the entire stream to be downloaded before allowing you to start playing it.
As for custom binaries/libraries on a blackberry i don't think its possible. It looks like the only thing you load onto your blackberry is a .cod file. They've gone out of their way to control what can and can't be done on the device, allowing binaries of any kind would certainly break this.
If you do find a way to load libraries let me know because I'd like to port helix player to the blackberry. It would handle streaming media in most formats. until then I'm working on a standalone RTSP player.
|
Offline
|
|
09-17-2007, 02:17 PM
|
#3
|
New Member
Join Date: Sep 2007
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 14
|
kreneskyp,
Thanks for your response!
If the only way is to reneder each frame manually (that's exactly what I was afraid of), then how would you decode mpeg4 frame? There definitely exists a build-in decoder, but how can I access it?
I haven't managed so far to find either mpeg4 decoding api or a "low-level way" to make own...
|
Offline
|
|
09-17-2007, 03:10 PM
|
#4
|
New Member
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 14
|
Quote:
Originally Posted by iwr
kreneskyp,
Thanks for your response!
If the only way is to reneder each frame manually (that's exactly what I was afraid of), then how would you decode mpeg4 frame? There definitely exists a build-in decoder, but how can I access it?
I haven't managed so far to find either mpeg4 decoding api or a "low-level way" to make own...
|
I haven't figured out how to do that. Unfortunately the decoders and players don't appear to be in net_rim_api.jar.
Just to be clear. You can integrate a streaming protocol with the mmapi player but it will download the entire stream before playback begins. It sucks that you have to wait for playback to start but it is a good first step.
|
Offline
|
|
09-17-2007, 03:46 PM
|
#5
|
New Member
Join Date: Sep 2007
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 14
|
Quote:
Just to be clear. You can integrate a streaming protocol with the mmapi player but it will download the entire stream before playback begins.
|
Well, in my case it's not an acceptable solution. By the way, how does it know that the stream ended? I play "raw" stream, without any container (the framework can play it, i already tested it by putting raw mpeg4 data into *.m4v file).
|
Offline
|
|
09-17-2007, 05:00 PM
|
#6
|
New Member
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 14
|
Quote:
Originally Posted by iwr
Well, in my case it's not an acceptable solution. By the way, how does it know that the stream ended? I play "raw" stream, without any container (the framework can play it, i already tested it by putting raw mpeg4 data into *.m4v file).
|
I havent come up with a good way with rtsp either. the protocol doesn't appear to send any info about file size or eof/end_of_stream. The best i could come up with is timeout when packets stop being read.
|
Offline
|
|
09-18-2007, 10:10 AM
|
#7
|
New Member
Join Date: Sep 2007
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 14
|
Well... Probably, writing few frames to a new file each time and playing this file would work...
Actually, I don't get the point: playing a live stream seems to be rather basic task, is it possible that noone is doing it on bb8800?
|
Offline
|
|
09-18-2007, 11:37 AM
|
#8
|
CrackBerry Addict
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
|
kreneskyp - i'm pretty sure you're wrong about having to download the entire stream - there's a knowledgebase article on the official bb dev site about how to do just this.
[update - cant find it - i may have been dreaming]
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
Last edited by jfisher; 09-18-2007 at 11:39 AM..
|
Offline
|
|
09-18-2007, 04:44 PM
|
#9
|
New Member
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 14
|
Quote:
Originally Posted by jfisher
kreneskyp - i'm pretty sure you're wrong about having to download the entire stream - there's a knowledgebase article on the official bb dev site about how to do just this.
[update - cant find it - i may have been dreaming]
|
I know for certain that the player that comes with sun j2me functions that way. I even decompiled one of the players to see if there was a way around it. aside from writing your own implementation, there wasn't. It read the entire stream during player.realize() and stored it as an internal variable before returning.
its entirely possible that RIM's mmapi player implementation for bb is different. 3gp, mp4 and other formats aren't in sun j2me so RIM either wrote it themselves or bought it. either way there is the chance that the player was implemented correctly.
I'm still working on getting my stream to play so hopefully ill have a definitive answer soon. All the data appears to transfer, i just can't seem to get video out of the player (no controls).
|
Offline
|
|
09-19-2007, 02:58 AM
|
#10
|
CrackBerry Addict
Join Date: Jun 2005
Location: Manchester, UK
Model: BOLD
Carrier: t-mobile
Posts: 714
|
yeah - the kb article i saw was very very low level - sorry i cant remember more or what format they were streaming.
__________________
new job doesn't allow a public profile - please do not contact this user with questions, you will not get a response. good luck!
|
Offline
|
|
09-19-2007, 10:11 AM
|
#11
|
New Member
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 14
|
it does appear that streaming starts when player.start() is called. this is very exciting, now if only the player would do something with the streams i'm giving it
|
Offline
|
|
09-20-2007, 07:12 AM
|
#12
|
New Member
Join Date: Sep 2007
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 14
|
Quote:
Originally Posted by kreneskyp
it does appear that streaming starts when player.start() is called. this is very exciting, now if only the player would do something with the streams i'm giving it
|
By the way - sometimes I've got strange behavior with BB sockets, I send data successfully, then perform read() on an input stream of the same tpc socket, and it never returns (server send data for sure). Did you encounter something like that?
|
Offline
|
|
09-20-2007, 11:08 AM
|
#13
|
New Member
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 14
|
Quote:
Originally Posted by iwr
By the way - sometimes I've got strange behavior with BB sockets, I send data successfully, then perform read() on an input stream of the same tpc socket, and it never returns (server send data for sure). Did you encounter something like that?
|
yes I started this thread about it ( i see that you already found it): http://www.blackberryforums.com/deve...times-out.html
|
Offline
|
|
09-23-2007, 05:17 PM
|
#14
|
New Member
Join Date: Sep 2007
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 14
|
kreneskyp,
by the way, did you see this:
Livelink - Redirection
|
Offline
|
|
09-24-2007, 03:47 PM
|
#15
|
New Member
Join Date: Sep 2007
Model: 8830
PIN: N/A
Carrier: Sprint
Posts: 14
|
Quote:
Originally Posted by iwr
|
i had not seen it, that is a good find. I was implementing DataSource and SourceStream at first but the included mmapi player does not support h263+ (h263-1998).
I found an h263 decoder but not one for AMR so I may be at a total deadend because I dont think i want to get into writing codecs from scratch.
|
Offline
|
|
09-24-2007, 04:23 PM
|
#16
|
New Member
Join Date: Sep 2007
Model: 8800
PIN: N/A
Carrier: Orange
Posts: 14
|
Well, I'm dealing with mpeg4 profile that 8800 plays well.
But I don't realize why I have to use shared stream/file, if I'm able to read the data online from my remote source and fill the buffer they supply in read() method.
I tried to implement it this way, during debug session it seems to go write way, but for some reason the Midlet is getting stuck (no image, no playback - BB just freezes)...
|
Offline
|
|
02-04-2008, 05:41 PM
|
#17
|
New Member
Join Date: Sep 2006
Model: 8800
Carrier: O2
Posts: 9
|
I wrestled with the same options and did some research: the processor used in the pearl, 8800, etc. *seems* to have a hardware codec for this (h263).
I suspect that is where the decoding is being done. That is totally unconfirmed and unofficial, its just my assuption from the processor specs and the fact that any reference sample Java codecs seem much slower, and so are unlikely to lead to realtime decoding.
|
Offline
|
|
|
|