I've been trying to build a 720p streaming video player in AppInventor, and cannot figure out how to get the video player to do anything remotely like 720p, nor can I figure out how to get it to listen-to / attach -to a UDP video stream on the WIFI.
The doc for the App Inventor video player component is here:
http://appinventor.googlelabs.com/learn/reference/components/media.html#VideoPlayer
The doc for the supported video sizes in android is here:
http://developer.android.com/guide/appendix/media-formats.html
Reading these docs, I'm left with the impression that
Android only supports 480 x 360 H.264 video (I'm fine with H.264, but not 480x360) in it's native widgets.
App Inventor does not support Streaming.
Has your mileage varied?
Actually there isn't a spec for what encoding sizes or if hardware acceleration is required of devices so depends on the manufacturer and model. There is however some minimal set of requirements set by Google in their Android Compatibility Definition Document if a manufacturer wants Android Market.
App Inventor is really interesting Google Labs project and realize that it is a 'Labs' project so trying build a streaming player with it might be a bit out of scope. I think its more for the hobbyist and education folk (Lego Mindstorm modules) than anything else. Since App Inventor just wraps the Android Framework, you would be better off going straight to the Android SDK and doing it there.
My recommendation, if you are trying to do a streaming app, use Java and the Android SDK.
App Inventor does not support Streaming.
App Inventor supports the "Activity Starter Component" which can be used to start the Android Video Player application, which will play an RTSP stream.
I used the following properties on the Activity Starter component to start an rtsp stream:
Action: android.intent.action.VIEW
DataUri: rtsp://a.sample.domain/somestream.sdp
Related
=== BACKGROUND SUMMARY===
At this moment, we are using Android VideoView to perform video play black. Everything seems to be working great until we encounter Live Streaming.
VideoView tends to have 10-15 seconds delay from the live stream within a local network (LAN).
While attempting to solve this issue, we came across VLC Embed for Android. After searching on the Internet, it seems there isn't any article compare pros and cons of using Android VLC Embed vs. Android VideoView.
=== QUESTION ===
What's the advantage (pros) and disadvantage (cons) of using Android
VLC Embed vs. Android VideoView?
Is VLC Embed stable?
Anything I should be careful when switching existing VideoView to VLC?
Thank you all in advanced
My view may not be very professional but it's about what I've experienced so far.
First, Android VideoView is good since it comes with the Android SDK so it does not require external library. But this one has some limits. For example, as far as I know, it doesn't support MMS and MMSH protocols and some others I didn't quote. Which is not the case for Android VLC SDK. This library is complete and supports almost all media formats I know so far.
It just increases your apk on size, on my side that's the only disadvantage.
Is the Android VLC SDK stable? Yes it's stable and maintained by a huge community.
Anything I should be careful when switching existing VideoView to VLC?
You should keep your sources same and care about aspect ratio.
What's the advantage (pros) and disadvantage (cons) of using Android VLC Embed vs. Android VideoView?
Advantage:
More features. VLC supports almost all media formats, hardware decoding. audio tracks, subtitles, chapter are also supported.
More integrated, simpler logic. You can easily get media information and cache them. The playback engine will proactively notify state changes and events, just register player event listening.
Disadvantage:
APK file size increas. If both arm64-v8a and armeabi-v7a are supported, it will increase more than 30MB.
Multiple instances are not perfect. For example, playing 2 videos at the same time is a hassle.
Is VLC Embed stable?
Stable. Starting with VLC 2.0.x (now 3.0.x), I use the VLC library in my Android App. It runs steadily from Android 5.1 to Android 8.0. A small number of 4k h265 video playback is not normal, but can be resolved by displaying "Can not play".
Anything I should be careful when switching existing VideoView to VLC?
To use LibVLC on Android The Medialibrary(org.videolan.medialibrary) is also required. You also need to note the licenses.
VLC for Android is licensed under GPLv3
This may be a concern for you if your project uses a different license.
I have a requirement to develop a Android and iOS mobile apps that allow subscribers to view movies like the way Netflix and Iflix does it.
I would like to know if this can be achieved by inbuilt Video playing classes or widgets on the Android and iOS platforms, or if we will need a library or SDK for this.
I came across this URL on how to stream video in Android apps. Would this approach suffice for this requirement?
https://code.tutsplus.com/tutorials/streaming-video-in-android-apps--cms-19888
Netflix and similar systems use ABR to deliver video to mobile devices - ABR allows the client device or player download the video in chunks, e.g 10 second chunks, and select the next chunk from the bit rate most appropriate to the current network conditions. See here for an example:
https://stackoverflow.com/a/42365034/334402
There are several ABR protocols but the two most common at this time are HLS and DASH. HLS must be used to deliver video streams to iOS devices due to the apple guidelines (at this time and for video over 10 mins which may be accessed on a mobile network - the guidelines can change over time) and DASH is probably more common on Android devices, although HLS can be supported on Android also.
Most Android players now can handle ABR - the Android Exoplayer is a good example, is very well used and supports this natively:
https://github.com/google/ExoPlayer
Take a look at the Developers Guide (included in the link above at the time of writing) which shows how to include ExoPlayer in your app.
On iOS the native player supports ABR using HLS.
After an intense search on this site I found nothing which fits
my problem. I want to write a small video streaming client on
an Android 5.1 device. The following code is used:
QApplication a(argc, argv);
QWidget *widget=new QWidget;
widget->resize(320,200);
QMediaPlayer *player=new QMediaPlayer;
QVideoWidget *vw= new QVideoWidget;
QHBoxLayout *layout=new QHBoxLayout;
layout->addWidget(vw);
widget->setLayout(layout);
player->setVideoOutput(vw);
player->setMedia(QUrl("rtsp://wowzaec2demo.streamlock.net/vod/mp4:BigBuckBunny_115k.mov"));
player->play();
widget->show();
The problem is, the sound works but I only get a white screen.
the sound is playing but no video.
The VLC player on the android device is playing the video
correctly. I also used a small player in android studio and
it plays the video (but with high latency, so it is not useful for me)
I ran out of options what I can change to make it run.
Qt is not media friendly, if you want to play specific format/codec like MOV or h.264/h.265 ect... in a crossplatform way I advise you to use external lib like QtAV (http://www.qtav.org/) or VLC Qt wrapper (https://github.com/RSATom/QmlVlcDemo)
I believe the problem is that Android devices do not support the QuickTime Format (MOV) by default.
VLC Media Player on the other side, is well-known to be able to correctly play MOV videos.
Try testing videos with another format such as MP4or WebM to see how the program behaves.
I once developed a desktop software for streaming audio/video in Qt and I had the pleasure to work with the GStreamer framework.
Among many functionalities, it allows you to convert MOV videos to other formats.
You may check the GStreamer for Android tutorials and QtGstreamer, a set of well-implemented GSstreamer bindings for Qt.
I've made an app to view vine videos on Android devices. These are basically .mp4 videos being loaded into a VideoView. From the following documentation (http://developer.android.com/guide/appendix/media-formats.html), mp4 video playback is supported on Android version 3+ devices.
I've already added a android:minSdkVersion="11" to the manifest file to filter out older android versions from downloading the app, but I'm still getting feedback from users running newer versions of Android (eg. 4.1, 4.2) that complain about getting a "Video cannot be played" error message.
Since there's no way (that I know of, please correct me if I'm wrong) to test video playback using the emulator, I can't really know what's going on.
Is there any way to check for a device's ability to do video playback or at least get the emulator to play videos, so I can correctly fix this issue?
pd. for those interested, here's a link to my app in Google Play. As you can see, I'm being crushed by negative reviews: https://play.google.com/store/apps/details?id=com.thirtymatches.vineflow
If you look at the Google compatibility matrix closely, you'll see that support for MP4/H264 encoding started with the Android 3.0 release. Playback of MP4/H.264 has been supported by all Android devices back to Android 1.0, so there's no need for you to limit availability to newer releases of Android (unless you have other API compatibility needs).
Via VideoView, the video playback on all these devices is done using the hardware decoder provided by the phone's chipset. So to guarantee compatibility, the video has to be encoded to lowest-common denominator. Google provides "Video Encoding Recommendations" at the bottom of the page you linked; I also wrote an answer describing how we transcoded to a form of MP4/H264 that plays across all Android devices.
Not knowing what Vine is doing with their video clips, it might be that the videos aren't all encoded with uniform encoder parameters. They might be taking the videos straight off handsets and streaming them without any additional server-side processing to ensure wide compatibility; I don't know. If that's the case, you might find it challenging to develop an Android app that can show the content without a) implementing your own software codec (as apps like RockPlayer, MX Player or VLC do) or b) transcoding the videos on a server (which probably will run afoul of Vine's terms of service).
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 3rd part 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?
Yes, Android provides software h264 decoder, but it may not be available in 2.2. You can prefer software codec, see AOSP source code for stagefright:
usage: stagefright [options] [input_filename]
…
-s(oftware) prefer software codec
…
ffmpeg has many derivatives and wrappers on Android, which are available with a variety of license restrictions.
It's pretty easy to launch an Intent that targets a specific app. You can use setComponent() to match exactly the Activity you need. The better and more flexible way to deal with the problem is to create a custom Chooser (see e.g. Custom filtering of intent chooser based on installed Android package name), to let the user decide which player she/he prefers. With a custom chooser, you can decide to hide some of the handlers that are registered to the Action (e.g. not use the system player on Android version below 3.0).