VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Hello.
    I have a PAL TFF 1080i mpeg2 TV capture .mpg source and wish to convert it to 576i (yes "i" so as not to lose "motion fluidity") h.264/.mp4.
    I also have similar sources from other TV channels as captured h.264/.mp4.

    I have used avisynth for years to resize by deinterlacing/resizing/re-interlacing.
    Code:
    # LAST is deinterlaced to double framerate using QTGMC ie incoming is 50fps progressive
    AssumeTFF() #choose the SAME field order like before deinterlacing
    Blur(0,0.5).SeparateFields().SelectEvery(4,0,3).Weave()   #reinterlace PAL TFF from from PAL 576p50 assuming original source was TFF
    AssumeTFF() #choose the SAME field order like before deinterlacing
    AssumeFPS(25) >> "%avs1%"
    Is it possible to re-interlace natively in ffmpeg ?

    So far I have this in the commandline to resize from PAL TFF 1080i into PAL 576p50, but of course it is now progressive:
    Code:
    "%ffmpegexex64%" -loglevel error -i "%inputfile_1080i%" -map_metadata -1 -an -sws_flags lanczos -filter:v yadif=1:0:0,setdar=dar=16/9,scale=720:576,colormatrix=bt709:bt601,unsharp -r 50
    Can some kind soul please indicate how to use ffmpeg commandline to reinterlace the PAL 576p50 into PAL TFF 576i25.
    Quote Quote  
  2. Dinosaur Supervisor KarMa's Avatar
    Join Date
    Jul 2015
    Location
    US
    Search Comp PM
    Why can't you keep it at 50fps, as going to 25i will just cut the vertical information in half while doing nothing for "motion fluidity" compared to 50fps.
    Quote Quote  
  3. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    I'd thought of that too.
    - media player handles 576i (not P50)
    - TV handles 576i (not P50)

    I could keep it as 1080i however the desired result of 576i .mp4 file is much smaller and retains "motion fluidity"
    Quote Quote  
  4. -flags +ildct+ilme
    Quote Quote  
  5. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Originally Posted by smrpix View Post
    -flags +ildct+ilme
    Thanks. I did some goggling and testing and there were a few more settings to set, since the re-interlacing step was also needed
    Code:
    "tinterlace=4:flags=vlpf" and ":interl=0:in_color_matrix=bt709:out_color_matrix=bt601"
    This seems to do the trick, piping to x264 for encoding (some time ago I saw problems with ffmpeg interlaced h.264 encoding whereas x264 worked) :

    Code:
    set PARF1fc=.\framecount.txt
    "C:\software\mediainfo\mediainfo.exe" --Inform=Video;%%FrameCount%% "%inputfile_1080i%" > "%PARF1fc%"
    FOR /F "usebackq tokens=1" %%G IN ( "%PARF1fc%" ) DO SET FRAMES=%%G
    DEL "%PARF1fc%"
    REM --frames "%FRAMES%" 
    
    "%ffmpegexex64%" -loglevel error -i "%inputfile_1080i%" -map_metadata -1 -an -sws_flags lanczos+accurate_rnd+full_chroma_int+full_chroma_inp -filter:v yadif=1:0:0,setdar=dar=16/9,scale=720:576:interl=0:in_color_matrix=bt709:out_color_matrix=bt601,unsharp,tinterlace=4:flags=vlpf -r 25 -flags +ildct+ilme -ildctcmp satd -top 1 -f yuv4mpegpipe - | "%X264EXEx64%" - --stdin y4m --thread-input --threads 8 --frames "%FRAMES%" --preset slow --interlaced --tff --profile high --level 4.1 --no-cabac --crf 18 --sar 64:45 --colormatrix bt470bg -o "%PARtemph264%"
    Last edited by hydra3333; 6th Jan 2016 at 00:53.
    Quote Quote  
  6. Albeit tinterlace is newer and recommended filter, older http://ffmpeg.org/ffmpeg-filters.html#interlace should work also:

    Code:
    interlace=lowpass=0:scan=tff
    vertical lowpass may give suboptimal results - you can disable it and give a chance to other approaches (at least i prefer sometimes to control how it is applied).
    Quote Quote  
  7. Member hydra3333's Avatar
    Join Date
    Oct 2009
    Location
    Australia
    Search Comp PM
    Originally Posted by pandy View Post
    and give a chance to other approaches (at least i prefer sometimes to control how it is applied).
    OK. What do you use instead ?
    Quote Quote  
  8. Originally Posted by hydra3333 View Post
    Originally Posted by pandy View Post
    and give a chance to other approaches (at least i prefer sometimes to control how it is applied).
    OK. What do you use instead ?
    Both - depends what is target for aliasing reduction but usually some tricks - it can be more refined trough http://avisynth.nl/index.php/External_filters#Anti-aliasing - vertical low pass filter implemented in ffmpeg is quite crude in terms how it reducing vertical resolution...
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!