Closed

Implementing video streaming using ffmpeg -- 3

// client

#include <netdb.h>

#include <stdio.h>

#include <stdlib.h>

#include <string.h>

#include <sys/socket.h>

#define MAX 80

#define PORT 8080

#define SA struct sockaddr

void SendMessage(int sock);

void RecieveFile(int sock);

int main(int argc, char const* argv[]) {

struct sockaddr_in serverAddress; // holds server address

printf("Creating Scoket...\n");

int sock = socket(AF_INET, SOCK_STREAM, 0); // create socket

if(sock == -1) {

printf("Socket Creation: Fail\n");

exit(0);

}

printf("Socket Creation: Complete\n");

serverAddress.sin_family = AF_INET;

serverAddress.sin_port = htons(PORT);

// Setup serverAddress IP

if (inet_pton(AF_INET, "[login to view URL]", &serverAddress.sin_addr) <= 0) {

printf("Invalid address\n");

exit(0);

}

//Connect to remote server

printf("Connecting to Server...\n");

if(connect(sock, (struct sockaddr* )&serverAddress, sizeof(serverAddress)) < 0)

{

printf("Connection to Server: Fail\n");

exit(1);

}

printf("Connection to server: Complete\n");

//SendMessage(sock);

RecieveFile(sock);

close(sock);

//system("ffplay [login to view URL]");

return 0;

}

void SendMessage(int sock) {

char message[MAX];

int n;

for (;;) {

bzero(message, MAX);

printf("Message: ");

n = 0;

while ((message[n++] = getchar()) != '\n')

;

write(sock, message, MAX);

if ((strncmp(message, "exit", 4)) == 0) {

printf("Client Exit...\n");

break;

}

bzero(message, MAX);

read(sock, message, MAX);

printf("From Server : %s", message);

}

}

void RecieveFile(int sock) {

FILE *fp;

char *fileName;

char buffer[MAX];

int n;

read(sock, buffer, MAX);

fileName = buffer;

printf("File name recieved: %s\n", fileName);

fp = fopen(fileName, "wb");

if (fp == NULL) {

perror("[-]Error:");

exit(1);

}

bzero(buffer, MAX);

for(;;) {

n = recv(sock, buffer, MAX, 0);

if (n <= 0) {

break;

}

fwrite(buffer, 1, n, fp);

bzero(buffer, MAX);

}

fclose(fp);

}

Using demuxer

To do :

• Read in the video frames sent in by the server

• Display these frames to the user

Skills: Linux, C Programming, C++ Programming, Shell Script, Python

See more: cut video aspnet using ffmpeg, sample code video streaming using java, phpizabi video gallery using ffmpeg, found upload video resolution using ffmpeg php, audio video streaming using java, live video streaming using j2me, audio video streaming using java free, video streaming using java, video streaming using j2me source code, live video streaming using flex, unicast video streaming using java, setting video streaming using coldfusion, video streaming software ffmpeg, streaming using ffmpeg dvb, streaming using ffmpeg, video streaming using rtsp rtp, realtime video streaming using ffmpeg, live streaming using ffmpeg php, video streaming using vlc, video streaming using ffmpeg

About the Employer:
( 11 reviews ) hamilton, Canada

Project ID: #32251399

2 freelancers are bidding on average $138 for this job

aravinda333

Hi, I have great experience working with the libAV family of libraries that is used in FFMPEG. I am also very much experienced with network programming using TCP or UDP protocol. I can definitely help you create an More

$250 CAD in 2 days
(13 Reviews)
3.9
networkdesign17

I already implemented similar things on AWS and I can demonstrate through the demo Let me know if you are interested

$25 CAD in 7 days
(0 Reviews)
0.0