ffmpeg named pipe

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

ffmpeg named pipe

Zixia Huang
Hi ffmpeg users,

I am trying to use named pipe as the input of ffmpeg. I understand that the
default size of named pipe in linux is 65536 bytes. I am wondering how
often ffmpeg reads data from named pipe (is it as frequent as possible?),
and how large data buffer can be held by ffmpeg process once data are read
from named pipe, but not yet encoded (any RAM constraint?). Please could
anyone give me some advice. Thanks in advance!

Regards,
Ted
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg named pipe

Bob DeCarlo
 Since no one answered as of yet... I'll try.
Since you know that the default size is 65536, you probably read the man pages on mkfifo and pipes.  I would study the blocking.  For the shell:man 7 pipe
I can say that ffmpeg has no trouble getting real time data from an uncompressed(SD) live video source.  Do some testing, and maybe you can run a stress utility in another process to see where your breaking point is.  Your data rates may depend more on your machine capability.  
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".  
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg named pipe

Andrew Stuart
In reply to this post by Zixia Huang
>> I am trying to use named pipe as the input of ffmpeg.

Any reason you can’t use stdin or a socket?


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg named pipe

Zixia Huang
Thanks Bob and Andrew.

We are running ffmpeg in sandbox which blocks network connection. Also this
is a docker machine in the commercial cloud, so stdin may not be accessible
(I am not sure though, never tried).

So looks like there is a rtbufsize flag in ffmpeg that buffers ingress
video. So I assume that will hold large volumes of data?

Regards,
Zixia




On Thu, Aug 2, 2018 at 10:24 PM Andrew Stuart <
[hidden email]> wrote:

> >> I am trying to use named pipe as the input of ffmpeg.
>
> Any reason you can’t use stdin or a socket?
>
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> [hidden email] with subject "unsubscribe".
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg named pipe

Kirk Liberty
On Fri, Aug 3, 2018 at 1:46 AM, Zixia Huang <[hidden email]> wrote:
> Thanks Bob and Andrew.
>
> We are running ffmpeg in sandbox which blocks network connection. Also this
> is a docker machine in the commercial cloud, so stdin may not be accessible
> (I am not sure though, never tried).
>
> So looks like there is a rtbufsize flag in ffmpeg that buffers ingress
> video. So I assume that will hold large volumes of data?


I don't think rtbufsize works that way. I just tried...

mkfifo fifo
ffmpeg -i fifo -rtbufsize 1000M -c:v libx265 -crf 4 -threads 1 -preset
placebo delete.mkv
# In another window
cat 4k.mp4 | pv -nb > fifo

...and it loaded about 10 megabytes or 70 frames. Without rtbufsize
it's the same. And, whether or not it means anything I don't know, but
it was also about 10 megabytes or 70 frames with libx264.

Regardless, it is probably not going to cache bytes but whole frames,
which may be function of which codec you are using.

Best,
Kirk
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: ffmpeg named pipe

Kirk Liberty
In reply to this post by Zixia Huang
> So I assume that will hold large volumes of data?

Why do you want ffmpeg to buffer a lot of data?
If you don't care where it's buffered you could use pv or mbuffer ...

<your application> | pv -B 1G > fifo
ffmpeg -i fifo ...
# or to buffer it in the sandbox
<your application> > fifo
pv -B 1G < fifo > fifo2
ffmpeg -i fifo2 ...

Kirk
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".