VideoHelp Forum




+ Reply to Thread
Results 1 to 8 of 8
  1. So currently I am using this FFMPEG command line to convert some H.264 1080p30 video footage to an XDCAM EX35 1080i60 MP4 file
    ffmpeg -i "input.mp4" -pix_fmt yuv420p -vcodec mpeg2video -flags +ildct+ilme -top 1 -dc 10 -qmin 1 -lmin " + "1*QP2LAMBDA" + " -vtag xdv3 -b:v 35000k -minrate 20000k -maxrate 35000k -bufsize 36408333 -g 15 -bf 2 -aspect 16:9 -r 29.97 -s 1920x1080 -async 2 -acodec pcm_s16le -ar 48000 -f mov -y "output.mp4"
    The reasons for this involve broadcast and compatibility, otherwise I would just work directly with the 1080p footage.

    Now I'm trying to figure out an FFMPEG command line that will allow me to take H.264 1080p60 video footage, convert it to XDCAM EX35 1080i60 top field first and maintain the fluidity of motion. I tried using the previous arguments and it just essentially just halved the framerate and interlaced the footage. I know this is easily doable with avisynth, but I'm trying to avoid avisynth if possible and just do it all with ffmpeg.

    What do I need to change here?

    Thanks
    Quote Quote  
  2. Code:
    -vf interlace=lowpass=0:scan=tff
    or something more new https://ffmpeg.org/ffmpeg-filters.html#tinterlace

    in your case it should be
    Code:
    -vf tinterlace=4:vlfp=0
    Be aware that lowpass filter is disabled in both examples - i believe that it is better to apply sufficient antialiasing processing instead rely on very simple blur kernel.

    Btw i would advise to not go bellow 2 for quantiser - some hardware decoders may have issues - i remember that Broadcom chips struggle a bit with such issue in the past.
    Quote Quote  
  3. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Instead of really encoding in interlaced mode, x264 also supports a parameter "fake-interlace" which enables MBAFF interlacing (just to be compatible to e.g. Blu-ray specifications requiring 1080i), but practically uses progressive encoding in every case.

    This has been asked before.

    This would probably be suitable for 30p material covered as "potentially 60i". But if you really have 60p, then you will probably have to weave alternating fields and ignore every other field per frame. In this case, pandy seems to have a solution.
    Quote Quote  
  4. Thanks guys, got it working.

    I'm guessing there isn't one set of arguments I can use to that will both convert 30p to 60i and 60p to 60i? From all my testing, it didn't work which is fine. It would be a bonus if it did.
    Quote Quote  
  5. 30p to 60i can be considered as same (and as such 30i) - no difference on temporal domain between fields - this is used frequently to encode progressive source as fake interlace - common situation for cinema movies where source is tape and video is progressive but framerate is lower than TV framerate.

    I see that you explicitly pointing that framerate shall be 29.97 which is wrong - correct frame rate number is 30000/1001.
    Usually when you interlacing video framerate is reduced by half and it works perfectly.
    Not sure what is your question then - 60i is not 60p definitely however if your goal is to keep motion at the cost of spatial resolution in vertical direction then 60i is only option you have unless you going for motion blur and 30p approach.
    Quote Quote  
  6. So my situation is as such. Occasionally I will have footage coming in as 30p and sometimes as 60p. My goal is to get them both converted to XDCAM EX @ 60i(30i). I want to retain the characteristics of motion in both. I know 30p has half the temporal motion of 60i and 60p. I also know that there will be a spatial resolution loss going from 60p to 60i.

    I guess I am looking for one set of ffmpeg arguments where it doesn't matter what input framerate I give it, it will output a 60i file retaining the motion characteristics of the input file. I've coded a gui that does batch encoding so that's why I'm looking for one set of arguments so I don't have to manually parse each file.

    Using
    -vf tinterlace=4 -flags +ildct+ilme -top 1
    works on 60p files but doesn't work on 30p files and conversely using
    -flags +ildct+ilme -top 1
    works on 30p files but not 60p.

    There might not even be a way of doing this, so that's why I'm asking! If there isn't I will work around it, just wondering if it is possible!

    Thanks!
    Quote Quote  
  7. Since I don't use it I have no idea whether or not ffmpeg can do it or not. However, AviSynth can easily convert 60p to 30i:

    AssumeTFF()
    SeparateFields()
    SelectEvery(4,0,3)
    Weave()


    Of course, it will require a complete reencode. If you insist on using ffmpeg to reencode, I believe it accepts AviSynth scripts as input but others would know more about it than I.
    Quote Quote  
  8. Originally Posted by nesburf View Post
    I'm looking for one set of arguments so I don't have to manually parse each file.

    There is a way, but you do have to parse the file (perhaps not manually) to differentiate the files . One way is to use if/then logic when using the same set of encoding arguments. The encoding settings are the same (encode interlaced), but your actual content is 1 of 2 possibilities - that is the main problem

    If framerate is >30 do this (ie. apply the re-interlace); otherwise that (ie. treat as is, progressive, each consecutive field pair is the same moment in time)

    avisynth can do it because it has logic built in;

    e.g. apply simple re-interlace (no lowpass) if the framerate is >30 , otherwise leave it as is
    Code:
    src=last
    src.framerate>30 ? src.AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave() : src

    But to do it in ffmpeg alone, you would need to do it though a batch dos or bash script, perhaps with ffprobe to parse the framerate . You can ask one of the dos batch or bash script experts, but basically you need a way to distinguish the 2 possibilities in order to apply the ffmpeg -vf interlace or -vf tinterlace filter +/- lowpass as one condition, or leave it as is as the 2nd condition. Frame rate is the parameter which makes the most sense to use
    Quote Quote  



Similar Threads

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