Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
pipe device/utility + buffer size & discard - ffmpeg mplayer
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
paziu
Tux's lil' helper
Tux's lil' helper


Joined: 24 Nov 2006
Posts: 78

PostPosted: Thu Jul 05, 2012 5:03 pm    Post subject: pipe device/utility + buffer size & discard - ffmpeg mpl Reply with quote

I am looking for a device or an utility that works similar to the FIFO, but has a specified buffer size - let say 10 MiB - and starts discarding oldest it received.
It would behave like a "pipe" that has 10m in length - but keeps only & always 10m * π r2 of water,

I would use if for feeding a live audio/video stream, which encodes all the time - and attach a player any given time - it would fill its buffer quickly, and start playing.
This way, it would be possible to use different applications, that "specialize" in certain features:
1> audio/video grabber
2> a/v encoder
3> a/v server
4> a/v player

projects such as ffmpeg, which can do "most of this all" but have certain limitations and/or unexpected behavior.
so it would be possible to use mencoder's capturing ( from what I see they are a bit better: forceaudio & immediatemode options ) to the "10 meter" pipe "buffer" and server which would be ffserver ( ffmpeg )

I am sure there would be other uses such as PVR with rewind as long as the length of the "pipe".... or pre-buffering next title in the playlist for a smooth playback start...

basically a fifo without the requirement of the "receiver" and with a specified buffer size
or something like
<pre or post process a/v stream> | fifo_buffer | mplayer -
or
an utility that creates a "temp" file that never exceeds specified "buffer" size, and discards the oldest data in order to accept new.

is there something like this already available?

Thanks,

Mike


Last edited by paziu on Fri Jul 06, 2012 2:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Fri Jul 06, 2012 1:51 pm    Post subject: Reply with quote

Theoretically vlc (videolan server) should do this before it became an all-inclusive media player. The original VLC project was to build a streaming cross platform video server, using the LAN as the "video wire" much like what s-video cable does, so to speak.

Granted I have not tried to use this before... just theory...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
paziu
Tux's lil' helper
Tux's lil' helper


Joined: 24 Nov 2006
Posts: 78

PostPosted: Fri Jul 06, 2012 2:22 pm    Post subject: Reply with quote

Thank you for your reply and suggestion, I will look also into the server, as long as it can run in a shell / service :wink:

In the meantime I was hunting for an utility that could provide me with a similar functionality - I found mbuffer / buffer - both are able to receive an specified amount of data, "keep" it, fill, and release, but there is no option to discard the oldest data within the buffer space.
I already said this sentence ( many times ): I wish I would be able to write/modify in ansi/gnu c...
I believe there would be a number of cases such "buffered pipe" could be used:

- receiving multiple A/V streams, and change between them instantly, without any "resolving, connecting to... buffering" time - like switching channels on the TV.
- also good for playlists, with pre-buffering of the "next in the list" entry
- maybe even a kind of PVR/ time lapse - switch to a different "channel" instantly and rewind up to N minutes since all streams are already pre-buffered <--- you can not get it on basically any consumer device available
- for larger networks, pre-buffer 10....20....100 streams and let the users connect to let say ffserver, with near instant delivery of the content, and potential large bandwidth savings.

and all I want to do right now, is pre-buffer 20 seconds of a captured analog signal ( A/V ) to feed an encoder at home....

Thanks again!

Mike


EDIT:

I have been looking too far out... there is "bfr" in app-misc
"General-purpose command-line pipe buffer"

( found it on freshmeat )

this is what I was looking for, now the time came to see if I have been looking for the right thing....

now I can buffer the captured audio and video separatly, mux/encode it and hope for the right synchronization :)

EDIT2:

"bfr" along with the standard FIFO might prevent any buffer underruns... ( broken pipes? )
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9677
Location: almost Mile High in the USA

PostPosted: Sun Jul 08, 2012 6:12 pm    Post subject: Reply with quote

I figure that buffering is an necessary evil with network viewing, because networks tend to hiccup causing frame drops...

Don't mind these URLs, I was just making a note for myself, as I was thinking about doing something like this as a security camera (so I can view what's going on in my house remotely, in real time)

http://serverfault.com/questions/288137/how-to-stream-live-video-from-a-linux-server

http://wiki.videolan.org/Stream_VLC_to_Website_with_asf_and_Flash

Someday...when I get a decent camera...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum