What does ffmpeg do when packs switch?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

What does ffmpeg do when packs switch?

Mark Filipak
I guess I need some schooling...

What does ffmpeg do when packs switch from hard-telecine to
soft-telecine right in the middle of a GOP?

Of course, a link would be a fine response, but I've not found such a
link (and I've been researching this stuff for months).

I certainly hope that the answer isn't that ffmpeg doesn't care about
it. I hope the answer isn't that ffmpeg just takes what the decoder
outputs because in one case the decoder outputs 5 frames (3 frame
pictures and 2 field pictures that are sequential, not concurrent) and
in the other case the decoder output 4 frame pictures.

Regards, and Thanks,
Mark.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: What does ffmpeg do when packs switch?

Carl Eugen Hoyos-2


> Am 06.02.2020 um 13:14 schrieb Mark Filipak <[hidden email]>:
>
> What does ffmpeg do when packs switch from hard-telecine to soft-telecine right in the middle of a GOP?

It doesn’t “do” anything because it doesn’t know the concepts of hard- and soft-telecine.
It doesn’t “just” take what the decoders output, it assigns proper timestamps to the frames (as it does with all frames coming out of a decoder). If the input was soft-telecined, FFmpeg only sees progressive content, often 24000/1001 frames. Hard-telecined means 30000/1001 frames, the telecine effect can be undone if done properly.
If the input contains both soft- and hard-teleconference content, FFmpeg sees variable framerate input (which it actually is).

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: What does ffmpeg do when packs switch?

Mark Filipak
On 02/06/2020 10:05 AM, Carl Eugen Hoyos wrote:

Thanks, Carl,

>> Am 06.02.2020 um 13:14 schrieb Mark Filipak <[hidden email]>:
>>
>> What does ffmpeg do when packs switch from hard-telecine to soft-telecine right in the middle of a GOP?
>
> It doesn’t “do” anything because it doesn’t know the concepts of hard- and soft-telecine.
> It doesn’t “just” take what the decoders output, it assigns proper timestamps to the frames (as it does with all frames coming out of a decoder). If the input was soft-telecined, FFmpeg only sees progressive content, often 24000/1001 frames. Hard-telecined means 30000/1001 frames, the telecine effect can be undone if done properly.
> If the input contains both soft- and hard-teleconference content, FFmpeg sees variable framerate input (which it actually is).

Does ffmpeg automatically apply detelecine when telecine is encountered?
Or does the user need to specify the detelecine filter
(ffmpeg.org/ffmpeg-filters.html#detelecine)?

The filter has a 'pattern' option.
I know how to use 'top_field_first' & 'repeat_first_field' to determine
whether the encoder applied 'pattern'='23' or 'pattern'='32', but ffmpeg
seems to have no way to report packet metadata.
How is a script to know whether the encoder used '23' or '32'?
What happens if 'pattern' is wrong?
What happens if 'pattern' is null?

Thanks again,
Mark.
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".
Reply | Threaded
Open this post in threaded view
|

Re: What does ffmpeg do when packs switch?

Carl Eugen Hoyos-2


> Am 06.02.2020 um 23:27 schrieb Mark Filipak <[hidden email]>:
>
> On 02/06/2020 10:05 AM, Carl Eugen Hoyos wrote:
>
>
>>> Am 06.02.2020 um 13:14 schrieb Mark Filipak <[hidden email]>:
>>>
>>> What does ffmpeg do when packs switch from hard-telecine to soft-telecine right in the middle of a GOP?

>> It doesn’t “do” anything because it doesn’t know the concepts of hard- and soft-telecine.
>> It doesn’t “just” take what the decoders output, it assigns proper timestamps to the frames (as it does with all frames coming out of a decoder). If the input was soft-telecined, FFmpeg only sees progressive content, often 24000/1001 frames. Hard-telecined means 30000/1001 frames, the telecine effect can be undone if done properly.
>> If the input contains both soft- and hard-teleconference content, FFmpeg sees variable framerate input (which it actually is).
>
> Does ffmpeg automatically apply detelecine when telecine is encountered?

No, as the inverse telecine process is (while theoretically perfect) in general not 100% accurate, it needs user interaction (actually the decision which filter should be used).

> Or does the user need to specify the detelecine filter (ffmpeg.org/ffmpeg-filters.html#detelecine)?

This is one of three inverse telecine filters: It can only be used for absolutely perfect input that contains no deviations in the telecine rhythm: Such content is very rare, therefore this filter can only be used after (or before) careful visual inspection of the whole input (or if you know the input because you created it yourself). It cannot be used for dvb input, it can definitely not be used for every dvd. Additionally, it needs trial-and-error for the sequence start.

You have already mentioned one alternative, the pullup filter which originated a long time ago in the MPlayer project. The third (and possibly most sophisticated) filter to invert the telecine process is the fieldmatch filter, see its documentation for more information.

A few possibly unrelated and useless comments:
I don’t think you mentioned before this message that you actually want to inverse telecine. I suspect we would both have saved some time if you had.
Some of the video engineers who come here for very specific questions that are very difficult to understand have their knowledge from the analog (video) world. Since FFmpeg does not deal with analog video, most assumptions do not hold.

Carl Eugen
_______________________________________________
ffmpeg-user mailing list
[hidden email]
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
[hidden email] with subject "unsubscribe".