LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-10-2009, 04:08 AM   #1
mathimca05
Member
 
Registered: Oct 2007
Posts: 66

Rep: Reputation: 15
Need help with avifile library usage with network stream.


For an academic project, we are streaming encoded media from
server to client and decoding on the client. The stream is
sent through a network virtual channel(RDP) and received on client.
We wish to use avifile library to decode while it is being
received, and render.

We treat the program receiving the network stream as server and create a
serversocket. As the client (decoding thread) connects to it, open a stream
using fdopen() on the socket descriptor and fwrite() into it.
Could av_open_input_file() with tcp url of the server(receiving program)
be used to connect, open and decode on the client program?

The code will be like this:

Receiving program (Server):
Media_process(STREAM s)
{
create serversocket;
bind(); // localhost, some-port
listen();
sock = accept();
fp = fdopen(sock, "wb");
fwrite(s->data, ...,fp);
.....
}

Decoding thread (Client):
{
AVFormatContext *ic;
av_open_input_file(&ic, "tcp:localhostort", NULL, 0, NULL);
decode();
render();
}

We have tried to follow the source code of avifile library since we
couldnt find
any documentation or sample code about usage. Seems like tcp url will invoke
tcp_open() and corresponding read() functions. But it doesnt seem to work.

How do we link the decoding program with the received stream? What is the way
to handle this requirement? Would greatly appreciate any help and pointers or
some example code.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Application for stream forwarding to local network stringZ Linux - Software 4 07-11-2007 05:33 PM
TV stream with netcat on network RicardoB Linux - Networking 1 07-03-2007 12:22 AM
Cannot stream media across network ckent Linux - Networking 7 01-16-2007 10:55 AM
Stream buffer size of open file in GNU c library rajesh_b Programming 1 01-11-2007 02:06 AM
can't stream media from network deadslota Linux - Newbie 2 05-30-2004 05:26 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration