[FFmpeg-trac] #10494(avfilter:new): Incorrect h264 video generated after passing it through some of the filters.
FFmpeg
trac at avcodec.org
Sun Jul 30 16:27:14 EEST 2023
#10494: Incorrect h264 video generated after passing it through some of the
filters.
----------------------------------+--------------------------------------
Reporter: Wodzu | Type: defect
Status: new | Priority: normal
Component: avfilter | Version: git-master
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
----------------------------------+--------------------------------------
I have video like this:
{{{
Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv,
bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 26 kb/s, 25 fps, 25 tbr,
12800 tbn (default)
}}}
provided in the attachment. I think any video with yuv420p(tv, bt709,
progressive) will reproduce the problem.
When I pass this video through some of the default filters , for example
"edgedetect" and will try to encode it with libx264 codec, the video will
be broken (black, some vertical strips etc.)
This command illustrates the problem:
{{{
ffmpeg_g -i video.mp4 -vf "edgedetect" -c:v libx264 blank_video.mp4 -y
}}}
However, I've also found a filter for which the video is encoded fine:
{{{
ffmpeg_g -i video.mp4 -vf "pixelize" -c:v libx264 blank_video.mp4 -y
}}}
After some investigation, I think that the problem lies in automatic
conversion of pixel format outputted by the filter and accepted by the
codec.
I've also tested this for libx265 and in this case it works correctly:
{{{
ffmpeg_g -i video.mp4 -vf "edgedetect" -c:v libx265 blank_video.mp4 -y
}}}
Tested on: multiple versions of FFmpeg (main branch and 6.0) and on custom
built libx264 as well as official Ubuntu package.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/10494>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list