[FFmpeg-devel] [PATCH v4 1/2] libavformat/vapoursynth: Update to API version 4, load library at runtime
Stefan Oltmanns
stefan-oltmanns at gmx.net
Mon Jul 29 06:31:42 EEST 2024
Am 28.07.24 um 15:09 schrieb Ramiro Polla:
>> if (st->codecpar->format == AV_PIX_FMT_NONE) {
>> - av_log(s, AV_LOG_ERROR, "Unsupported VS pixel format %s\n",
>> info->format->name);
>> + if(vs->vsapi->getVideoFormatName(&info->format, vsfmt))
>> + av_log(s, AV_LOG_ERROR, "Unsupported VS pixel format
>> %s\n", vsfmt);
>> + else
>> + av_log(s, AV_LOG_ERROR, "Unsupported VS pixel format\n");
>> err = AVERROR_EXTERNAL;
>> goto done;
>> }
>> - av_log(s, AV_LOG_VERBOSE, "VS format %s -> pixfmt %s\n",
>> info->format->name,
>> - av_get_pix_fmt_name(st->codecpar->format));
>> -
>> - if (info->format->colorFamily == cmYCoCg)
>> - st->codecpar->color_space = AVCOL_SPC_YCGCO;
>> + if (vs->vsapi->getVideoFormatName(&info->format, vsfmt))
>> + av_log(s, AV_LOG_VERBOSE, "VS format %s -> pixfmt %s\n",
>> + vsfmt, av_get_pix_fmt_name(st->codecpar->format));
>> + else
>> + av_log(s, AV_LOG_VERBOSE, "VS format -> pixfmt %s\n",
>> + av_get_pix_fmt_name(st->codecpar->format));
>
> Could you change this to have a single call go av_log()? Possibly using
> a %s with a string for the unknown format. Same thing for the other
> av_log() above.
>
> [...]
It now prints "(unknown)" for a video format that VapourSynth cannot
resolve. "(unknown)" is also printed at other places in ffmpeg in
similar cases, so it's consistent.
>
> Also could you give us a very minimal test script to test this?
I have attached a minimal test script, it will generate 10 frames each
black, red, green, blue in 640x480, RGB24
Best regards
Stefan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-avformat-vapoursynth-Update-to-API-version-4.patch
Type: text/x-patch
Size: 8768 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20240729/5241bd55/attachment.bin>
-------------- next part --------------
import vapoursynth as vs
core = vs.core
a = core.std.BlankClip(width=640,height=480,length=10)
b = core.std.BlankClip(width=640,height=480,length=10,color=[255, 0, 0])
c = core.std.BlankClip(width=640,height=480,length=10,color=[ 0, 255, 0])
d = core.std.BlankClip(width=640,height=480,length=10,color=[ 0, 0, 255])
r = a + b + c + d
r.set_output(0)
More information about the ffmpeg-devel
mailing list