Additional .mp4 decoders for VideoView - android

I am building an app that downloads .mp4 files from the Internet and plays them.
It seems there are no decoders for this particular video type, and I only get audio, no picture. The same thing happens with the standalone player, so it is not a problem with the program or file.
Is it possible to use a user library for the decoding and plug it into VideView?
The .mp4 in question can be found here: https://www.coursera.org/modelthinking/lecture/preview_view?lecture_id=17
Thanks in advance.

Related

Set cover image while record audio in android

Hello I am recording audio using MediaRecorder and save it in MP4 format. and upload to the server. as well record video as MP4 using camera and upload to server.
So while I am receive my uploaded item from server as uploaded url list. and I am playing all it in VideoView. video and audio play good. now here is the thing while I am playing video it's display video frame on video view but while playing audio it's black. basically audio and video file extension are MP4 so I can't make different while adding it in to VideoView other wise I'll add imageview and display some default image and hide VideoView.
so is there any way to record audio with cover image so while I am playing it in Video view so it display that cover image...
I know that using ffmpeg we can do this but I got lots of error while compiling it in my windows pc. so is there any way to add cover image while record audio with pure android api? sorry for bad english.
I google everything but I can't find any solution for convert audio file to video file with using image. So I have to go with FFMPEG.
So I add WritingMinds java FFMPEG in my project using gradle dependency. Then convert MP4 audio with cover image into the MP4 video.
There are some limitation in this precompile library. like it not work in android 24 and some commands like -speed, cpu-used, -deadline which are most important for all the operation(But still we can perform other operation). there are some disadvantage also like slow speed, and some features which required for specific operation are not include in the compile library. (So I gave advice to compile your own ffmpeg library for android project in linux or mac pc(windowns have lots of issues)).
I hope this will help someone who's this type of scenario :)

Android media controller doesn't play sound for iOS recorded videos

I am currently developing a video streaming feature for one of my android apps. I am using android media framework for the purpose. Videos are streamed from an nginx server. Android recorded videos works fine but iOS recorded videos plays only the video not the sound.
It happens because the android support limited codecs in-built like mp3,mp4,mpeg.
While iphone support most of codecs.
What is the way to resolve this?
MP4 for video and MP3 for audio are widely accepted and work on both platforms.
So you need do some stuff at the server. Implement the ffmpeg library that will convert all the videos to MP4 and audio to MP3.
We are doing same mechanism to resolve this issue.
Some more information to understand the problem
Refer stackoverflow answer here
Hope This may help you to get the rid of your problem
Happy Coding!

android MediaExtractor MediaCodec seek

Question again, guys.
I use MediaExtractor and MediaCodec to play MP4 file on android device. Everything works fine until I try to add Extractor.seekto().
If I just play mp3 file with my player,seeking functions well. However, when I try it with MP4 file, the video is not updated. I tried to debug the code, finding out that the mPlayerExtractor.getSampleTrackIndex() always returns 1 (Refer to the audio track).
But I do not know how to fix it.
I cannot put all my code here. So please give me some advise first. Thanks a lot.
Update: I can seek backward for both mp4 file and webm file. If I seek forward with webm file, The video starts to play after the same time of jumped time of the seeking operation. For mp4 file, it just never starts again.

Android VideoView streaming

I have a project with a VideoView in it I am streaming a video from online using this method:
mVideoView.setVideoURI(Uri.parse("http://db.tt/ij7w1Nw"));
My videos are mp4 files downloaded from Youtube. I then upload them to my dropbox, that is where the url comes from. This works fine if I download the video and do not make any changes to it, and upload it straight to dropbox. However if I try to make any changes to it for instance convert from .flv to .mp4, or change the size, then I upload it to dropbox it no longer plays in the VideoView. I get a dialog that says 'Unable to play video. Invalid streaming data'. If I take this same exact video and put it on the SD card either manually or even by having my app download it from the url then play it off of the SD card using
mVideoView.setVideoPath(path);
it works fine. I am using Wondershare Video Converter Platinum to do the conversions and size changes.
Is there some sort of specific encoding that is required to stream an mp4 file rather than play it from a local copy? Am I getting this because of some sort of bug/error with wondershare? Has anyone else experienced this type of problem, if so how did you end up fixing it.
Thank you.
The media format guide may help you see what's available. In my experience wrapping a H.264 AVC or MPEG 4-encoded video in a 3GPP container provides the easiest integration. Android is very fickle with both audio and video streaming.

Android Mediaplayer for voice playback

Is there any possible that we can playback our recorded voice in android through media player with the format of wav or mp3 instead of 3gp or mp4.
if it is possible please give me a source code or URL.
Thanks in advance.
I've already seen this kind of question. All yours...
https://stackoverflow.com/questions/5165295/android-voice-recording
Android audio and voice processing
Android Audio record
https://stackoverflow.com/questions/5234017/android-voice-recording-in-wav-format
Please be more specific describing your problem. I think the first step would be, to show us, what you've got until now. As this is a place to solve specific problems, I would recommend you to take a look into the "What kind of questions can I ask here?" section in the https://stackoverflow.com/faq.
3GP and MP4 are video formats. MP3/WAV are audio formats. The MediaPlayer class definitely supports both MP3 and WAV, as well as MP4 and 3GP. View this link for a list of all supported media formats on Android.
Here is the MediaPlayer Audio sample part of the API Demos application. You could try using this code to play your audio.

Categories

Resources