Final project in java,need some help

Hi,

I am taking a course in java programming as part of my B.Sc in computer science

And for the final project i need to create a SOCKETS based multithreads server

I would like to create a streaming media server and a j2me client

running on mobile devices,

The media should be sent using the UDP protocol.

Since i need to focus on the communication side

I am looking for a package which can ONLY break video file into suitable frames which can be sent as UDP packets.

Notice that i an focusing on the sockets serever.

Thanks in advance.

[603 byte] By [tomixdra] at [2007-11-26 14:24:16]
# 1
please, explain more about what you want to do with media...
andreyvka at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...
# 2

Thanks.

In general i do want to play the file on the client side.

But i want to be the one who send the part of the file as UDP packets

using a Socket.

On the clients side i would like to process those packets and

Hand them to a media player of some kind.

Thanks in advance

(This is my old user on thos forum)

tomera at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...
# 3

aaah.. i see now.... something like buffering the stream, before playing it right?

well, you have 2 choices:

1. Use JMF to handle sending and receiving of the data. In this case you can forget Sockets. RTP sending will be handled by JMF itself. Just take a look at JMF solutions, SimplePlayerApplet , AVTransmit3, AVTransmit2, AVReceive2, AVReceive3 examples.

2. Send data usings sockets, buffer them into a temporary file on the client side and after some buffering is done, playback that temporary file, while buffering second one (am i correct?). Still take a look at JMF Solutions on how to playback media files. SimplePlayerApplet example, is what I think you should be looking into first.

andreyvka at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...
# 4

Thanks your help is much appreciated.

As i understand streaming across the internet using JMF is done with a layer over UDP

and i want to take one step backwards and use the UDP protocol directly, since it was part of the course, I am not interested in the services RTP architecture giving me.

I really don't need to buffer the video, I just assumed that is what media player is doing, Now i understand that i was wrong....

I am trying to figure out what is the basic building block of a video file which i can break the file into and send to the media player over a socket.

Is it a frame? should i just break the file to frames(i saw sample code in this forum) pack it into a UDP packet and send it?!?

will the player know how to play it without any additional information added by the RTP architecture?

Should i add additional information to the UDP packets(same as RTP adding)?

Maybe there is an API to get an RTP suitable packet from UDP datagram so i can convert it and send using socket.

I might consider to use your second method...i understand that you suggest to pack the building block of a file(assuming it is a frame) send it to the client using a datagram, convert it to the correct format and than let the player play it.

Thanks in advance.

tomera at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...
# 5

Hi

You've got to have an RTP wrapper (i.e. RTP packets) for your video stream. I realy dont think that opening a file and sending it's contents over plain UDP will make it playable *directly* by media player.

Technically, streaming over RTP is streaming over UDP as well,so if you use RTP, you are using UDP anyway :) In JMF i think it's possible to dig down to transmitting video frame-by-frame, and it is better for you to stick to JMF (or use any existing RTP API).

As for the second method, one of my friends used something like that before for his term project in networks. They were sending mp3 files. Good thing about mp3 is that they didnt have to worry about it's internal architecture, cause if you take any mp3 file and cut something away from it, it will still be playable. I think this method should work very well for mp4 too..

andreyvka at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...
# 6
Do you think that creating an RTP packet is a complicated task?I read the RFC and it seems easy.but would it be enough? I still dont understand what should be in the payload though.Thanks in advance.
tomera at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...
# 7

If I was using mobile devices or phones as clients to hit on a video frame media server, then I would simply packet a frame as a jpeg or gif or png, depending upon what the client can read and render. I would also consider TCP/HTTP as well as UDP. In the simplest form I would do an HTTP GET?on a mobile to hit a server for a JPEG, and use WML or HTML on the mobile device, perhaps java to same effect or if I wanted to show sequences of same. Using RTP could be unnecessarily complicated, but it depends of course on the scope of what you want to achieve, and if needing to include audio or if the server is multithreaded per video source or single video source etc. Just some thoughts.

andyblea at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...
# 8
hijo si queres te vendo lo que queres hacer!!! marco.montilla@gmail.com
culosabrosoa at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...
# 9

What language is that?

> hijo si queres te vendo ...

Vendo? That means 'sell' in a number of languages.

>...lo que queres hacer!!!

Are you trying to 'sell' us something?

If so, note ..

1) that buyers are not inclined to make

purchases off other people who do not

speak the same language (especially

not across the internet) *

2) These forums are not for 'trawling

for business'.

* And if you can (also) speak English,

it makes me wonder. Why would you

waste the bandwidth of people here,

by posting in a language they do not

understand?

AndrewThompson64a at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...
# 10
Hi There,the language this strange guys uses is spanish, I would say a latin-american dialect. I think this guy is just wasting our time. Apparently he just wants to make fun of the people. His nickname is quite a offensive one...RegardsRai
rainieroa at 2007-7-8 2:16:52 > top of Java-index,Security,Cryptography...