Codename One: How to stream live video to YouTube Live - java

I'm developing an app which I need to stream video captured from the Smartphone's video camera (on iPhones and Android phones) directly to YouTube Live.
I looked into Codename One's Capture.captureVideo(ActionListener response) method which must wait for the video to be stopped, the file to be saved, and then the ActionListener is called. Obviously, this can't work work because the video has to be streamed to an output stream (to an URL given by YouTube Live API) on a continuous basis. Is there any other way to accomplish this? (What about any unofficial API, like method to override, to get the input stream from the camera?) If not, would Codename One consider providing this feature for a version upgrade as the market trend seems to be moving on live video streaming apps?
If it cannot be done with Codename One's API, then the only way is to write native code for Android and iOS. I've read the article integrating native API and using Freshdesk API as an example, so any pointers on how to integrate YouTube API for the purpose of streaming live video?
https://developers.google.com/youtube/v3/live/getting-started
https://developers.google.com/youtube/v3/live/libraries
https://developers.google.com/api-client-library/java/apis/youtube/v3
https://developers.google.com/youtube/v3/live/code_samples/

I don't see a REST API within the list of API's although there is a JavaScript API which you might use to implement this. Alternatively you can use something like was done with the freshdesk API. You will need to embed the native view from the live broadcast, you can look at the implementation of Google Maps to see how we embedded that native widget.

Related

What should i use to display a streaming url on my android app?

I want to display a live-streaming on my android application (from a IP camera in this case) using the URL of the streaming.
The streaming is being shown on a webpage, so basically what I want to do is to display it from to the webpage, straight to my application.
Should I use Picasso, WebView or ImageView in this case?, which one is more efficient and why? or should I use another tool?
Thanks very much for reading, I´m kinda lost with this.
Picasso and ImageView can't deal with video streaming. You should use VideoView, but it is very limited for various media formats, at first try it, if it don't work, try
Vitamio, easy to use, but has large delay for rtmp and rtsp streams
ffmpeg, this is a good choice for rtmp and rtsp streams, but you need to find ffmpeg port for android, for example this AndroidFFmpeg, but you can find more, personally I used this sodaplayer, for rtmp streams, and it has very little delay, comparing to vitamio or web plugin.
GStreamer I used a lot, great library, a little hard to use, but when you experience with it, it can be very helpful
I used this 3 libraries, and it depends what kind of stream is it, all have their good and bad sides, depends on stream format.

How does Codename One work for device specific features?

Maybe I'm just having a hard time wrapping my head around it. I kind of understand how it works from the research I've done, especially this question: How does Codename One work?
But what if I want to intercept incoming texts in Android? How does that affect the iOS app? If I want to use Vimeo's API to upload videos (I have an Android app that does it), will I have to get the source code and add that separately?
Incoming texts can't be intercepted in iOS as far as I know.
For Android you can use intents to intercept incoming texts but that's a bit of a pain you would need to write Android native code for that which you can do with native interfaces in Codename One.
I'm not very familiar with the Vimeo API but if its a REST API then you can pretty much map to it with Codename One's networking API using NetworkManager, ConnectionRequest etc.

How can I stream videos from a server to an Android app?

My local church hosts a weekly show and upload the videos on Youtube. And I've been asked to develop an app for them, so far all is well, however, I have to implement a feature that will allow me to stream the show's videos unto the app.
I honestly don't have much of a clue how to go about it (still new to android programming)! I've looked around here and seen that a few people have already attempted to do this, but unlike what most people have done or tried to do, the videos are released on that day (not live streaming). For example the 10/02/13 video will be released on 10/02/13.
This link gives me an idea on how to stream a video on Android, but that shows that I have to explicitly put in the link for the video.
Is there a way to do the same thing, but instead of adding the link myself, the app should retrieve the videos from a server??
Thank you in advance for your help!
Is there a way to get the link but instead of adding the link myself, the app should retrieve the videos from a server??
To achieve this you need to make the webservice which help to communicate mobile and web server. When you send the request from mobile to server then make the web service which give you response which have link of video then you can stream the video.
To stream the video.
Read here.
Inside the API DEMOS you have on example.
API DEMOS >> Media >> Mediaplayer >> Play Streaming Video
You need to downloaded using the SDK Manager, and then inside eclipse you go throw create new project form existing sample, then you read the code and copy it inside your app.

Converting audio files(.3gp) to video with Album cover and uploading to YouTube

I have an audio file in .3gp format on my Android device which I wish
to upload to YouTube. I know that YouTube is a video upload site and
that I need to convert this sound file to video.
I just want an image to display all the time the audio is playing.
Google tells me there are number of tools that can help me. But I want
to do this via java code from my Android device.
Please help.
Thanks.
There are tools such as FFMPEG available for free that allow you to, essentially, mix and convert heterogenous streams. That is you can add a bitmap to a video, create video from slide shows and then add sound etc. (See a related question I asked here).
These programs can be executed from within java applications by making Runtime.exec(..) calls.
Sun has an example for stitching multiple JPEGs together into a movie, you can find it here. You should be able to take this example, (its fairly robust), and add what you need to it.
I recommend looking into the Java Media Framework (FAQ)
You can find a vast collection of sample applets/code at the Sun Solutions page. You can find the API on this page. I do hope this is compatible on the Android platform, as I haven't had any personal experience developing for it. But it might be a good place to start.

Where to get streaming (live) video and audio from camera example app for Android?

Where to get streaming (live) video and audio from camera example for Android?
Suppose I want to create some live video streaming service app so I'll have some cool server at the back end. And I know how to do that part. Suppose I have some stand alone app for PCs now I want to go on to mobile devices. So I want to see some sample app grabing audio and video streams from Phone, Synchronizing them, encoding somehow, and sending LIVE stream to server. I need any Open-Source sample that will do this or something like this. Where can I get such one?
Ole have you been able to find any good examples of video or audio broadcasting yet? The best that I have found so far is the SIPDroid project (www.sipdroid.org). I haven't had a chance to review it in depth, but it looks promising.
Here are some project that you want
Ip Camera
http://code.google.com/p/ipcamera-for-android
SipDroid
http://code.google.com/p/sipdroid/source/browse/trunk/src/org/sipdroid/sipua/ui/VideoCamera.java
You can get the codes using SVN or other clients.
Yet to me, the both projects still have issues. If you get the one working well, please tell me.

Categories