[FFmpeg-user] ffmpeg architecture question

Mark Filipak markfilipak.windows+ffmpeg at gmail.com
Fri Apr 17 13:12:18 EEST 2020



On 04/17/2020 03:56 AM, Michael Koch wrote:
> Am 17.04.2020 um 09:44 schrieb Mark Filipak:
>> On 04/17/2020 02:41 AM, Michael Koch wrote:
>>> Am 17.04.2020 um 08:02 schrieb Mark Filipak:
>>>> Thanks to pdr0 -at- shaw.ca, My quest for the (nearly perfect) p24-to-p60 transcode has concluded.
>>>>
>>>> But remaining is an ffmpeg behavior that seems (to me) to be key to understanding ffmpeg 
>>>> architecture, to wit: The characteristics of frame traversal through a filter chain.
>>>>
>>>> From a prior topic:
>>>> -----
>>>> Filter graph:
>>>>
>>>> split[A]    select='not(eq(mod(n+1\,5)\,3))' [C]interleave
>>>>      [B]split[D]select='eq(mod(n+1\,5)\,2)'[F]blend[D]
>>>>              [E]select='eq(mod(n+1\,5)\,3)'[G]
>>>>
>>>> What I expected/hoped:
>>>>
>>>> split[A]         0 1 _ 3 4         [C]interleave 0 1 B 3 4 //5 frames
>>>>      [B]split[D] _ 1 _ _ _ [F]blend[D]               |
>>>>              [E] _ _ 2 _ _ [G]                       blend of 1+2
>>>>
>>>> What appears to be happening:
>>>>
>>>> split[A]         0 1 _ 3 4         [C]interleave 0 1 _ 3 4 //4 frames
>>>>      [B]split[D] _ _ _ _ _ [F]blend[D]
>>>>              [E] _ _ 2 _ _ [G]
>>>>
>>>> The behavior is as though because frame 1 (see Note) can take the [A][C] path, it does take it & 
>>>> that leaves nothing left to also take the [B][D][F] path, so blend never outputs.
>>>
>>> Only an untested idea, what happens when you change the order of the inputs of the blend filter, 
>>> first [G] and then [F]?
>>
>> This would be an important topic for someone writing a book, eh?
>>
>> I assume you mean this, Michael:
>>
>> split[A]    select='not(eq(mod(n+1\,5)\,3))'       [C]interleave
>>      [B]split[D]select='eq(mod(n+1\,5)\,2)'[F]blend[D]
>>              [E]select='eq(mod(n+1\,5)\,3)'[G]
>>
>> split[A]         0 1 _ 3 4         [C]interleave 0 1 _ 3 4  //4 frames
>>      [B]split[D] _ _ 2 _ _ [F]blend[D]
>>              [E] _ _ _ _ _ [G]
>>
> 
> no, I meant replace [F][G]blend[D] by [G][F]blend[D] and leave everything else as it is.
> 
> Michael

That will have to be an experiment for you to try because I'm no longer using 'blend' and I've found 
a filter chain that's not so complex (i.e., not 2 levels of 'select'). For a book writer, reworking 
my original filter chain (posted in other topics) and making the change you suggest would be a 
worthy experiment. I mean, not recusing the filter chain for alternative paths when a existing path 
has succeeded, if that is factual, is a rather important ffmpeg architectural feature.

Let me know if you need me to run experiments. I'll try to reconstruct my original filter chain.

Regards,
Mark.


More information about the ffmpeg-user mailing list