hi,is ther a ffmpeg 6 filter for adobes photoshop hdr toning (.hdt) layed out similar to the -filter:v "curves=psfile=my-emple-curves.acv" we can use with ffmpeg 6 ?
Assistant
As of my latest knowledge update in October 2023, FFmpeg does not directly support Adobe Photoshop HDR Toning (.hdt) files for use as filters in the way it does with Adobe Curve files (.acv). The filter in FFmpeg allows you to apply tone curves from Photoshop .acv files, which is different from HDR Toning in Photoshop.
curves
FFmpeg’s curves filter is used as follows to apply a tone curve from a .acv file:
However, .hdt files, which are used for HDR Toning in Adobe Photoshop, are not directly supported by FFmpeg filters at this point.
For HDR processing, you can use FFmpeg's built-in HDR tools and filters such as zscale, tonemap, or others that allow for HDR to SDR conversion and manipulation, but this workflow would be different from using a Photoshop .acv curve.
Here's an example of using FFmpeg for some basic HDR operations:
If you need to apply specific HDR effects from Photoshop, you would typically perform those adjustments in Photoshop itself and then use FFmpeg for encoding and other video processing tasks not directly related to those specific Photoshop adjustments.
For the latest and more advanced usage, always refer to the most recent FFmpeg documentation and community discussions, as new features and capabilities are continuously being added.
User
from previous response show a example with libx265 immplement zscale and tonemap and tune grain
Assistant
Certainly! FFmpeg allows HDR to SDR conversion and processing using the zscale and tonemap filters, and you can encode the result using libx265 with tuning for grain preservation. Here is an example command that shows how you can achieve this:
zscale=t=linear:npl=100: Converts the input color space to linear light with a nominal peak luminance of 100 nits.
tonemap=tonemap=hable:desat=0: Applies the Hable tonemapping operator without desaturation.
zscale=t=bt709: Converts the linear light back to the standard bt709 color space.
format=yuv420p: Ensures the output format is in YUV 4:2:0 planar 8-bit.
Output Codec: -c:v libx265
Specifies the video codec to use for encoding, in this case, libx265.
Quality Settings: -crf 18 -preset medium
-crf 18: Sets the constant rate factor to 18, which is a good trade-off between quality and file size.
-preset medium: Specifies the encoding speed/efficiency trade-off, with medium being the default.
Tuning for Grain: -x265-params tune=grain
tune=grain: Optimizes the encoding for preserving film grain.
Output: output.mp4
Specifies the name of the output video file.
Feel free to modify the parameters based on your specific requirements or desired level of quality and file size. For instance, you might want to adjust the CRF value or the preset depending on your encoding performance goals.
User
from this arg make it a 10 bit image: ffmpeg -i input.mp4 -vf “zscale=t=linear:npl=100,tonemap=tonemap=hable:desat=0,zscale=t=bt709,format=yuv420p” -c:v libx265 -crf 18 -preset medium -x265-params tune=grain output.mp4
Assistant
To convert the output to a 10-bit image, you need to adjust the format in your zscale filter and modify the output encoding settings to use the 10-bit version of libx265. Here’s an updated version of your command to achieve this:
This command ensures that the processing is done in 10-bit and the final output is a 10-bit video encoded with libx265. By utilizing yuv420p10le, you ensure that the output video maintains a 10-bit depth throughout the entire processing and encoding pipeline.
User
from previous response can you hrlp me correct this error:[tonemap @ 0x7f70e40] Missing color space information, desaturation is disabled --how can i get the color map for the input?
Assistant
The error message [tonemap @ 0x7f70e40] Missing color space information, desaturation is disabled indicates that the input video does not have sufficient color space metadata (like color primaries, transfer characteristics, and color matrix) for the tonemap filter to operate correctly.
To resolve this issue, you can manually specify the color space parameters using the colorspace filter. Here’s how you can modify your FFmpeg command to include the color space information:
Use the colorspace filter to specify the input color space characteristics if they are not automatically detected.
Ensure proper color space tagging with the zscale filter.
Here is an updated command to incorporate these changes. The example assumes your input is in HDR10 (BT.2020, PQ transfer):
Ensures that the color space conversion is properly managed to the BT.709 standard for SDR.
Pixel Format:
User
ffmpeg 6 have glare filter?
Assistant
As of my last update in October 2023, FFmpeg does not include a specific "glare" filter. However, FFmpeg is highly modular and can be extended with custom filters or used in conjunction with scripts and other tools to achieve similar effects.
If you want to create a glare effect, you might need to combine several existing filters creatively. One common approach is using the lenscorrection filter to simulate a lens glare effect or combining blur and overlay filters.
Here’s an example of using the lenscorrection filter combined with other operations to simulate a glare effect:
lenscorrection=k1=-0.5:k2=0.1 applies a basic lens distortion. Adjust k1 and k2 for stronger or weaker effects.
boxblur=lr=10:lp=10:cr=10:cp=10 applies a blur effect. Adjust the parameters for the desired level of blur.
overlay=W/2:H/2 repositions the processed frame.
format=yuv420p10 ensures the intermediate format is 10-bit YUV 4:2:0.
-pix_fmt yuv420p10le specifies that the pixel format of the output video should be 10-bit.
If you need a very specific glare effect, consider using other tools designed for advanced video effects, such as Blender, OpenCV, or specialized plugins for tools like Adobe After Effects, and then integrating the resulting video into your FFmpeg workflow.
Checking for New Filters
FFmpeg development is quite active, and new filters are routinely added. To find out if a new "glare" filter or similar has been added recently, you can check the official FFmpeg documentation or use the following command to list all available video filters:
sh
ffmpeg -filters
This command will output a list of all filters supported by your installed version of FFmpeg, and you can scan through to see if any new filters suit your requirements.
Custom Filters and Scripts
If a specific "glare" filter does become necessary, and no default filter fits the bill, consider creating a custom filter if you are comfortable with programming. FFmpeg's filter API allows developers to extend its functionality by writing custom C code. Alternatively, for simpler tasks, you could leverage FFmpeg’s scripting capabilities or use external scripts and tools to process frames.
User
Hi on previous response Iam getting [fc#0 @ 0x70b1bc0] Cannot find a matching stream for unlabeled input pad overlay
Error initializing complex filters: Invalid argument
Assistant
The error message Cannot find a matching stream for unlabeled input pad overlay indicates that FFmpeg is having trouble finding the correct streams to use with the overlay filter. The overlay filter typically requires two video inputs: a main video and an overlay video.
In your case, if you are applying effects to a single input video without an actual second overlay video, we should not use the overlay filter. Instead, you can create a glare-like effect using the gblur (Gaussian blur) filter along with other filters to simulate a glare.
Here's a revised example command that avoids the overlay filter and instead uses a combination of gblur and gloverlay (if available) to create a glare-like effect, while ensuring it processes the video correctly:
This command specifies the necessary color space information for both the input and output, ensuring that the tonemap filter has the context it needs to perform the tonemapping correctly. If your input video uses different color primaries, transfer characteristics, or color matrix coefficients, you should adjust the values accordingly. For example, you might need different settings if your input uses HLG instead of PQ.
For the latest information, always refer to the FFmpeg official documentation or the FFmpeg repositories on platforms like GitHub.
If you still want to manually create the overlay effect, you'll need to use two input streams for the overlay filter. Here's an example with a duplicated stream to achieve this: