Nut + ZMQ + rawvideo

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

Nut + ZMQ + rawvideo

Online video
Hi,


I want to distribute uncompressed video to multiple separate processes
using Nut format and ZMQ protocol.


The first distributing process works for me without problems:

*c:\ff\ffmpeg.exe -i "source_link" -c:v rawvideo -c:a pcm_s16le -f nut
"zmq:tcp://127.0.0.1:11111 <http://127.0.0.1:11111/>"*

[image: image.png]


But I cannot accept this stream, the receiving process does not start:

*\ffmpeg.exe  -f nut -i "zmq:tcp://127.0.0.1:11111
<http://127.0.0.1:11111/>" -c:v libx264 -preset:v fast -b:v 8000k -maxrate
8000k -bufsize 8000k -bf 2 -g 50 -keyint_min 50 -c:a aac -b:a 128k -f
mpegts "udp://127.0.0.1:22222?pkt_size=1316
<http://127.0.0.1:22222/?pkt_size=1316>"*

[image: image.png]
After press CTRL-C:
[image: image.png]

What can you advise to solve this problem? Perhaps, instead of NUT, there
is another container format that allows you to transfer uncompressed
streaming video to multiple recipients?


If I pass such a stream through a pipe using the same commands, then
everything is ok, it works:

*\ffmpeg.exe -i "source_link" -c:v rawvideo -c:a pcm_s16le -f nut - |
\ffmpeg.exe -f nut -i - -c:v libx264 -preset:v fast -b:v 8000k -maxrate
8000k -bufsize 8000k -bf 2 -g 50 -keyint_min 50 *
*-c:a aac -b:a 128k -f mpegts "udp://127.0.0.1:22222?pkt_size=1316
<http://127.0.0.1:22222/?pkt_size=1316>"*

[image: image.png]


Best regards, Sergei

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

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

image.png (575K) Download Attachment
image.png (59K) Download Attachment
image.png (71K) Download Attachment
image.png (64K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Nut + ZMQ + rawvideo

Andriy Gelman
Hi Sergei,

On Wed, 04. Nov 13:09, Online video wrote:

> Hi,
>
>
> I want to distribute uncompressed video to multiple separate processes
> using Nut format and ZMQ protocol.
>
>
> The first distributing process works for me without problems:
>
> *c:\ff\ffmpeg.exe -i "source_link" -c:v rawvideo -c:a pcm_s16le -f nut
> "zmq:tcp://127.0.0.1:11111 <http://127.0.0.1:11111/>"*
>
> [image: image.png]
>
>
> But I cannot accept this stream, the receiving process does not start:
>
> *\ffmpeg.exe  -f nut -i "zmq:tcp://127.0.0.1:11111
> <http://127.0.0.1:11111/>" -c:v libx264 -preset:v fast -b:v 8000k -maxrate
> 8000k -bufsize 8000k -bf 2 -g 50 -keyint_min 50 -c:a aac -b:a 128k -f
> mpegts "udp://127.0.0.1:22222?pkt_size=1316
> <http://127.0.0.1:22222/?pkt_size=1316>"*
>
> [image: image.png]
> After press CTRL-C:
> [image: image.png]
>
> What can you advise to solve this problem? Perhaps, instead of NUT, there
> is another container format that allows you to transfer uncompressed
> streaming video to multiple recipients?
>

It looks that the headers in the nut container are not repeated often enough.
So if they are missed by the subscriber, the stream will not start to play.

I think it should be possible to periodically repeat the headers. I'll have a
look and send the patch to the mailing list.

--
Andriy
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://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: Nut + ZMQ + rawvideo

Andriy Gelman
On Thu, 5 Nov 2020 at 22:41, Andriy Gelman <[hidden email]> wrote:

> Hi Sergei,
>
> On Wed, 04. Nov 13:09, Online video wrote:
> > Hi,
> >
> >
> > I want to distribute uncompressed video to multiple separate processes
> > using Nut format and ZMQ protocol.
> >
> >
> > The first distributing process works for me without problems:
> >
> > *c:\ff\ffmpeg.exe -i "source_link" -c:v rawvideo -c:a pcm_s16le -f nut
> > "zmq:tcp://127.0.0.1:11111 <http://127.0.0.1:11111/>"*
> >
> > [image: image.png]
> >
> >
> > But I cannot accept this stream, the receiving process does not start:
> >
> > *\ffmpeg.exe  -f nut -i "zmq:tcp://127.0.0.1:11111
> > <http://127.0.0.1:11111/>" -c:v libx264 -preset:v fast -b:v 8000k
> -maxrate
> > 8000k -bufsize 8000k -bf 2 -g 50 -keyint_min 50 -c:a aac -b:a 128k -f
> > mpegts "udp://127.0.0.1:22222?pkt_size=1316
> > <http://127.0.0.1:22222/?pkt_size=1316>"*
> >
> > [image: image.png]
> > After press CTRL-C:
> > [image: image.png]
> >
> > What can you advise to solve this problem? Perhaps, instead of NUT, there
> > is another container format that allows you to transfer uncompressed
> > streaming video to multiple recipients?
> >
>
> It looks that the headers in the nut container are not repeated often
> enough.
> So if they are missed by the subscriber, the stream will not start to play.
>
> I think it should be possible to periodically repeat the headers. I'll
> have a
> look and send the patch to the mailing list.
>
> --
> Andriy
>

I've sent some patches to the mailing list that add an option to
periodically repeat the headers in nut:
https://patchwork.ffmpeg.org/project/ffmpeg/list/?series=2709

With the series, the following works for me:
./ffmpeg -i /dev/video0 -codec:v rawvideo -f nut -header_period 15
zmq:tcp://127.0.0.1:10000
./ffplay -f nut -i zmq:tcp://127.0.0.1:10000

Let me know if you can also test.

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

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