I download an MP4 file from the internet and play it on the blackberry device. I get the following error: "the video portion of the media being played uses an unsupported format". The audio starts playing, but the video doesn't play, while showing this error.
It should be noted that this only happens on Device OS 5 & 6. The same video plays properly or OS 7 and OS 7.1. I am guessing this is because RIM included some updates to MMAPI. What could i do to allow devices prior to OS 7 play the videos? OS 5 & 6 devices play MP4 files, just not all of them.
I have been looking into custom decoding the bytes of the MP4 file, but that will take a lot of time, looking into existing decoder implementation before adapting to J2ME, not an easy task.
Any help would be great here.
Edit:
The video content owners have control of the videos on the server side, but arent willing to re encode, mainly due to size concerns on the server, even though i recommended they do as well.
The resolution of the video is about 720w x 400h. This is quite high for a BB, but Bold 9790 and Torch 9810 both play it without a problem. So why cant Bold 9780 play the same file?
Update:
Regarding the problem with the video playing on a 9790 and not a 9780, those are different devices. The 9790 came out about a year after the 9780, and apparently RIM added more capability.
From 9780 specs:
Video player DivX/WMV/XviD/3gp
From 9790 specs:
DivX/XviD/MP4/H.264/H.263/WMV player
So, that explains why you can't get that video to play on the 9780. If playing this video is fundamental to your app, you might change the settings in BlackBerry App World to list it as incompatible with 9780s. If this is only one of many features of your app, you might at least catch the media exception and inform the user gracefully that their device can't play the video requested, so they don't think it's your app's fault.
Original Answer:
MP4 actually contains a family of related formats.
The actual support for your video probably depends both on your BlackBerry OS version (e.g. 5/6/7) and also the device itself.
Here is a BlackBerry reference document that describes video format capabilities of various BlackBerry devices.
See also this reference document.
Of course, different devices also have different sizes of screens.
It might be useful for you to produce the videos in a variety of formats and resolutions, and have your BlackBerry app download different versions of the video depending on the device. Since video downloads are slow, doing it this way will also ensure that the user sees the fastest possible download on their device. There's no use downloading a higher resolution than the device can display.
You didn't specify whether you have control of the videos on the server side or not, so this may not be an option for you.
Related
I'm writing an app for a multimedia website I frequent and I've run into a problem.
After grabbing a video stream URL (h264 wrapped in an mp4 container) and attempting to play it with the native video player, it fails. This is on my Moto Droid running 2.2 (BB) and 2.3 (CM7). I've tested the app on my Xoom (3.1 stock) and it works great. I've also had a friend test it on her Xperia Arc (2.3 stock as far as i know) and it worked for her. Makes me think it's a hardware decoder issue since I can play the stream fine using RockPlayer's software decoder but can't using the hardware one.
So I have three things here I want to find out:
Does the native Android player support software decoding? If so, how do I tell if it's using hardware or software, and is it possible to toggle?
Are there any third party media players with readily available SDKs (free)?
How can I just open the video in another app like Rock Player since I know it works? When I download a video using the browser, it asks me what video player I want it to use. How can I get this to pop up within my app and then send the video to it?
1) Does the native Android player
support software decoding. if so, how
do I tell if it's using hardware or
software and is it possible to toggle?
All you have is the default codecs. You can't "toggle" anything. The only alternative is to provide your own software codecs, built with the Android NDK and bundled in the APK.
2) are there any 3rd part media
players with readily available SDKs
(free).
The authors of MP4Box at GPAC provide Osmo4 for Android, an alternative video player built from scratch, software codecs included. It's open source:
http://sourceforge.net/apps/trac/gpac/browser/trunk/gpac/applications/osmo4_android
3) How can I just open the video in
another app like Rock Player since I
know it works. When I download a video
using the browser, it asks me what
video player I want it to use. How can
I get this to pop up within my app and
then send the video to it?
This kind of "popup" is called a chooser and can be created with an ACTION_VIEW intent, using something like:
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(uri, "video/mp4");
startActivity(Intent.createChooser(intent, "View with:"));
1) Does the native Android player support software decoding. if so, how do I tell if it's using hardware or software and is it possible to toggle?
It most likely uses hardware decoders by default. There is default support for software decoder but you can't toggle them from the app level.
i heard the rumors about google tv and stuff, but after falling in love
with android and the sdk i tought "why not to have android on my tv".
Some days ago I was looking for hardware for my mini-pc media center computer.
I think it is possible and i think is a good idea too - using android on
custom media center computer, but the question is - how? What type
of hardware i need to make it real. Connecting Htc desire HD to TV
is not the solution :-)
Your first bet it to see if there is enough driver support on http://www.android-x86.org/ to do what you need with the hardware you have. If you get the basics, video, sound, network and some form of remote control through an IR driver you'll have to figure out what features you'll want in your Media Center application.
Off the top of my head, this is what I would do:
Get Android running on my box, ensuring it can connect to my network, display to my TV and play sounds.
Determine all the codecs I want to play, and play each of the movies on the machine to verify.
Work on UPnP support to stream movies/photos/music from home computer.
Wait patiently until Flash support works on Android-x86 to play hulu
I think you get the idea. This isn't a trivial task but would be really interesting to see if you can come up with something to rivals Boxee.
I installed Red5 1.0 on EC2 running linux. My goal is to record webcam video from my website -- connect to a user's webcam and save the video to S3.
I tried out the video recorder application in the pre-installed demo apps. It works, but when I play back the recorded flv video, the quality is terrible.
At best, the video is extremely pixelated and blurs with motion
At worst, the video doesn't even play -- it just stays stuck on one frame
Most often, the video and audio are totally out of sync and choppy. I found that I could affect this be increasing the buffer allowance on the server using one of the config files, but increasing the buffer seems to cause the video to get choppy.
I've tried connecting with multiple computers and even a fast corporate internet connection. Interestingly, the quality issues persist even when connecting to localhost, so it doesn't seem to be a network problem.
When I use the red5-recorder.com flash app to record to the demo server app, the quality is even worse.
Ultimately, I just want to get a high quality video recording from a visitor's webcam, but don't want to drop the money for FMS or Wowza.
Any ideas on how to get Red5 to record high quality? Is it always this bad?
Thanks for your help!!
The quality of recorded video is not related with RED5 settings but your flash app settings. Just try to set Camera.setQuality() to something more suitable to your needs. For example if you use setQuality(0, 100) you'll get the best possible video quality but bandwidth use also increase.
We experience the same problem with 0.91 version. I read somewhere that 0.8 was fine. You might try that one..
Try using Red5 RC1 it will surely give you much better recording but i am also trying to find something even better and i have not come up with something till now..if you solved your problem i would be glad to hear a better approach..
All Red5 versions (up to and including 1.0.2 ) have been plagued by serious video recording issues. See this answer for a list of all versions and their issues.
Red5 1.0.3 is the 1st version of Red5 with the video recording process fixed because it's the 1st to contain this awesome patch.
Quick explanation of the 2 part cause
Flash Player buffering (only) video packets
Flash Player is known to buffer video packets and send only audio packets when the network conditions do not allow it to send both.
This works very well for live video scenarios where you want to keep at least the audio going but NOT for video recording scenarios where the locally buffered video packets end up arriving too late at the media server (the corresponding .flv section might have already been written to disk).
That's why AMS and Wowza have implemented delayed write mechanism where they wait for the video packets to arrive before writing the data to disk.
Red5's bug
Red5 also had such a mechanism but, due to a serious bug, it was dropping the video packets instead waiting for them.
The bug fas fixed with the patch mentioned above.
How much Red5 will wait for buffered video packets is controlled by fileconsumer.queue.size in conf/red5.properties. it defaults to 120 which should be enough for a buffer of 2 minutes of HD video.
Further reading
delayed.write and queue.size mechanism flawed? on the Red5 mailing list
Recording high quality (HD) video over slow connections with Red5 is now possible
Let me first state that I do not know Java. I'm a .NET developer with solid C# skills, but I'm actually attempting to learn Java and the Android SDK at the same time (I know it's probably not ideal, but oh well, I'm adventurous :))
That said, my end goal is to write a streaming media player for Android that can accept Windows Media streams. I'm okay with restricting myself to Android 2.0 and greater if I need to. My current device is a Motorola Droid running Android 2.0.1. There is one online radio service I listen to religiously on my PC that only offers Windows Media streaming, and I'd like to transcode the stream so my Android device can play it.
Is such a thing possible? If so, would it be feasible (i.e., would it be too CPU intensive and kill the battery)? Should I be looking into doing this with the NDK in native code instead of Java? I'm not opposed to writing some sort of service in between that runs on a desktop computer (even in C#), but ideally I'd like to explore purely device-based options first. Where should I start?
Thanks in advance for any insight you can provide!
Having a proxy on your PC that captures windows audio output, encodes it, and sends it to your phone is perfectly possible. I had something like that 8 years ago on a linux-based PDA (sharp zaurus). The trick is that you're not trying to decode or access the XM radio stream directly, you're simply capturing what is being sent to the speakers on your desktop and re-sending it. There will be a minor hit in audio quality due to the re-encode, but shouldn't be too bad.
I've done cloud-to-phone transcoding using an alpha version of Android Cloud Services. The transcoding is transparently done on a server and the resulting stream is streamed on the phone. Might worth having a look. http://positivelydisruptive.blogspot.com/2010/08/streaming-m4a-files-using-android-cloud.html
I need to talk to Video4Linux (to capture output from a webcam) on a debian system running on an armel system (OpenMoko). JavaMediaFramework won't work in this case as it only have x86 and AMD versions. The linux kernel is 2.6.24 (with the v4l drivers compiled in separatly) and I cannot upgrade it (as it is not available on my hardware.
I have been following closely a project called video4linux4java . I now works with a lot of drivers (therefore a lot of webcams & capture cards), and produces a JPEG-encoded stream of images captured from a video device. Recently, the author has added classes to report information on the video device itself (webcam, TV tuner, ...). It is simple to use and comes with some examples. One of them (used to test v4l4j) displays a video stream in a JFrame. I use v4l4j in my own app to capture frames from my Logitech Quickcam Sphere AF, and control the pan and tilt. Works Great !
Video 4 Linux devices should be accessible through a device file (like /dev/video).
So I think you can open the device you want to access as you would do with a normal file and then read the stream coming from it.
To have more info about the devices, the video format etc... just check V4L web site