How to play .mts video file within an application - android

I have an android application for live streaming and recording from a hardware device through wifi. The hardware device can store images and video within the hardware and we can transfer these videos to our mobile application. I am getting the videos and able to download it to my mobile memory. But The video received in .mts fomat and unable to play it using android native MediaPlayer class. I would like to ask you is there any method/library available to play .mts videos . Thanks in advance

Default native MediaPlayer does not support the .mts file format. Better you use vitamio library for that. refrence link - https://stackoverflow.com/a/8261864/3912847 & https://karanbalkar.com/2014/11/tutorial-92-live-streaming-using-vitamio-in-android/
You can download the vitamio library form here

Related

Load and Play Video from V4L2 in Android like Live TV

I have a requirement that i have to load and Play the Video from V4L2 in Android.
I am an Android application developer and i know how to stream and play a video from URL. But, here the case is completely different. I have to create an application for Android TV (CX23102 Usb based driver).
Anyone please let me know where to start. Is my Java knowledge is enough or JNI is required?

Can i Use Vimeo Video streaming for Android Native video view instead of Webview?

I need to use a video streaming service provider for my application in web as well as Android Platform. So i have some questions regarding the video playback. Please help me to solve it.
1 . Is Vimeo video streaming compatible for android native video view instead of Webview? I need to support devices having OS version 4.0+.
2 . Vimeo will manage the quality of video corresponding to the network bandwidth? Such as if the network is very slow whether it will automatically switch to the less quality video without interrupting the playback.
3 . If Vimeo can't provide these features. Suggest any service providers for my Video streaming.
Thanks in Advance.
PRO users on Vimeo.com have access to the HLS links of their own videos. You can find these under the "files" key when requesting your own videos (such as /me/videos, or /videos/{video_id})

Stream Audio from Android to Chromecast

I have a music player in Android, which uses android.media.MediaPlayer to play music from the SD card.
I would like to add the ability to cast the music to a Chromecast device.
I have played around with the democastplayer demo app. Specifically I tried to get the MediaRouteSelector to work with a 'live audio' route, but the 'cast' action button didn't show (suggesting live audio is not supported perhaps?). I also tried a few other things, but had no luck getting democastplayer to send MP3 audio to Chromecast.
Is streaming/sending local SD MP3 files to Chromecast even possible? If so, are there any sample apps or open source projects I can refer to?
Thanks in advance.
You need to add/write a small web server to your android application so it can serve the local media. Then have your sender application send the url of the media (that your local server is serving) to chromecast so it can play the music directly served from your phone.
Yes, Possible to stream your MP3 files by sending file url to chromecast device you can be using remote media player to load the media file. Refer this sample https://github.com/ovingalafsal/ChromeCastSampleApp it might be helpful

Android and video streaming - How can do it?

This is my problem. I have on my hosting an avi video file and I want that the user of my android application can display it in streaming on your smartphone.
There are two way.
1) Convert this file in mp4 format and visual it into my application with MediaPlayer
2) Control that on user's device there is Rockplayer and then to use it for display this avi file.
What the good way ?
Please look at this link. It is very good example for Android Media Streaming.
Media streaming on Android devices using the VideoView object available in the android.widget package. This widget allows audio or video playback local or global resources.
Choose option 1. You don't want to "sponsor" third-party applications such as RockPlayer when building your own app. What if the user doesn't have internet connection by the time he's trying to use your app? And he hasn't downloaded RockPlayer previously? As much as possible you want your app to be independent of other market apps, especially those you do not own.

VideoView and Progressive download

In my application I need to provide the user with a preview on a progressive download (video file).
In order to achieve this, I'm using VideoView component to show the content of the video (.mp4, .3gpp) which is being downloaded.
The problem is that I can't access remote media via http:// or rtsp:// protocol, so I'm forced to use VideoView.setVideoPath to play local copy of the video while downloading.
Unfortunately it seems like on Android devices that can't use StageFright framework (so OpenCore and some Tegra2-based devices in my experience), the VideoView can't handle progressive download correctly: it can play only the portion of the video recognized during the component initialization.
So to be clear: if the user press "play" when only 5% of the video has been downloaded, VideoView will show only that 5% of video, no matter if more video content ha been downloaded in the meantime.
In my experience this issue doesn't affect devices using StageFright framework (e.g.: Nexus One 2.2, Nexus One 2.3.4).
Can anyone point me to a possible solution ?
Thanks in advance
If you are trying to play .h264, You need to move the MOV atoms to the front of the file. These tell the codec the length of the movie among other things.
try qtfaststart
http://ffmpeg.zeranoe.com/builds/
VideoView is a ready to use class in Android Application Framework for video playback use case. It internally uses MediaPlayer class to achieve playback. MediaPlayer uses media frameworks available internally based on certain criteria like file format , origin of content etc.
So the limitation is from underlying framework and not VideoView. If you are still suspecting VideoView then write your own video player activity using media player. You will see the same result.
Also not all versions of Android (read as stagefright) support progressive download.
May be you can use DownloadManager class for downloading content from http server and provide the path to media player / video view for a quick preview.
Shash316

Categories

Resources