save rtsp h264 stream with Jcodec (on Android) - 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.

Related

Playing RTSP videos with h264 output in Android

I need to stream RTSP links within a VideoView, and in the case of RTSP links with a .mov output such as rtsp://184.72.239.149/vod/mp4:BigBuckBunny_115k.mov work fine. However, this one RTSP link I got from someone confidential has a h264 output according to what VLC Player says.
TL;DR how do you implement the streaming of these type of RTSP links and if there's no clear way to code it, are there any external libraries for Android Studio that easily this because I'm kinda at my loss here.
EDIT: Changed title. Streaming can be interpreted differently as in sending RTSP videos from your Android. That's NOT what I want to accomplish. A lot of examples on GitHub are heavily focused on the SD Card Storage and sending it outward, but I am still looking a way to play RTSP videos with h.264 output in my application.
Try to use MediaPlayerSDK from VXG. That is the only one that seems to be working and is open source.
https://github.com/VideoExpertsGroup/MediaPlayerSDK
However as per some posts this can be done using libFFMPEG as well. I didnt try it, but you can give it a try.

Saving h.264 streaming video using MediaMuxer on 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. :\

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

how to create ts (transport stream) video file from mp4 in android

In my project I need to implement an HLS (HTTP live Streaming) for an android device and it stream to an iOS device to play where android device will record the video and send it to server and iOS device will play the stream from the server using an m3u8 file. In the link below
Click Here
They have mention "Currently, the supported delivery format is MPEG-2 Transport Streams for audio-video".
Now problem is that in android you can record only in mp4 by default (correct me if i am wrong). Now I need some third party API or library like ffmpeg, Gstreamer, Xuggler, Jcodec to transcode recorded mp4 to ts files.
ffmpeg, jffmpeg and Gstreamer have a learning curve and to setup time and also need NDK. So I need some help because I don't have enough time to try one of these please refer me if you know any library which is easy to use and does not have a complex learning and setup time. Like Jcodec which is pure java base and plug and play type library but I don't think it can do this for me as they have mention in there documentation they support h262 codec support yet but i need h264 and ACC for audio.
FYI:
JJPMEG
It is a Java binding to FFmpeg and it have an android verison too. Maybe you can give it a try.
https://code.google.com/p/jjmpeg/
Or:
Maybe you can just record the video with supporting encoding and transcode the video in the server side?

How to stream over RTMP on Android?

I'm trying to play video file on a remote server. Video format is flv and server is Flash Media Server3.5.
I'm going to connect to server over RTMP and to implement the palyback of video file using Android Media Player.
Really,is it possible? Any help is my pleasure.
http://www.aftek.com/afteklab/aftek-RTMP-library.shtml
I found this one, but haven't had much luck, there are very few docs and after jigging it to try and support Video (no examples as i can see) i found that the core method RtmpStreamFactory.getRtmpStream(); failed.
This one has also cropped up, but i haven't looked at this yet.
http://code.google.com/p/android-rtmp-client/
It looks like that for me i'll be looking at getting the media server to deliver rtsp instead and this is supported by android. You may also find that later versions of Android i.e. 3> support rtmp.

Categories

Resources