Saving h.264 streaming video using MediaMuxer on Android - android

(I'm not really good in English but I'll do my best.)
I'm working on a Android app that saves received h.264 streaming video/audio frames into a clip. And I ran into a problem that mentioned here, "Missing codec specific data."
I tried some method to solve this.
Assign pre-defined codec specific data.
Which I borrow from this post, It worked surprisedly perfect - but only on my personal phone (Sony Xperia Z3, Android 5.1.1). Most test devices just crush.(Android 4.3/4.4).
Parsing codec specific data from video stream itself.
On my phone it crushed. But somehow works on some devices.
I use this code as an example.
Create a encoder to encode received video frames then pass them to MediaMuxer.
Yes it's a stupid idea, it doesn't work.
Create a decoder to decode received video frames, pass them to an encoder, and then pass encoded frames to MediaMuxer, save it.
App isn't able to get any free buffer from the encoder. DEADLOCK.
Now I'm running out of ideas.
The last hope I got is using ffmpeg.
But the resources I found are encode/decode videos from video files, not from stream.
Any suggestions?
Thanks in advance. :)

After been trying out a week including weekend studying h.264 spec and more.
I found out the problem isn't about video.
It's the AUDIO that is causing app to crush.
Case close, thanks for viewing. :\

Related

display video from h264 stream of an ip camera in android

In my ndroid application, I need to display H264 streams from a GrandStream IP Camera. I saw some topics about decoding H264 frames with MediaCodec in Android, but I really don't know where to start.
Before searching this topic, I thought that there were planty of open source library for that purpose but It seems there is not!
Can you show me a way where to start? Should I use Android's MediaCodec or is there any open source Java library for that?
You can refer to this site, It has a very thoroughly discussion and sample about Android Media Codec

save rtsp h264 stream with Jcodec (on Android)

Did anyone manage to save a rtsp video stream (h264 mpeg) using Jcodec?
Could you please give me an example?
Also any other method of saving a rtsp stream on an android device would be of great help.
Please don't include any solution that requires device specific compilation ( ffmpeg, by example, is not ok, because it needs to be compiled for the specific arm version).
So I need a pure java solution, if not Jcodec.
I had the same problem!
I'm using ffmpeg on my server and save all video.
Next I save the video on the device calling it to server.

encoding images to video with ffpmeg

We are working on Android 3D Animation App.
We need to identify images, then save and encode the same to video using FFmpeg (Since Android API is not supporting). Once the video is generated, then audio is appended to the same.
We are facing 2 problems on this.
First is the memory leakage issue at the time of saving identified images for encoding. CPU of emulator is getting overloaded. Whether FFpmeg is called every time when an image is selected? How to resolve this issue?
Second (in case if we get through the first one) we are not able to encode the selected images, since this is generating green color video. What could be reason for this?
Whether is there any tool other than FFmpeg for video encoding from images to H264?
Whether images version (Rastar or Vector) will impact this video encoding?
Whether Android OS version is considered?
Any valuable inputs on this will be greatly appreciated.
Thanks
I played also with that idea using ffmpeg on an android phone, but I would suggest to do that on a server which has much more power. On a server you don't need to think about the cpu load of a smartphone.
In general for improving your ffmpeg run you need to publish the ffmpeg calls. ffmpeg is quiet complex where the order of the parameters directly correlates with the efficience.
I don't know which container format you preferer but maybe a simple mjpeg codec could work for you. AFIK there a just the jpeg frames connected to each other which should be much simple then encoding a video to h264/x264 (ffmpeg uses the last one).
A combination of both may be to generate a mjpeg stream which will be converted on the server side to a h264 video which may be downloaded to the client. but that really depends on the length of the video if you don't want to waste the traffic of your customers.

receive and decode H.264 live stream in Android

I am evaluating the possibility of displaying a continuous H.264 live feed (RTSP) on an Android device (2.3+ or even 4.0). I need the delay time (source to display, can assume source encoding to have zero delay) to be within 1 second or so. Wonder if anybody has done this already? What would be a good approach to achieve this?
Thanks in advance
Michael
Maybe you could just give it a try. H264 is supported by android and is even hardware-accelerated on the latest generation of (upper and middle class devices). There is the MediaPlayer class, which can be used to play video files and it also supports the streaming of http and rtsp URIs.

What is the Video Format for Asus Transformer?

I have an Asus Transformer and would like to put a lot of movies in it. However, it seems like it's very hard to find the proper format for it.
I've tried to convert the movies both in AVI and MP4 format where video codec is either MPEG4/H264/H263/XVID and audio codec is either MP3/AAC/AC3/PCM. However, despite many alternatives, none of them works and I am going insane right now.
At the moment, I have 2 720p movies that can be played and they are AVI with XVID codec. I tried to convert a movie with the same format container and video codec (AVI with XVID) but it does not work.
Do I need a special converter to make it work? Everything is just really weird.
Thank you so much for the help.
Have you try this: http://www.pavtube.com/dvd_ripper/ to convert the files into android .mp4 format?

Categories

Resources