blackfyre
blackfyre

Reputation: 2579

how to filter rtsp packets from a pcap file

i'm writing a program to open a pcap file and then filter some packets and then write packet data as string in a file but i do nott know why this progrme is doing nothing after opening the pcap file.

int rtsp=0;

FileWriter fstream2= new FileWriter("E:\write2.txt",true);

BufferedWriter fbw2= new BufferedWriter(fstream2);

System.out.println("RTSP:"); JpcapCaptor captor2=JpcapCaptor.openFile("E:\rtsp_with_data_over_tcp.pcap");

while(true){

Packet packet2=captor2.getPacket();

if(packet2==null || packet2==Packet.EOF) break;

rtsp=rtsp+1; String PacketData2=new String(packet2.data);

fbw2.write(PacketData2);

fbw2.newLine();
}

fbw2.close();

captor2.close();

System.out.println("RTSP:"+rtsp);

EVEN this last print statement is also not working.

can any one guide me? !

Upvotes: 0

Views: 2585

Answers (1)

qrtt1
qrtt1

Reputation: 7957

According to the default ports used by rtsp, you can filter the

rtsp            554/tcp    Real Time Stream Control Protocol
rtsp            554/udp    Real Time Stream Control Protocol
rtsp-alt        8554/tcp   RTSP Alternate (see port 554)
rtsp-alt        8554/udp   RTSP Alternate (see port 554)

http://www.cs.columbia.edu/~hgs/rtsp/

Upvotes: 1

Related Questions