Pixel format: default and filter?

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

Pixel format: default and filter?

amindfv@mailbox.org
I have two videos (call them a.mov and b.mov) with the same width, height, pixel format, etc.

ffprobe reports them as having 'yuv420p10le' pixel format.

If I do a trivial conversion:

    ffmpeg -i a.mov out.mov

ffprobe reports out.mov as still being yuv420p10le.

But if I create a trivial filter:

    ffmpeg -i a.mov -i b.mov -filter_complex '[0:v][1:v]overlay' out.mov

ffprobe now reports out.mov being yuv420p. Is this an implicit conversion to a lower bit depth?

I can get out.mov to stay at 10-bit color with:

    ffmpeg -i a.mov -i b.mov -pix_fmt yuv420p10le -filter_complex '[0:v][1:v]overlay' out.mov

But I wonder if it's being downsampled and then upsampled, resulting in a loss of quality. I tried "-pix_fmt +", and it gave an error:

    The filters 'graph 0 input from stream 0:0' and 'Parsed_overlay_0' do not have a common format and automatic conversion is disabled.
    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #1:0

Does this mean my downsampling theory is correct? Everything should have a common format (the 2 input files, the output file, and hopefully the filter).

Thanks!
Tom

_______________________________________________
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: Pixel format: default and filter?

kumowoon1025
Hi,

> ffprobe now reports out.mov being yuv420p. Is this an implicit conversion to a lower bit depth?

It's just the default output format for overlay. It's commonly used for stuff across colorspaces (like yuv420p video and argb png logos overlaid) especially with alpha.

You can set format option in the filter itself to force output format. I assume it doesn't do any conversions when you overlay two sources with same format with no alpha internally.

Regards,
Ted Park

_______________________________________________
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: Pixel format: default and filter?

Nicolas George
In reply to this post by amindfv@mailbox.org
[hidden email] (12020-09-12):
> But if I create a trivial filter:
                    ^^^^^^^
>
>     ffmpeg -i a.mov -i b.mov -filter_complex '[0:v][1:v]overlay' out.mov
                                       ^^^^^^^

There's your problem: your filter is not trivial at all. Overlay
requires compatibility between the formats of its inputs, and therefore
cannot work with the normal format negotiation.

I suggest you peruse its documentation to see how to set the format.

Regards,

--
  Nicolas George

_______________________________________________
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".

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Pixel format: default and filter?

amindfv@mailbox.org
In reply to this post by kumowoon1025
On Sun, Sep 13, 2020 at 07:06:56AM -0400, Edward Park wrote:
> Hi,
>
> > ffprobe now reports out.mov being yuv420p. Is this an implicit conversion to a lower bit depth?
>
> It's just the default output format for overlay. It's commonly used for stuff across colorspaces (like yuv420p video and argb png logos overlaid) especially with alpha.
>
> You can set format option in the filter itself to force output format. I assume it doesn't do any conversions when you overlay two sources with same format with no alpha internally.
>

Thanks both, that's helpful. How can I determine the pixel formats that ffmpeg has chosen for the filters' input and output pads?

Tom
_______________________________________________
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: Pixel format: default and filter?

Michael Koch
Am 13.09.2020 um 17:27 schrieb [hidden email]:
> On Sun, Sep 13, 2020 at 07:06:56AM -0400, Edward Park wrote:
>> Hi,
>>
>>> ffprobe now reports out.mov being yuv420p. Is this an implicit conversion to a lower bit depth?
>> It's just the default output format for overlay. It's commonly used for stuff across colorspaces (like yuv420p video and argb png logos overlaid) especially with alpha.
>>
>> You can set format option in the filter itself to force output format. I assume it doesn't do any conversions when you overlay two sources with same format with no alpha internally.
>>
> Thanks both, that's helpful. How can I determine the pixel formats that ffmpeg has chosen for the filters' input and output pads?

Add -v verbose to the command line, then you get a longer console
listing, look for the green lines.

Michael

_______________________________________________
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: Pixel format: default and filter?

kumowoon1025
In reply to this post by amindfv@mailbox.org
Hi,

> How can I determine the pixel formats that ffmpeg has chosen for the filters' input and output pads?


I'm not sure "chosen" is the best way to describe it, but inserting the showinfo filter will print the format of each frame at that point in the filterchain. But as format conversions are done automatically as needed, and you probably want to know which format it is throughout the filtering, you can see the info by inserting graphmonitor=f=format. (But this outputs as the video stream, so you may want to add a split filter, add the graphmonitor filter to one split and display it, and do what you were planning to with the other.

Regards,
Ted Park

_______________________________________________
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".