I am developing Android application which use media player to view Live stream url. Application showing video correct. I need to know that, can we set stream bit rates programmatically? Please check screen shot which showing 1500 kbps at top left side of video and I need to set it 350 kbps.
You cannot set the bitrate using a VideoView. If you want to control the bitrate you will need to decode the audio and video manually using something like FFmpeg. You can then use AudioTrack and OpenGL to play the audio and render the video at the desired bitrate.
I have done it using parsing m3u8 file and get bandwidth of that video.
Related
I want to use a video player eg. using ExoPlayer in android app which will support switching of resolution like we see in YouTube.
My API have video files for 480p,720p,1080p.
I want to give those options in the player and can switch it from the player itself and will play the respective files from URL.
I have seen solutions like track selector etc,but does that work for online files? I have links like :
www.example.com/videos/480/demo.mp4
www.example.com/videos/720/demo.mp4
www.example.com/videos/1080/demo.mp4
Please suggest if there is any other solutions like API change or any other protocols etc.
Why you don't convert your mp4 file to hls or mpd streaming format with ffmpeg so you can stream it chunk by chunk and the player will select the best resolution based on his algorithm?
Have a look at this project, this allows user to select resolution manually via track selection from hls stream encoded by ffmpeg.
https://github.com/namespace7/HLS_Player
To generate hls stream from a video,go through this link
https://superuser.com/a/1302736/1108219
I am using Android MediaCodec : ExtractMpegFramesTest for grabbing frames from video but now i am not getting any useful information on google for How can i create video from frames.png in android?
You can try INDE Media Pack - https://software.intel.com/en-us/articles/intel-inde-media-pack-for-android-tutorials
It has transcoding\remuxing functionality as MediaComposer class and several sample effects like JpegSubstituteEffect - it shows how substitute video frame by a picture from jpg file. You can take black video as a refefence and put images on it with a possibility to set duration, add audio track with help of audio effect etc.
I am following this link of Android developers to record a video. I am able to record but in some default video resolution. How can I go about setting to specific video resolution for recording the video?
In this case, you need a customized video encoder instead of native video encoder (the outcome of which can only be a pre-defined resolution and can not be customized). Suggest you get ffmpeg in Android build, can do the encoding with ffmpeg, which can resize the video to any resolution you want. Also ffmpeg comes in with great arm/neon optimization, so performance-wise should be OK.
What is the best API for video streaming on Android? The Video is basically MPEG 2, kept on server, I want to stream to my Android phone which is having the decoder and our own player.
(decoding is happening on the phone itself).
The requirement is the delay should be as minimum as possible for smooth decoding and play back.
What about Gstreamer, is it a most efficient way?
Any suggestions?
Rgrds,
Heshsham
may example given at http://code.google.com/p/html5webview/source/checkout helps you
I'm playing video on Android using media player via RTSP. The player takes about 12s to buffer before it starts playing. Anyone know how I can convince the player to buffer less? I have full control over the RTSP server and the SDP it returns.
As per usual, as soon as I decide I should ask a question I work out the answer. I have a line "b=AS:91" in my SDP. If I reduce the number the amount of buffering decreases - so b=AS:2 gives about 4 or 5s buffering.