FFMpeg problem using fieldmatch and decimate filters to IVTC

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

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Nicholas Robbins


> I didn¹t solve it yet, but I have one more observation. Placing

> ³fps=30001/1001² in front of the items of the filtergraph sent in my
> previous reply (ie: ffmpeg -i Œlong.sample.vob¹  -vf ³fps=30001/1001,
> fieldmatch=order=tff, fps=fps=24000/1001² -pix_fmt yuv420p -c:v libx264
> -preset slower -tune film -crf 18 -maxrate 2100k -bufsize 1835k
> Œlong.sample.m4v¹) appears to make the passages that were incorrectly
> rendered using the previous command line render correctly, as well as to
> ruin the transcoding of passages that were previously rendered correctly
> (nearly all of the sample). If it¹s possible to cause ffmpeg to switch
> between the two modes for appropriate passages, then successful
> transcoding for the entire clip should result. However, I¹ll admit that
> the circumstance seems incorrect altogether to me. Even so, if such
> automatic switching between the two modes is indeed possible, I¹d
> certainly like to know how to manage it.
>
> Laine Lee

A couple of observations:

1) fieldmatch is supposed to be paired with decimate not "-r".
2) Because of this fieldmatch/decimate combo throws out frame timing information so you don't want to use it on VFR video which you have.


Have you tried:

-vf pullup,dejudder,idet,yadif=deint=interlaced:mode=1,fps=12000/1001


In theory that should do what you want.


-Nick
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Carl Eugen Hoyos
In reply to this post by llee782
L. Lee <llee040 <at> sbcglobal.net> writes:

> ffmpeg -i 'long.sample.vob'

> -vf "fieldmatch=order=tff, fps=fps=24000/1001"

This is definitely not supposed to work (and if
you found documentation somewhere suggesting
this, please tell us!)

If you have a video file that cannot be inverse
telecined with "-vf pullup -r 24000/1001" please
provide it!

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

llee782


On 5/15/14, 9:06 AM, "Carl Eugen Hoyos" <[hidden email]> wrote:

>L. Lee <llee040 <at> sbcglobal.net> writes:
>
>> ffmpeg -i 'long.sample.vob'
>
>> -vf "fieldmatch=order=tff, fps=fps=24000/1001"
>
>This is definitely not supposed to work (and if
>you found documentation somewhere suggesting
>this, please tell us!)
>
>If you have a video file that cannot be inverse
>telecined with "-vf pullup -r 24000/1001" please
>provide it!
>

One of the benefits of doing this as a hobby rather than as a means of
seeking to provide a source of income, I guess, is that I¹m interested in
trying whatever combinations I can find that will produce an output file
from an input file. However, in this case, I simply combined ffmpeg
documented examples of the use of the fps option with the filtergraph for
detelecine, and with Steve¹s example, the output is much closer to what is
desirable than what I get by applying ³-vf pullup -r 24000/1001².

But I certainly don¹t intend to get into a debate about this. I don¹t
claim to be an authority on this sort of transcoding process. Steve made
his examples publicly available, and anyone can download and test my
suggested filter commands for inverse telecine with the latest build of
ffmpeg on any system and compare results to those achieved through the use
of a conventional method. If you see an output video file created using
one of my suggestions that looks smoother than what you get when you use
³-vf pullup -r 24000/1001² then use mplayer or something else that will
let you step through the output one frame at a time as well as analyze the
statistical data. That will hopefully provide information about what is
happening and why, and whether it is acceptable as well as whether methods
of improving the strategy may be needed.

I still believe that the information and evidence I¹ve provided supports
the assertion that ffmpeg has not yet attained the level of success for
applying inverse telecine to video that is possible through the use of
MEncoder. Use my previously posted MEncoder command line suggestions on
the contributed source material to compare with the results of ffmpeg¹s
³-vf pullup -r 24000/1001² or any of the others that I¹ve already
submitted and judge for yourself. If you have trouble obtaining Steve¹s
sample passage, I¹m sure he will be willing to help find a way to
accommodate you.

And having said all that, I have one more filtergraph suggestion that
seems to work about as well than any of those I previously suggested
(although it doesn¹t IMO approach the level of success achieved by using
the MEncoder conversion that I submitted), but this one definitely leaves
interlaced frames. The interesting thing is that it works at all and
achieves a different result from others. I think I may be able to find a
way to remove the remnants of interlacing eventually.

ffmpeg -i long.sample.vob  -vf "fps=60001/1001, fieldmatch=order=tff,
fps=fps=24000/1001" -pix_fmt yuv420p -c:v libx264 -preset slower -tune
film -crf 18 -maxrate 2100k -bufsize 1835k long.sample.m4v


Thanks.

Laine Lee


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Carl Eugen Hoyos
L. Lee <llee040 <at> sbcglobal.net> writes:

> I don¹t claim to be an authority on this sort
> of transcoding process.

Me neither, I live in PAL-country...

> Steve made his examples publicly available

He provided a short telecined and a much longer
sample that is mostly progressive.
The long sample shows A/V desync unrelated to
the inverse telecine filters, I opened ticket #3640.

If you have a sample that shows issues with FFmpeg's
inverse telecine filter, and particularly if it
works better with MEncoder, please upload it!

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

llee782


On 5/15/14, 2:47 PM, "Carl Eugen Hoyos" <[hidden email]> wrote:

>L. Lee <llee040 <at> sbcglobal.net> writes:
>
>> I don¹t claim to be an authority on this sort
>> of transcoding process.
>
>Me neither, I live in PAL-country...
>
>> Steve made his examples publicly available
>
>He provided a short telecined and a much longer
>sample that is mostly progressive.
>The long sample shows A/V desync unrelated to
>the inverse telecine filters, I opened ticket #3640.
>
>If you have a sample that shows issues with FFmpeg's
>inverse telecine filter, and particularly if it
>works better with MEncoder, please upload it!
>
>Carl Eugen

Please let me know how to upload or specifically where to get details
about how to upload. Thanks.

Laine Lee


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Carl Eugen Hoyos
L. Lee <llee040 <at> sbcglobal.net> writes:

> Please let me know how to upload or specifically
> where to get details about how to upload.

Either use http://www.datafilehost.com/ or read
https://ffmpeg.org/bugreports.html
(there is no filesize limit)

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

llee782
Thanks! I¹ll reply again once I have something uploaded. Thanks again.

Laine Lee

On 5/15/14, 4:39 PM, "Carl Eugen Hoyos" <[hidden email]> wrote:

>L. Lee <llee040 <at> sbcglobal.net> writes:
>
>> Please let me know how to upload or specifically
>> where to get details about how to upload.
>
>Either use http://www.datafilehost.com/ or read
>https://ffmpeg.org/bugreports.html
>(there is no filesize limit)
>
>Carl Eugen
>
>_______________________________________________
>ffmpeg-user mailing list
>[hidden email]
>http://ffmpeg.org/mailman/listinfo/ffmpeg-user


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

llee782
In reply to this post by Carl Eugen Hoyos
OK, I uploaded mencoder_sample_inverse_telecine.txt and
mencoder_sample_inverse_telecine.m4v

The example demonstrates accurate inverse telecine performed by mencoder for
the sample.vob file
submitted by the OP
(https://www.dropbox.com/sh/v9jp4pdxzad4a7g/AAC6RO34_w2CijriQRwD_Qc_a/sample
.vob). Apparently no robust method for doing this exists for ffmpeg.

Laine Lee

On 5/15/14, 4:39 PM, "Carl Eugen Hoyos" <[hidden email]> wrote:

> L. Lee <llee040 <at> sbcglobal.net> writes:
>
>>  Please let me know how to upload or specifically
>>  where to get details about how to upload.
>
> Either use http://www.datafilehost.com/ or read
> https://ffmpeg.org/bugreports.html
> (there is no filesize limit)
>
> Carl Eugen
>
> _______________________________________________
> ffmpeg-user mailing list
> [hidden email]
> http://ffmpeg.org/mailman/listinfo/ffmpeg-user


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Carl Eugen Hoyos
L. Lee <llee040 <at> sbcglobal.net> writes:

> OK, I uploaded mencoder_sample_inverse_telecine.txt
> and mencoder_sample_inverse_telecine.m4v

Why? (We are all able to test MEncoder.)

Please explain what's wrong with:
$ ffmpeg -i sample.vob -vf pullup -r 24000/1001 -strict -2 -qscale 2 out.mov
?
(which is of course using MEncoder's inverse
telecine technology so any difference is unlikely
to be related to it.)

The output file plays slightly out-of-sync, this
is a regression, not related to inverse telecine,
see ticket #3640.

Please don't top-post here, Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Carl Eugen Hoyos
Carl Eugen Hoyos <cehoyos <at> ag.or.at> writes:

> The output file plays slightly out-of-sync, this
> is a regression, not related to inverse telecine,
> see ticket #3640.

Please scratch this, there is no A/V desync for
this sample, I confused it with the longer one.

An alternative command is:
$ ffmpeg -i sample.vob -vf fieldmatch,decimate -strict -2 -qscale 2 out.mov

Sorry, Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

llee782
On 5/18/14, 4:45 PM, "Carl Eugen Hoyos" <[hidden email]> wrote:

>
> An alternative command is:
> $ ffmpeg -i sample.vob -vf fieldmatch,decimate -strict -2 -qscale 2 out.mov

I don¹t get acceptable results using that or any other command for
³long.sample.vob".
https://www.dropbox.com/sh/v9jp4pdxzad4a7g/AADbKVrJAvOXf3F9IAzR5WSha/long.sa
mple.vob

However, I get acceptable results using that command for ³sample.vob².
https://dl.dropboxusercontent.com/sh/v9jp4pdxzad4a7g/AAC6RO34_w2CijriQRwD_Qc
_a/sample.vob

I thought that the problem for both of these sample files was the same, so I
just sent my MEncoder results for the second that one because it¹s shorter.
In other words, I saw all the tests that the O.P. Included for that shorter
sample, and assumed that because the MEncoder command I uploaded for the
shorter sample works well for me for both, it might be of interest. I
apologize for that. But I¹m still unable to successfully apply inverse
telecine to the longer sample using anything I¹ve tried for ffmpeg. Have you
found a successful way to apply inverse telecine for the longer sample?
Thanks.

Laine Lee


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Carl Eugen Hoyos
L. Lee <llee040 <at> sbcglobal.net> writes:

> > An alternative command is:
> > $ ffmpeg -i sample.vob -vf fieldmatch,decimate
> > -strict -2 -qscale 2 out.mov
>
> I don¹t get acceptable results using that

Of course not.

I believe I did not suggest above command line for
long.sample.vob, sorry if I did.
The long sample has changing frame rate, the
fieldmatch filter expects constant frame rate.
Please use the pullup filter for the long sample.

> or any other command for ³long.sample.vob".

What did you test?

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

llee782
On 5/23/14, 9:39 AM, "Carl Eugen Hoyos" <[hidden email]> wrote:


>> or any other command for ³long.sample.vob".
>
>What did you test?
>
>Carl Eugen

I tried several fieldmatch variations such as:

ffmpeg -i long.sample.vob -vf
“fps=60001/1001,fieldmatch,yadif=deint=interlaced,decimate,fps=24000/1001"
-pix_fmt yuv420p -c:v libx264 -preset slower -tune film -crf 18 -x264opts
keyint=40:bitrate=2100:qpmin=8:qpmax=38:qpstep=4 long.sample.m4v

But just changing the frame rate seemed to have as much success:

ffmpeg -i long.sample.vob -vf fps=24001/1001 -c:v libx264 -preset veryfast
-level 41 -tune film -crf 22 -c:a libfdk_aac long.sample.m4v

What didn’t work very well was the filtergraph without “fps=60001/1001” at
the beginning:

-vf “fieldmatch,yadif=deint=interlaced,decimate,fps=24000/1001”

Laine Lee



_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Carl Eugen Hoyos
L. Lee <llee040 <at> sbcglobal.net> writes:

> I tried several fieldmatch variations such as:

To quote myself (May 18th):
[quote]
Please explain what's wrong with:
$ ffmpeg -i sample.vob -vf pullup -r 24000/1001 -strict -2 -qscale 2 out.mov
?
[/quote]

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Nicholas Robbins
In reply to this post by llee782
Have you tried:

-vf pullup,dejudder,idet,yadif=deint=interlaced:mode=1


and if your player can't handle variable frame rate video add a "-r 120000/1001" or whatever is the highest your device can deal with
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Carl Eugen Hoyos
Nicholas Robbins <nickrobbins <at> yahoo.com> writes:

> Have you tried:
>
> -vf pullup,dejudder,idet,yadif=deint=interlaced:mode=1

Just don't use it with mov output...

(Do really all "typical" players accept avi files with
240fps?)

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Nicholas Robbins


> On Monday, May 26, 2014 7:36 AM, Carl Eugen Hoyos <[hidden email]> wrote:

> > Nicholas Robbins <nickrobbins <at> yahoo.com> writes:
>
>>  Have you tried:
>>
>>  -vf pullup,dejudder,idet,yadif=deint=interlaced:mode=1
>
> Just don't use it with mov output...

What can't mov do? vfr?



> (Do really all "typical" players accept avi files with
> 240fps?)

Where did you get 240 fps? Is his source 120 frames/s interlaced? I thought it was a mixture of 30fps interlaced 30fps progressive and 30 fps telecined from 24fps


Nick
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

Carl Eugen Hoyos
Nicholas Robbins <nickrobbins <at> yahoo.com> writes:

> >>  -vf pullup,dejudder,idet,yadif=deint=interlaced:mode=1
> >
> > Just don't use it with mov output...
>
> What can't mov do? vfr?

Yes, the libavformat mov muxer always produces cfr output.

> > (Do really all "typical" players accept avi files with
> > 240fps?)
>
> Where did you get 240 fps?

http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3019/
Afaict, this is an oridinary telecined transport stream
from dvb (or equivalent).

Carl Eugen

_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

llee782
In reply to this post by Carl Eugen Hoyos


On 5/26/14, 3:23 AM, "Carl Eugen Hoyos" <[hidden email]> wrote:

> L. Lee <llee040 <at> sbcglobal.net> writes:
>
>>  I tried several fieldmatch variations such as:
>
> To quote myself (May 18th):
> [quote]
> Please explain what's wrong with:
> $ ffmpeg -i sample.vob -vf pullup -r 24000/1001 -strict -2 -qscale 2 out.mov
> ?
> [/quote]
>
> Carl Eugen

I¹m quite sure that was the first thing I tried, and on trying again, I have
the same results as before. Transcoding with that command yields duplicates
of every frame for most scenes in the clip. So I¹m again uncertain that we
are referring to the same clip. We already agreed about how to transcode the
short clip. Both are available at
https://www.dropbox.com/sh/v9jp4pdxzad4a7g/djUTH4OYcA and the one I¹m trying
to transcode now is the one named long.sample.vob. When I use the browser
widget in the interface to download to MM, the name of the resulting
download is ³long.sample.vob.mpg². I removed ³.mpg² from the name because of
what MediaInfo tells me that file contains.

Laine Lee







_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|

Re: FFMpeg problem using fieldmatch and decimate filters to IVTC

llee782
In reply to this post by Carl Eugen Hoyos
On 5/26/14, 7:24 AM, "Carl Eugen Hoyos" <[hidden email]> wrote:

>Nicholas Robbins <nickrobbins <at> yahoo.com> writes:
>
>> >>  -vf pullup,dejudder,idet,yadif=deint=interlaced:mode=1
>> >
>> > Just don't use it with mov output...
>>
>> What can't mov do? vfr?
>
>Yes, the libavformat mov muxer always produces cfr output.
>
>> > (Do really all "typical" players accept avi files with
>> > 240fps?)
>>
>> Where did you get 240 fps?
>
>http://samples.ffmpeg.org/ffmpeg-bugs/trac/ticket3019/
>Afaict, this is an oridinary telecined transport stream
>from dvb (or equivalent).
>
>Carl Eugen


I got good 1280 16X9 transcode results for this clip by using my standby:

ffmpeg -i NCIS-trim-2.ts -vf ³fieldmatch=order=tff:combmatch=none,
decimate, fps=fps=24000/1001, scale=1280:-1" -stats -pix_fmt yuv420p -c:v
libx264 -c:a copy -preset slower -tune film -crf 18 -x264opts
keyint=40:bitrate=2100:qpmin=8:qpmax=38:qpstep=4 NCIS-trim-2.detelecine.m4v

Laine Lee


_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
123