I'm facing a strange problem. I tried to play a mp4 video on android devices and it fails to play when video is hosted on my server but same video file plays in same android devices if hosted on other server. I'm facing this problem only in android devices I can play video on my desktop no matter wherever it is hosted. Has anyone else ever faced such problem ?
Obviously its a server problem. But I Cant figure out how to change the settings that enable mp4 to play in android devices!
Server : apache2.2.3
Thanks.
Update your httpd.conf to add the MIME type for mp4
AddType video/mp4 .mp4
If you have a password restriction (like .htaccess), try and remove it and test again. Even if Chrome knows your password, the video player may not, and it doesnt prompt you for it. When played full screen, the player just says 'sorry, this video can not be played'.
Related
I am using UIImagePickerController to pick videos in a messaging app. These videos can then be played back on either an iOS app, Android app or Web app. I am using the code below.
let picker = UIImagePickerController()
picker.delegate = self
picker.mediaTypes = ["public.image", "public.movie"]
picker.videoQuality = UIImagePickerControllerQualityType.typeMedium
if #available(iOS 11.0, *) {
picker.videoExportPreset = AVVideoProfileLevelH264Baseline30
}
This works fine and the video message sends and plays back fine on iOS and web but when playing back in an Android VideoView I get a "Can't play this video" message. The video is definitely being saved to the Android device in the correct location as I can pull it from there using Android Device Monitor and see that it is definitely h264 but there is something about the file the Android VideoView doesn't like.
What am I missing to make these videos picked on iOS play on an Android device? I'd really rather not transcode them on a server because that will massively slow down the message delivery time.
Thanks for your help
To answer my own question in case anyone else needs it.. The iOS file was actually a .MOV even though it was encoded with h264 and saved as .mp4.
I used the function from this post to convert the .MOV to mp4 and problem solved.
Swift - How to record video in MP4 format with UIImagePickerController?
I have a little app written, where you can choose different medias like video, mp3 and pictures.
For testing I have added some sample media like
Video - http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4, an mp3 file, and a picture.
These samples are working fine in chromecast.
Furthermore for better understanding I have not written a new receiver for chromecast. I am using the standard receiver from google.
Now I have a webserver running on my android phone. I have "installed" the correct mimeTypes "video/mp4 mp4" and when I enter the URL from my android phone in my webbrowser chrome on my laptop with the requested file (192.168.0.12:5555/myvideo.mp4) - it is working.
So Chrome plays the file correctly.
The file myvideo.mp4 is the same video from the sample link:http://distribution.bbb3d.renderfarming.net/video/mp4/bbb_sunflower_1080p_60fps_normal.mp4. It is not another video.
But when I take this link (192.168.0.12:5555/myvideo.mp4) and send it to chromecast, chromecast tries to load the file and than goes back to the default screen, the same screen chromecast shows after successfully establishing a connection from my app. (Standard site from google)
I am working in Eclipse. It is not a programming problem. No errors.
I hope anybody can explain me, why chromecast doesn`t play my video, mp3 or jpg from my webserver, but plays the same files from the web?
Thanks
Paul
//EDIT
In the chromecast debugger I get the information:
[151.045s] [cast.receiver.MediaManager] Load metadata error
I dont know what i should do with this information. Also google havent heard this problem yet.
Thanks for any help
//Solution
I have put metadata to the mediafile and some metadata was false written. Eclipse didn`t show me an error, but chromecast had a problem with that.
So everybody who has the same problem, check your metadata of your file.
Hope I can help anybody with that
I am trying to create an Android App to stream live/archived videos from my church's website.
However, I ran into a problem because all of the streams are giving .flv (flash) videos and or flash players...
I have succesfully been able to load .3gp videos in a VideoView but because Android doesn't support flash natively I tried to open the videos via the WebView.
This didn't work. At least, not for the links that I am working with. However, I can open youtube.com and click on any video to play it - but I can't play any of the streams from the church website.
My question:
Is there any way for me to make this work?
I have access to
1) rtsp stream of .f4v
2) http stream of .m3u8
3) rtmp stream of .fv4
I have spent 2 days searching the web for ideas or fixes and everything I find doesn't seem
to work with my particular case.
It seems to me that the only option is to have the church stream direct .3gp/mp4 files that I can access.
Otherwise, I have no clue how to make .f4v files work. No luck with the WebViews yet..
Do any of you have any suggestions for me?
P.S. I will also have to create an iOS app so looking for a solution that will work on
both platforms.
Thanks for your time!
To answer my own question:
It seems that the android emulator cannot play flash/m3u8 files.
However, my nexus 7 does just fine with both VideoView and WebView!
Cool library I found is Vitamio that is supposed to solve the problem I had.
I didn't use it however.
I am trying to play mp4 video from URL but my phone always give me error "sorry this video can not be played" instead if i download video from same URL then video plays fine at phone.
http://beta-vidizmo.com/hilton.mp4
Please tell me what i am doing wrong?
It also depends on the android version. Droid X and Samsung Captivate had a lot of trouble streaming MP4 files when it was in version 2.1, but after the Gingerbread update a lot of androids had this problem fixed.
Make sure you encode the video so that the moov atom is bought to the beginning. I think you can do this with QT Faststart.
I am new to android and trying to streaming video from my server.
When i run the application it gives Error "sorry,this video is not valid for streaming to this Device.." than i download and push to sdcard of my device(samsung Galaxy 5)this time video is playing.... i convert this video by SOTHINK VIDEO CONVERTER..
Any Help??
Thanks..
We ran into exactly the same problem, and I found a solution at this link:
http://code.google.com/p/android/issues/detail?id=9044
In short, if you have access to a Mac, you can encode the videos using HandBrake. Be sure to check the "Web optimized" checkbox. I'm encoding as format:MP4 file, Video Codec: H.264. After I did this and uploaded I was able to view the videos (or at least listen to them) in a 2.1 simulator, which had been giving that exact warning message before. I have not been able to get a hold of an actual 2.1 device, but I suspect it will work. When I confirm that I'll check back in here to let you know.
It seems that you are talking about sothink video encoder engine. Actually this program only supports the apple devices in ios system, for example, iphone, ipad and ipod.
Here is the official product homepage of sothink video encoder engine, and hope it helps!
http://www.sothinkmedia.com/flash-video-encoder-command-line/
The only issue for error "sorry,this video is not valid for streaming to this Device.." is that there is some problem in video format. Just correct the format/codec of mp4 and then it would run gracfully.