How to transmit live video from within a Java application?

Honestly don’t waste your time with JMF, you can consider that offering dead. Here is how you would do screen shotting to an rtmp stream using h.264 (thanks to [email protected] for the example). If the code doesn’t show up here’s pastebin for it: http://pastebin.com/sJHwj0nW import com.xuggle.xuggler.Configuration; import com.xuggle.xuggler.ICodec; import com.xuggle.xuggler.IContainer; import com.xuggle.xuggler.IContainerFormat; import com.xuggle.xuggler.IPacket; import … Read more

Getting green screen in ffplay: Streaming desktop (DirectX surface) as H264 video over RTP stream using Live555

It’s harder than it seems. If you want to use the encoder as you’re doing, by calling IMFTransform interface directly, you have to convert RGB frames to NV12. If you want good performance, you should do it on GPU. Possible to do with pixel shaders, render 2 frames, full size one into DXGI_FORMAT_R8_UNORM render target … Read more

How can HTML5 video’s byte-range requests (pseudo-streaming) work?

I assume your video is in an Mp4 container. The mp4 file format contains a hierarchical structure of ‘boxes’. One of these boxes is the Time-To-Sample (stts) box. This box contains the time of every frame (in a compact fashion). From here you can find the ‘chunk’ that contains the frame using the Sample-to-Chunk (stsc) … Read more

Video Streaming and Android

If you want to just have the OS play a video using the default player you would use an intent like this: String videoUrl = “insert url to video here”; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(videoUrl)); startActivity(i); However if you want to create a view yourself and stream video to it, one approach is to … Read more

TCP vs UDP on video stream

Drawbacks of using TCP for live video: As you mentioned, TCP buffers the unacknowledged segments for every client. In some cases this is undesirable, such as TCP streaming for very popular live events: your list of simultaneous clients (and buffering requirements) are large in this case. Pre-recorded video-casts typically don’t have as much of a … Read more