Hello, I am transcoding recordings using the concat filter. A problem that occurs from time-to-time is that the broadcaster switches the width and/or height in the middle of a broadcast. That ends up causing an error with the concat filter. The only way that I can think of to handle this issue is to: 1. use ffprobe to check each packet's width and height; 2. if one changes, then put a scale filter on each video stream before passing it to the concat filter. I already run ffprobe before transcoding, so step 1 is only a minor inconvenience. Similarly, step 2 is only a minor inconvenience. But, these glitches happen rarely (I think maybe 4-5 times in the last 2-3 years, with around 1000 files a years), so testing is going to be pretty thin. Question: Is there a better way to sidestep the problem of changing width or height? e.g. does ffmpeg already have a way to handle width or height changes? TIA, Leo
On 7/4/2022 8:04 AM, Leo Butler via ffmpeg-user wrote:
Question: Is there a better way to sidestep the problem of changing width or height? e.g. does ffmpeg already have a way to handle width or height changes?
How much of a change is there? Are we talking about varying by a few pixels or something like 720 to 1080? For dealing with minor size changes, an option is a filter chain to crop larger frames to the target size then center/overlay the result on a target-sized black background. z!
On Tue, Jul 05 2022, Carl Zwanzig <cpz@tuunq.com> wrote:
On 7/4/2022 8:04 AM, Leo Butler via ffmpeg-user wrote:
Question: Is there a better way to sidestep the problem of changing width or height? e.g. does ffmpeg already have a way to handle width or height changes?
How much of a change is there? Are we talking about varying by a few pixels or something like 720 to 1080?
The size changes are a few pixels (720 to 704 or vice versa).
For dealing with minor size changes, an option is a filter chain to crop larger frames to the target size then center/overlay the result on a target-sized black background.
Thanks for the suggestion. That reminds me that one broadcaster started doing this a few years ago to broadcast old recordings (from the 70s) to 1280x720. Leo
Am 05.07.22 um 23:55 schrieb Carl Zwanzig:
For dealing with minor size changes, an option is a filter chain to crop larger frames to the target size then center/overlay the result on a target-sized black background.
As alternative to cropping, you can use the "fillborders" filter. - Ulf
participants (3)
-
Carl Zwanzig -
Leo Butler -
Ulf Zibis