Page 1 of 2
ffmpeg Telecine features
Posted: Mon Jan 27, 2020 1:41 am
by BernH
It would be great to have GUI/Encoder access to the telecine filters in ffmpeg for proper framerate conversions, without having to use a custom ffmpeg encoder.
And of corurse the fieldmatch, deinterlace and decimate filters for inverse telecine framerate conversions
Re: ffmpeg Telecine features
Posted: Mon Jan 27, 2020 10:40 am
by emcodem
Hi Bern,
in ffastrans we typically don't work with ffmpeg filters but avisynth instead for this kind of usecase. This way you also don't need to use a custom ffmpeg but just a custom avisynth which makes your life somewhat easier.
To be honest, personally i have no experience at all with telecine and reverting it, just know how it works and where it is used, so i could not design a nice processor for it, additionally i don't have anything thats needed for testing the final result: some sources; reference material etc...
Maybe @admin has some more thoughts on this
Re: ffmpeg Telecine features
Posted: Mon Jan 27, 2020 1:51 pm
by BernH
It is a pretty important feature in an advanced transcoding system. The most commonly used variants here in North America would be in converting between 23.976p/29.97i, and 24p/29.97i, as a lot of material is produced at 23.976p or 24p, but broadcast is 29.97i, so telecine is the correct way to convert. Other methods do not allow for reversal of the process. There is a pretty good explanation of the theory on Wikipedia if you need a reference as to what should be visible in the given frames.
I would be happy to help in evaluating this if you are inclined to pursue it. I can provide you with some sample footage, either either real or computer generated, in both 23.976 and the same footage already properly telecinied as a reference in Media Composer, although the generated variants are probably easier to see what is happening for evaluation purposes.
Since the filters already exist in ffmpeg and avisynth, and wouldn't require re-doing the math yourself, it may not be too much more complicated than giving access to them in the GUI, but of course I am not the programmer and architect of FFastrans, so I would defer to you on that point.
Re: ffmpeg Telecine features
Posted: Mon Jan 27, 2020 3:44 pm
by emcodem
Having in mind that we currently need to concentrate on finishing Version1, we could currently only start on that topic with a little help from you.
What you could do is to get out which avisynth plugin is the one we should go for and maybe additionally, find out which "userinputs" the GUI of such a processor should have.
Do you know how to work with avisynth stuff?
https://github.com/pinterf/TIVTC/releases
Re: ffmpeg Telecine features
Posted: Mon Jan 27, 2020 4:26 pm
by BernH
I haven’t done a lot with avisynth, but I am willing to dig into this and try to figure out what will work.
I understand that this may not be a priority for v1.0, but perhaps it could make it into a future release if I can direct you in the right direction.
Re: ffmpeg Telecine features
Posted: Mon Jan 27, 2020 6:28 pm
by admin
Hi BernH,
I totally agree with you that this is a kind of feature FFAStrans should incorporate. But as emcodem points out there is very little experience in the team with this method. However, it is much easier to add this feature as an AviSynth filter than as an ffmpeg filter option. Currenty FFAStrans has very limited user options when it comes to ffmpeg filtering as this logic is not currently featured in FFAStrans core code. So if you would like to help us out with some AviSynth examples it should be trivial to add it in the "FPS Convert" filter.
-steinar
Re: ffmpeg Telecine features
Posted: Mon Jan 27, 2020 7:16 pm
by BernH
Hi Steinar
I don’t mind trying to help out with this at all. I’ll see what I can come up with via avisynth and let you know accordingly.
I work at a video post production facility and have to deal with framerate conversions for broadcast delivery on a daily basis. We are currently using Telestream Episode for most of our transcoding, with the exception of Telecine conversions as Media Composer does a much better job, but with Episode being discontinued, we have looked at Vantage and Selenio as potential replacements. I recently came across FFastrans and was delighted to see that it is offering a similar kind of “intelligent workflow” that these solutions offer.
That said, I do have access to most of the current editing and finishing softwares that I can also use to help with analysis of any media produced and would love to try to help your project along if I can, as it shows a lot of potential.
As I said previously, I am not a programmer, (I’m an electronics tech and computer tech by trade), but have a good handle on what is useful to the end user in this industry. I have been working in various facets of the pro video industry for almost 30 years, and even grew up around the industry thanks to my father and grandfather.
Once again I am happy to help if I can.
Re: ffmpeg Telecine features
Posted: Mon Jan 27, 2020 9:24 pm
by emcodem
Hey @BernH
sounds fantastic that you are willing to help us, your experience sounds like we want to employ you right away if we could
On our side we are mostly working for Broadcsters, those have slightly different workflows and equipment than your house. Thats also why we dont need telecine, it is just something a broadcaster does not do on it's own; instead we receive the movies that were 24fps at some point in time already prepared from companies like yours
OK, back to the topic. It would be cool if we could get you started on using avisynth for this topic and for you a whole new cool world would open up.
To get started the first time, ignore that ffastrans exists and follow these steps:
http://avisynth.nl/index.php/First_script
For me it felt a little strange what happens: you open a file named .avs in windows media player (or similar) and it actually plays a video.
Once you were able to digest this shock, you can start playing around with .avs files just as they say in the guide.
First thing i need you to know is to be able to work with avisynth scripts, second would be to install plugins; first plugin would be the ffms2 plugin (that comes with ffastrans too, which in your script is called ffmpegsource(___YOURFILE___)
Small tipp, windows media player often likes that you have converttoyuy2() as last line in your script.
Please let me know any doubts!
Re: ffmpeg Telecine features
Posted: Mon Jan 27, 2020 10:32 pm
by BernH
Thanks Guys,
I'll see what I can figure out. I had started looking at avisynth a while ago when I thought I was going to have to do a rather tricky framerate conversion, but the job never ended up happening so I never got past the initial look and trying to figure out what the avs script was actually doing. Now that I have another reason to go back at it, I hope that I can make some more progress. Unfortunately I can't commit to a particular time frame, as I am deep into post production on a TV series right now, so this will be done in my spare time, but since this is not a milestone for V1.0, it shouldn't slow you down.
I'll keep you posted as to what I find.
Re: ffmpeg Telecine features
Posted: Fri Jan 31, 2020 3:28 pm
by BernH
Hi Guys,
I have been working on the avisynth hard telecine scripts, and think I have figured out most of the ones I can think of, with just a couple of obscure ones for old film stumping me a bit. These ones actually require a double treatment that is a little complicated.
I also have a fixed cadence inverse working for 2:3, 3:2, and 2:3:3:2, and am proceeding to try to get a clean inverse of the other stranger variations working, such as the so called "Euro" pulldown. I am also hoping to try to get an IVTC figured out for footage that uses a non-standard or broken telecine cadence, but this one may take a while to figure out if I can.
Surprisingly, these snippets are much easier to get working than I thought they would be.
The real challenge will be use less than perfect source footage to see if they still work.
I have a question though regarding audio and your processing of it in the variations that will require a slight speed change for things like a 24p source going to 25 or 23.976, requiring a 0.1%, 4.16%, or 4.27% speed adjustment.(hopefully with pitch correcton)
The question is, do you want me to tackle the audio for them as well in the scripts with the video or do you already have something for these adjustments in place?
I also have a question regarding colour treatment for the patterns that cross ntsc/pal boundaries. That question is once again, do you want me to try to figure out the slight colour space adjustments or do you already have a mechanism for this done?
When I get it finalized and get it tested with some real footage instead of the computer generated samples I am using to verify patterns, I will send a zip file to you of the pertenent script snippets and the reference material I am using to make these for your perusal, along with any recommendations i have regarding things that should be made available in the GUI.