You would have to disable the low pass (no way to do that), or use -vf tinterlace instead which allows you to enable/disable low pass
https://www.ffmpeg.org/ffmpeg-filters.html#tinterlace
Or avisynth
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 31 to 59 of 59
Thread
-
-
ops I did it again: I'try, addin Tinterlace, with
Code:ffmpeg.exe -y -i v:\test\c0027.mxf -c:v libx264 -profile:v high422 -level:v 4.1 -g 33 -bf 1 -crf 18 -flags +ildct+ilme -top 1 -x264opts tff=1 -filter_complex yadif=1:0,scale=w=720:h=576:flags=lanczos,colormatrix=bt709:bt601,Tinterlace -pix_fmt yuv422p -aspect 16:9 v:\out5.mp4
but this is wrog: produce image of 720x1152 ^^ -
You need mode 4 for tff . tinterlace=4
Code:-filter_complex yadif=1:0,scale=w=720:h=576:flags=lanczos,colormatrix=bt709:bt601,tinterlace=4
-
you mean forget about interlace ? 50p ?
that's one of the many problem with interlace, you generally need to lowpass it , farther reducing already low effective vertical resolution in motion
output from yadif=1:0 is double framerate (you convert frames to fields when you re-interlace) . Note the yadif syntax is different for ffmpeg than avisynth
https://www.ffmpeg.org/ffmpeg-filters.html#yadif-1 -
Code:
ffmpeg.exe -y -i v:\test\c0027.mxf -c:v libx264 -profile:v high422 -level:v4.1 -g 33 -bf 1 -crf 18 -flags +ildct+ilme -top 1 -x264opts tff=1 -filter_complex yadif=1:0,scale=w=720:h=576:flags=lanczos,colormatrix=bt709:bt601,tinterlace=4 -pix_fmt yuv422p -aspect 16:9 v:\out5.mp4
-
Yes, it results in double fps, but only in the header. Looks like filter is broken. Supposed to give you 1/2 frame rate from 50p . You might be able to force the fps using -r . But I wouldn't use it like that, you need to lowpass interlaced content
‘interleave_top, 4’
Interleave the upper field from odd frames with the lower field from even frames, generating a frame with unchanged height at half frame rate. -
azz ok, but I think have some problem with a .mp4 of 50fps
is there a way to have a "normal" 25fps? -
Code:
ffmpeg.exe -y -i v:\test\c0027.mxf -c:v libx264 -profile:v high422 -level:v 4.1 -g 33 -bf 1 -crf 18 -flags +ildct+ilme -top 1 -x264opts tff=1 -filter_complex yadif=1:0,scale=w=720:h=576,colormatrix=bt709:bt601,tinterlace=4 -sws_flags lanczos -pix_fmt yuv422p -aspect 16:9 -r 25 v:\out6.mp4
(p.s for confronting I use the C0027.mxf is that a HD same image of a C0027_b.mxf SD that I use to see a pure SD image)Last edited by marcorocchini; 15th Jul 2014 at 03:07.
-
-
yes I know
I have upload:
https://www.dropbox.com/s/niihkqnntjh2els/IMX169.mxf
and this:
https://www.dropbox.com/s/7nx4i1dcql02wmv/HD169.MXF
They are one HD and one SD (IMX-608x576 to crop 32 lines upper) of the same image in the same time
The IMX169.MXF if for "reference"
I try to understand what is the correct method to have a decent SD from HD -
I have apply (sorry I past the batch encoding line) this:
Code:v:\automazioneclip\core\ffmpeg.exe -y -i "%CD%\%~n1.mxf" -map_channel 0.1.0 -map_channel 0.2.0 -c:v libx264 -profile:v high422 -level:v 4.1 -g 33 -bf 1 -crf 18 -flags +ildct+ilme -top 1 -x264opts tff=1 -filter_complex yadif=1:0,scale=w=720:h=576:flags=lanczos,colormatrix=bt709:bt601,tinterlace=4 -pix_fmt yuv422p -aspect 16:9 -r 25 -c:a libvo_aacenc -b 256k %WorkFolder%\%~n1EncodingDaFileMXF_HD_originale_A_MP4SD.mp4
obaiting the "wrong" HD-->SD conversion HD169EncodingDaFileMXF_HD_originale_A_MP4SD.mp4
and, as reference, the standard SD (IMX50) file https://www.dropbox.com/s/niihkqnntjh2els/IMX169.mxf
Code:v:\automazioneclip\core\ffmpeg.exe -y -i "%CD%\%~n1.mxf" -map_channel 0.1.0 -map_channel 0.1.1 -vf crop=720:576:0:32,scale=interl=1:in_range=tv:out_range=tv -pix_fmt yuv422p -c:v libx264 -profile:v high422 -level:v 3 -g 33 -bf 1 -crf 18 -flags +ilme+ildct -top 1 -x264opts tff=1 -c:a libvo_aacenc -b 256k -aspect 16:9 %WorkFolder%\%~n1EncodingDaFileMXForiginale.mp4
in effects resultant HD-->SD file have a lot of aliasingLast edited by marcorocchini; 15th Jul 2014 at 03:42.
-
I already explained tinterlace is bad without low passing. See the animated gif. (The left was -vf interlace, right was -vf tinterlace) . Remember, sharp=bad for interlaced content. It's a tradeoff. If you want to retain details, sharpness , then you have to live with the aliasing and twittering lines
For ffmpeg, I would use -vf interlace instead of -vf tinterlace, because it low passes by default. In motion there is a lot less aliasing and buzzing lines. tinterlace does have a low pass mode, but then image is softer. Recall you wanted to use different resizer (lanczos), because image was soft, blurry ? That's because of the low passing and soft resize. You need it slightly blurry for interlaced SD.
And for your "test" shots, you need motion, like a camera pan. A static shot won't reveal as many problemsLast edited by poisondeathray; 15th Jul 2014 at 08:32.
-
thanks poison, so that I have remove the Tinterlace=4 and replace with interlace:
Code:v:\automazioneclip\core\ffmpeg.exe -y -i "%CD%\%~n1.mxf" -map_channel 0.1.0 -map_channel 0.2.0 -c:v libx264 -profile:v high422 -level:v 4.1 -g 33 -bf 1 -crf 18 -flags +ildct+ilme -top 1 -x264opts tff=1 -filter_complex yadif=1:0,scale=w=720:h=576:flags=lanczos,colormatrix=bt709:bt601,interlace -pix_fmt yuv422p -aspect 16:9 -r 25 -c:a libvo_aacenc -b 256k %WorkFolder%\%~n1EncodingDaFileMXF_HD_originale_A_MP4SD.mp4
-
I don't think ffmpeg does for lanczos. You can use avisynth if you want more parameters, taps
Or you can try tinterlace with lowpass
You're not going to get sharp fine details without aliasing and "line twittering" if you use interlace. It's impossible. Sure, you can use QTGMC or heavy postprocessing for playback, but nobody has that for their TV set -
Code:
ffmpeg.exe -y -i hd169.mxf -c:v libx264 -profile:v high422 -level:v 4.1 -g 33 -bf 1 -crf 18 -flags +ildct+ilme -top 1 -x264opts tff=1 -filter_complex yadif=1:0,scale=w=720:h=576:flags=lanczos,colormatrix=bt709:bt601,interlace -r 25 -pix_fmt yuv422p -aspect 16:9 z:\out.mp4
for kindness how can I modify it to encode Tinterlace with low pass? -
It's in the link above for Tinterlace
Code:tinterlace=4:flags=low_pass_filter
It will give almost identical results as -vf interlace.
You can't have the best of everything with interlace. Interlace is a compromise. Either choose aliasing/twittering artifacts, or soft. -
mmm honestly seems a little softer, can I try with avisynth? but I don't know how to do
I have download and install all the pack of QTGMC but I don't know what is the script :=(
maybe: ?
FFVideoSource("v:\mxf\hd169.mxf")
QTGMC( Preset="Slow" )
AddBorders(0,0,0,1)
GaussResize(720,576,-1,-1,-1,0,P=41)
ColorMatrix(mode="Rec.709->Rec.601")
#AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()
SelectEven() -
QTGMC is for deinterlacing. Even with aliased video, it will look better for playback. That doesn't really help you produce a video because when you downscale and re-interlace, you re-introduce the problems. The main problem is interlace. If you used QTGMC and kept it progressive - yes it would look fantastic
Choose either sharp details with aliasing, or soft , or something in between. It's up to you. There is no way around it for interlace. Most broadcasters choose soft with lowpass -
I'm understand it's necessary a compromise, so I assume that commandline is almost appropriate
ffmpeg.exe -y -i hd169.mxf -c:v libx264 -profile:v high422 -level:v 4.1 -g 33 -bf 1 -crf 18 -flags +ildct+ilme -top 1 -x264opts tff=1 -filter_complex yadif=1:0,scale=w=720:h=576:flags=lanczos,colormat rix=bt709:bt601,tinterlace=4:flags=low_pass_filter -r 25 -pix_fmt yuv422p -aspect 16:9 z:\out.mp4
can I add a little little of sharp? -
you can try adding a sharpening filter
https://www.ffmpeg.org/ffmpeg-filters.html
maybe smartblur with negatve luma value, or unsharp with positive value
https://www.ffmpeg.org/ffmpeg-filters.html#unsharp
https://www.ffmpeg.org/ffmpeg-filters.html#smartblur-1
The more sharpening you add, the more halos and risk of moire/twittering affects for interlaced video
Or instead of the default low pass, maybe try your own vertical blur, so you can modulate it . e.g. maybe 0.4 or 0.3 px vertical blur
Another good compromise is avisynth's Iresize. It retains more detail than ffmpeg's low pass, but only minimal aliasing
Code:FFVideoSource() Colormatrix(mode="rec.709->rec.601", interlaced=true) IResize(720,576) function IResize(clip Clip, int NewWidth, int NewHeight) { Clip SeparateFields() Shift=(GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0) E = SelectEven().Spline36resize(NewWidth, NewHeight/2, 0, Shift) O = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0, -Shift) Ec = SelectEven().Spline36Resize(NewWidth, NewHeight/2, 0, 2*Shift) Oc = SelectOdd( ).Spline36Resize(NewWidth, NewHeight/2, 0, -2*shift) Interleave(E, O) IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last Weave() }
-
It's just a function. Copy & paste it from post #53 (the bottom part of the script)
If you still want to sharpen it, you can add a bit more, but I would be conservative. Your IMX file is oversharpened in camera (halos)
You have to separate the fields before you apply any sharpening (you can't sharpen interlaced video directly). The ffmpeg sharpen might not be doing it correctly (needs interlaced flag) -
If you still wanted to sharpen it a little bit, you have to separate the fields. Most sharpen filters are not temporal (work only on current frame), but you might as well get into the habit of grouping odd/even fields.
Just change both entries of sharpen(0.1) , but I wouldn't go above 0.2 for interlaced video . You can replace sharpen() ith more exotic "smarter" sharpening algorithms, but not all work in 422 (most only work in YV12, 420)
Code:FFVideoSource() Colormatrix(mode="rec.709->rec.601", interlaced=true) IResize(720,576) AssumeTFF() SeparateFields() Ev=SelectEven().sharpen(0.1) Od=SelectOdd().sharpen(0.1) Interleave(Ev,Od) Weave()
Last edited by poisondeathray; 15th Jul 2014 at 14:48.
-
Code:
FFVideoSource("v:\C0034.mxf") ColorMatrix(mode="Rec.709->Rec.601") IResize(720,576) function IResize(clip Clip, int NewWidth, int NewHeight) { Clip SeparateFields() Shift=(GetParity() ? -0.25 : 0.25) * (Height()/Float(NewHeight/2)-1.0) E = SelectEven().Spline36resize(NewWidth, NewHeight/2, 0, Shift) O = SelectOdd( ).Spline36resize(NewWidth, NewHeight/2, 0, -Shift) Ec = SelectEven().Spline36Resize(NewWidth, NewHeight/2, 0, 2*Shift) Oc = SelectOdd( ).Spline36Resize(NewWidth, NewHeight/2, 0, -2*shift) Interleave(E, O) IsYV12() ? MergeChroma(Interleave(Ec, Oc)) : Last Weave() } AssumeTFF() SeparateFields() Ev=SelectEven().sharpen(0.20) Od=SelectOdd().sharpen(0.20) Interleave(Ev,Od) Weave()