VideoHelp Forum
+ Reply to Thread
Results 1 to 11 of 11
Thread
  1. Member
    Join Date: Dec 2013
    Location: India
    Search PM
    Hi all,

    I need the FFMPEG command which could convert a 1080p to 1080i (both top bottom and bottom up) for H264 codec.
    Please help.


    Thank you
    Nitin
    Quote Quote  
  2. Member
    Join Date: Aug 2013
    Location: Central Germany
    Search PM
    Progressive video content will stay progressive video content. But you can tell the encoder to use the (adaptively-ignorant "fake") interlaced encoding mode.

    For a standalone x264 encoder, that would probably be --fake-interlaced. Unfortunately, I don't know how to pass this libx264 encoder option through ffmpeg; you might try: -x264opts "fake-interlaced=1" (no guarantee)
    Quote Quote  
  3. Member
    Join Date: Jun 2012
    Location: USA
    Search Comp PM
    Looks like adding -flags +ildct to your ffmpeg command still works.
    Quote Quote  
  4. Originally Posted by nitinsagar22 View Post
    Hi all,

    I need the FFMPEG command which could convert a 1080p to 1080i (both top bottom and bottom up) for H264 codec.
    video filter in fact

    http://ffmpeg.org/ffmpeg-all.html#interlace

    Code:
    ffmpeg -i source -vf "interlace=lowpass=0:scan=even(tff)odd(bff)"
    + http://forum.doom9.org/showthread.php?p=1506238#post1506238
    Quote Quote  
  5. Member
    Join Date: Aug 2013
    Location: Central Germany
    Search PM
    @ pandy:

    I believe the desired result is not a really interlaced video, but rather an "interlaced flagged, but effectively progressive encoded" video which is Blu-ray compatible and supported by x264 using MBAFF interlacing mode and progressive encoding for all MBs.

    Provided that I understood nitinsagar22 correctly...
    Quote Quote  
  6. Originally Posted by LigH.de View Post
    @ pandy:

    I believe the desired result is not a really interlaced video, but rather an "interlaced flagged, but effectively progressive encoded" video which is Blu-ray compatible and supported by x264 using MBAFF interlacing mode and progressive encoding for all MBs.

    Provided that I understood nitinsagar22 correctly...
    "convert" seem clear to me even being non English native but perhaps you are right - it is up to author to provide more details but in fact i see nothing wrong in converting progressive to interlace.
    Quote Quote  
  7. Member
    Join Date: Dec 2013
    Location: India
    Search PM
    Thanks @Pandy.
    Yes, i was willing to convert progressive to interlaced both in tff and bff.
    I have such requirement for one of my projects.
    Will try this code, is there any thread where i could find some advanced commands in ffmpeg for libx264.
    Also, any idea when will x265 encoder be available in ffmpeg?

    Thanks
    Quote Quote  
  8. Member
    Join Date: Dec 2013
    Location: India
    Search PM
    Hi,

    Small confusion here, the command works perfectly fine for me.
    But the problem is if i parse the generated content on a mediainfo like tool. Its still showing the scan type to be progressive whereas i was expecting interlaced tff there. Any reason why is it showing so?
    But the video playback is looking clearly to be like an interlaced video (checked on VLC)

    Mediainfo Video info shows as below:
    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L2.2
    Format settings, CABAC : Yes
    Format settings, ReFrames : 4 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 1mn 53s
    Bit rate : 576 Kbps
    Width : 640 pixels
    Height : 360 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 12.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 0.209
    Stream size : 7.81 MiB (85%)
    Writing library : x264 core 142 r2409 d6b4e63


    Thanks
    Quote Quote  
  9. Works for me:

    Code:
    @ffmpeg -i %1 -c:v libx264 -preset fast -profile:v high -crf 18 -x264opts "level=4.1:bitrate=1000:vbv_maxrate=4000:vbv_bufsize=3000:qpmin=4:slices=4:keyint=100:bluray-compat=1:tff=1:colorprim=bt709:transfer=bt709:colormatrix=bt709:fullrange=off:overscan=show:pic-struct:force-cfr=1:aud=1" -flags +ildct+ilme -vf "scale=out_range=auto:force_original_aspect_ratio=decrease:'if(gt(a,16/9),640,-1)':'if(gt(a,16/9),-1,360)':sws_flags=bicubic+accurate_rnd+full_chroma_inp+full_chroma_int:sws_dither=bayer,pad=640:360:(ow-iw)/2:(oh-ih)/2,setsar=sar=1/1,interlace=lowpass=0:scan=tff" -movflags faststart -shortest -f mp4 %1_i.mp4
    @pause
    General
    Complete name : action-60fps.mp4_ti.mp4
    Format : MPEG-4
    Format profile : Base Media
    Codec ID : isom
    File size : 440 KiB
    Duration : 3s 667ms
    Overall bit rate mode : Variable
    Overall bit rate : 983 Kbps
    Writing application : Lavf55.34.100

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.1
    Format settings, CABAC : Yes
    Format settings, ReFrames : 3 frames
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 3s 667ms
    Bit rate mode : Variable
    Bit rate : 1 000 Kbps
    Maximum bit rate : 4 000 Kbps
    Width : 640 pixels
    Height : 360 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 30.000 fps
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : MBAFF
    Bits/(Pixel*Frame) : 0.145
    Stream size : 438 KiB (100%)
    Writing library : x264 core 142 r2389 956c8d8
    Encoding settings : cabac=1 / ref=2 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=tff / bluray_compat=1 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=0 / keyint=100 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=abr / mbtree=1 / bitrate=1000 / ratetol=1.0 / qcomp=0.60 / qpmin=4 / qpmax=69 / qpstep=4 / vbv_maxrate=4000 / vbv_bufsize=3000 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00
    Language : English
    Color primaries : BT.709
    Transfer characteristics : BT.709
    Matrix coefficients : BT.709
    Quote Quote  
  10. Member
    Join Date: Aug 2013
    Location: Central Germany
    Search PM
    The key here is probably using -x264opts to tell the x264 encoder library to use (either real or fake) interlaced encoding; ffmpeg options "outside libx264" won't change the resulting H.264 bitstream reliably.
    Quote Quote  
  11. Member racer-x's Avatar
    Join Date: Mar 2003
    Location: 3rd Rock from the Sun
    Search Comp PM
    This works for me Batch convert 1080-60p MTS into 1080-60i TS. I did this as an experiment, but can't see any reason to ever do this:

    Code:
    for %%a in ("*.mts") do "C:\FFmbc\ffmpeg" -i %%a -flags +ildct+ilme -vf interlace=lowpass=0:scan=tff -c:v libx264 -level 41 -pix_fmt yuv420p -preset medium -crf 19 -g 30 -threads 8 -x264opts bluray-compat=1:tff=1:vbv-bufsize=15000:vbv-maxrate=30000 -c:a copy -f mpegts %%~na.ts
    pause
    General
    ID : 1 (0x1)
    Complete name : D:\Capture\River Winter\output.ts
    Format : MPEG-TS
    File size : 96.5 MiB
    Duration : 39s 573ms
    Overall bit rate mode : Variable
    Overall bit rate : 20.5 Mbps

    Video
    ID : 256 (0x100)
    Menu ID : 1 (0x1)
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4.1
    Format settings, CABAC : Yes
    Format settings, ReFrames : 3 frames
    Codec ID : 27
    Duration : 39s 640ms
    Bit rate mode : Variable
    Bit rate : 19.2 Mbps
    Maximum bit rate : 30.0 Mbps
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Variable
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : MBAFF
    Stream size : 90.7 MiB (94%)
    Writing library : x264 core 140 r2377 1ca7bb9
    Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=8 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=tff / bluray_compat=1 / constrained_intra=0 / bframes=3 / b_pyramid=1 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=0 / keyint=30 / keyint_min=1 / scenecut=40 / intra_refresh=0 / rc_lookahead=30 / rc=crf / mbtree=1 / crf=19.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=30000 / vbv_bufsize=15000 / crf_max=0.0 / nal_hrd=vbr / filler=0 / ip_ratio=1.40 / aq=1:1.00

    Audio
    ID : 257 (0x101)
    Menu ID : 1 (0x1)
    Format : AC-3
    Format/Info : Audio Coding 3
    Mode extension : CM (complete main)
    Format settings, Endianness : Big
    Codec ID : 129
    Duration : 39s 680ms
    Bit rate mode : Constant
    Bit rate : 256 Kbps
    Channel count : 2 channels
    Channel positions : Front: L R
    Sampling rate : 48.0 KHz
    Bit depth : 16 bits
    Compression mode : Lossy
    Stream size : 1.21 MiB (1%)

    Menu
    ID : 4096 (0x1000)
    Menu ID : 1 (0x1)
    Duration : 39s 573ms
    List : 256 (0x100) (AVC) / 257 (0x101) (AC-3)
    Service name : Service01
    Service provider : FFmpeg
    Service type : digital television
    The memories of a man in his old age, are the deeds of the man in his prime.......
    Quote Quote  



Similar Threads