VideoHelp Forum


Try NordVPN to access Netflix or other streaming services from any country and also surf safely!
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. TravelRock
    Join Date
    Jan 2021
    Location
    Sweden
    Search Comp PM
    Hi,

    I'm trying to learn how to get best possible deinterlaced output from FFMPEG but are quite new to scripting and all options FFMPEG gives. Could anyone perhaps give som suggestions to optimal quality output?

    I've got quite a lot of interlaced material from both analog videocameras as well as various interlace digital from mini DV camera as well as 1080i video.
    This is what I've got at the moment to deinterlace an analog interlaced PAL video:

    ffmpeg -i "input.avi" -vf yadif=1:-1:0,mcdeint=2:1:10,scale=w=720:h=576 -c:v libx264 -preset slow -crf 18 "output.mpg"

    This is, from my understanding motiondetected YADIF deinterlaced PAL video without any scaling.
    Any suggestions for archiving even better image quality using FFMPEG and how would that script look like?

    The output becomes VFR, but I'm not sure if that's good or bad..?

    Thanks!
    Quote Quote  
  2. The output becomes VFR, but I'm not sure if that's good or bad..?
    I would say: bad

    Any suggestions for archiving even better image quality using FFMPEG and how would that script look like?
    Instead of
    Code:
    yadif=1:-1:0,mcdeint=2:1:10,
    I would use bwdif=mode=1 (https://www.ffmpeg.org/ffmpeg-all.html#bwdif)
    Why the ",scale=w=720:h=576"-part if you don't want to scale?

    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  3. TravelRock
    Join Date
    Jan 2021
    Location
    Sweden
    Search Comp PM
    Thanks for your reply Selur.

    OK, what I suspected about VFR.
    Would you say -r 50 (for 50 framerate) is the way to solve that?

    Thanks for your suggestion regarding bwdif, I will try that.

    As to the scale=w=720:h=576, it's the resolution of the input video and I was thinking I might have to state that. But perhaps not?

    I also added fieldorder since its Bottom Frame First, if that's needed?

    This is what I'm having right now, what do you think about this? Good way to go?

    ffmpeg -r 50 -i "input.avi" -vf fieldorder=bff,bwdif=mode=1,scale=w=720:h=576 -c:v libx264 -preset veryslow -crf 17 "output.mpg"

    Thanks!
    Quote Quote  
  4. I also added fieldorder since its Bottom Frame First, if that's needed?
    assuming your source is bff and properly flagged that is not necessary

    Would you say -r 50 (for 50 framerate) is the way to solve that?
    probably, depends a bit on the input,..nope , should be 25, since PAL usually is 25 frames interlaced not 50 frames interlaced,..

    As to the scale=w=720:h=576, it's the resolution of the input video and I was thinking I might have to state that. But perhaps not?
    not knowing the characteristics of the input, I would not add it, especially without knowing the pixel aspect ration of the input

    "output.mpg"
    Putting H.264 inside an mpg container is probably a bad idea, most tools will not support this properly.
    Better use .mp4, .mkv or even .ts/.m2ts.
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  5. TravelRock
    Join Date
    Jan 2021
    Location
    Sweden
    Search Comp PM
    Thanks again. I realize I really do not have enough knowledge regarding this.

    What I'm trying to do is de-interlace an old analog PAL video (4:3 720x576) to be able to try out upscale and improved image with Topaz Video Enhance AI.
    This is mediainformation regarding the output. What would you suggest?

    General
    Complete name : output.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    Commercial name : DVCPRO
    Format profile : OpenDML
    File size : 6.87 GiB
    Duration : 32 min
    Overall bit rate mode : Constant
    Overall bit rate : 30.5 Mb/s

    Video
    ID : 0
    Format : DV
    Commercial name : DVCPRO
    Codec ID : dvsd
    Codec ID/Hint : Sony
    Duration : 32 min
    Bit rate mode : Constant
    Bit rate : 24.4 Mb/s
    Encoded bit rate : 28.8 Mb/s
    Width : 720 pixels
    Height : 576 pixels
    Display aspect ratio : 4:3
    Frame rate mode : Constant
    Frame rate : 25.000 FPS
    Standard : PAL
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Bottom Field First
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 2.357
    Stream size : 6.48 GiB (94%)

    Audio
    ID : 1
    Format : PCM
    Format settings, Endianness : Little
    Format settings, Sign : Signed
    Codec ID : 1
    Duration : 32 min
    Bit rate mode : Constant
    Bit rate : 1 536 kb/s
    Channel(s) : 2 channels
    Sampling rate : 48.0 kHz
    Bit depth : 16 bits
    Stream size : 354 MiB (5%)
    Alignment : Aligned on interleaves
    Interleave, duration : 40 ms (1.00 video frame)
    Interleave, preload duration : 40 ms
    Quote Quote  
  6. The original doesn't use square pixels (see detailed mediainfo output), so 720x576 isn't the resolution you probably want to aim for,...
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  
  7. TravelRock
    Join Date
    Jan 2021
    Location
    Sweden
    Search Comp PM
    Thanks for your suggestion Selur.
    What data is saying it's not square pixels? Or are you just using calculating the 4:3 and comparing with 720x576? Just trrying to learn.

    I tried the mediainfo app that was linked and this is what it says:

    General
    Complete name : input.avi
    Format : AVI
    Format/Info : Audio Video Interleave
    Commercial name : DVCAM
    Format profile : OpenDML
    File size : 6.87 GiB
    Duration : 32 min 14 s
    Overall bit rate mode : Constant
    Overall bit rate : 30.5 Mb/s

    Video
    ID : 0
    Format : DV
    Commercial name : DVCAM
    Codec ID : dvsd
    Codec ID/Hint : Sony
    Duration : 32 min 13 s
    Bit rate mode : Constant
    Bit rate : 24.4 Mb/s
    Width : 720 pixels
    Height : 576 pixels
    Display aspect ratio : 4:3
    Frame rate mode : Constant
    Frame rate : 25.000 FPS
    Standard : PAL
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan order : Bottom Field First
    Compression mode : Lossy
    Bits/(Pixel*Frame) : 2.357
    Stream size : 6.48 GiB (94%)

    Audio
    ID : 1
    Format : PCM
    Format settings : Little / Signed
    Codec ID : 1
    Duration : 32 min 14 s
    Bit rate mode : Constant
    Bit rate : 1 536 kb/s
    Channel(s) : 2 channels
    Sampling rate : 48.0 kHz
    Bit depth : 16 bits
    Stream size : 354 MiB (5%)
    Alignment : Aligned on interleaves
    Interleave, duration : 40 ms (1.00 video frame)
    Interleave, preload duration : 40 ms


    Given your comments and suggestions, is this perhaps what you would suggest for best result?

    ffmpeg -r 25 -i "input.avi" -vf fieldorder=bff,bwdif=mode=1 -c:v libx264 -preset veryslow -crf 17 "output.mp4"
    Quote Quote  
  8. What data is saying it's not square pixels?
    None of your data, the detailed media info output should show.
    Looking at your data:
    Code:
    Width : 720 pixels
    Height : 576 pixels
    Display aspect ratio : 4:3
    shows a display aspect ratio of 4:3
    and a sample aspect ratio of 720:576 = 5:4
    if the pixel aspect ratio as 1:1 these two should be equal, which they are not.

    Given your comments and suggestions, is this perhaps what you would suggest for best result?
    Without full details: I would suggest adding something like
    Code:
    -bsf:v "h264_metadata=sample_aspect_ratio=4/3"
    Cu Selur
    users currently on my ignore list: deadrats, Stears555
    Quote Quote  



Similar Threads