Low CPU HQ format for local streaming?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Low CPU HQ format for local streaming?

Simon
Hi, I'm looking to monitor the output of an ffmpeg capture, and am
investigating local streaming from ffmpeg to ffplay.

The following command line takes input from a file, rather than a capture,
but the file is an example of what the capture will generate, so I believe
it's representative.

ffmpeg -i capture-4chan.mov -f mpegts - | ffplay -f mpegts -

The capture...mov file contains prores encoded video, and I don't actually
want the audio, though I've not attempted to drop that part yet.

I've also succeeded using the matroska file as the format between the two
processes.

My problem, as was the case in one of my previous questions, seems to be
that there's some default encoding going on, and I don't like what it's
doing (low quality and high CPU usage), and I want to find a better choice.

I need to find an encoding, and presumably a file type, that a) works in a
streaming format, and b) is as low CPU usage as possible. I don't believe I
care about bandwidth, this is just shipped from one process to another and
consumed in real time.

I tried using rawvideo, but it crashes out. To distinguish the encoding
side from the decoding side, I used this command line:

ffmpeg -i capture-4chan.mov -c:v rawvideo -f mpegts - | cat /dev/null

and these appear to be the lines of interest from the output (though I
suspect it's simply that rawvideo doesn't have markers in it that allow a
receiver to know what the heck it's looking at?)

[mpegts @ 0x55f18d555440] Stream 0, codec rawvideo, is muxed as a private
data stream and may not be recognized upon reading.
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe

I also tried using "copy" codec, that is in effect just sending the
prores across the pipe, like this:

ffmpeg -i capture-4chan.mov -c:v copy -c:a copy -f mpegts - | ffplay
-analyzeduration 10 -f mpegts -

But that complained too:
[mpegts @ 0x5604ba2e85c0] Stream 0, codec prores, is muxed as a private
data stream and may not be recognized upon reading.
[mpegts @ 0x5604ba2e85c0] Stream 1, codec pcm_s16le, is muxed as a private
data stream and may not be recognized upon reading.

and

Failed to open file 'pipe:' or configure filtergraph
av_interleaved_write_frame(): Broken pipe
Error writing trailer of pipe:: Broken pipe

So, I think my question is "what encoding, and what file type" would suit
my needs for a very low CPU overhead, but not caring about bandwidth, for
this?

TIA,
Simon

--
Simon Roberts
(303) 249 3613
_______________________________________________
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: Low CPU HQ format for local streaming?

Carl Eugen Hoyos-2
Am Di., 30. Juni 2020 um 18:22 Uhr schrieb Simon Roberts
<[hidden email]>:

> So, I think my question is "what encoding, and what file type" would suit
> my needs for a very low CPU overhead, but not caring about bandwidth

-vcodec mpeg1video -qscale 2 -mbd 2
(You will probably not be happy with the result, but first, this is the answer
to your question and second, "low cpu" is not generally achievable)

Carl Eugen
_______________________________________________
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: Low CPU HQ format for local streaming?

Moritz Barsnick
In reply to this post by Simon
Hi Simon,
in addition to what Carl Eugen wrote:

On Tue, Jun 30, 2020 at 10:21:52 -0600, Simon Roberts wrote:

> I need to find an encoding, and presumably a file type, that a) works in a
> streaming format, and b) is as low CPU usage as possible. I don't believe I
> care about bandwidth, this is just shipped from one process to another and
> consumed in real time.
>
> I tried using rawvideo, but it crashes out. To distinguish the encoding
> side from the decoding side, I used this command line:
>
> ffmpeg -i capture-4chan.mov -c:v rawvideo -f mpegts - | cat /dev/null
>
> and these appear to be the lines of interest from the output (though I
> suspect it's simply that rawvideo doesn't have markers in it that allow a
> receiver to know what the heck it's looking at?)

If the container has information about the rawvideo, the receiver
should be able to play it.

> [mpegts @ 0x55f18d555440] Stream 0, codec rawvideo, is muxed as a private
> data stream and may not be recognized upon reading.
> av_interleaved_write_frame(): Broken pipe
> Error writing trailer of pipe:: Broken pipe

That happens because rawvideo is not a supported video codec in
MPEG-TS.

> I also tried using "copy" codec, that is in effect just sending the
> prores across the pipe, like this:
>
> ffmpeg -i capture-4chan.mov -c:v copy -c:a copy -f mpegts - | ffplay
> -analyzeduration 10 -f mpegts -
>
> But that complained too:
> [mpegts @ 0x5604ba2e85c0] Stream 0, codec prores, is muxed as a private
> data stream and may not be recognized upon reading.
> [mpegts @ 0x5604ba2e85c0] Stream 1, codec pcm_s16le, is muxed as a private
> data stream and may not be recognized upon reading.

And apparently neither are prores nor PCM audio supported codecs.

If you stream from ffmpeg to ffplay, the "nut" format may be a choice
for you. It streams well, and it handles rawvideo as well as prores and
PCM audio (I just tested with all of these).

Cheers,
Moritz
_______________________________________________
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: Low CPU HQ format for local streaming?

Simon
>
>
>
> > I need to find an encoding, and presumably a file type, that a) works in
> a
> > streaming format, and b) is as low CPU usage as possible. I don't
> believe I
> > care about bandwidth, this is just shipped from one process to another
> and
> > consumed in real time.
> >
> > I tried using rawvideo, but it crashes out. To distinguish the encoding
> > side from the decoding side, I used this command line:
> >
> > ffmpeg -i capture-4chan.mov -c:v rawvideo -f mpegts - | cat /dev/null
> >
>


> That happens because rawvideo is not a supported video codec in
> MPEG-TS.
>


> And apparently neither are prores nor PCM audio supported codecs.
>
> If you stream from ffmpeg to ffplay, the "nut" format may be a choice
> for you. It streams well, and it handles rawvideo as well as prores and
> PCM audio (I just tested with all of these).
>

This is all most helpful thank you! Being able to ship rawvideo across the
system bus rather than compressing it solely to decompress it again has
definitely reduced the CPU usage (though mpeg1video was quite low too and
an acceptable image for the purpose) so absent anything unexpected I think
this will be the route I take.

Many thanks Carl and Moritz
_______________________________________________
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".