VideoHelp Forum


Try StreamFab All-in-One and rip streaming video! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 23 of 23
Thread
  1. Deinterlacing PAL from DV cam.
    PAR loses flag, result is narrow frame.
    Any way to restore PAR?
    Now I just Spline64Resize width.
    Last edited by taigi; 18th May 2021 at 14:35.
    Quote Quote  
  2. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Whether an aspect ratio flag is available or not depends on the exact format of both the video content and the container. Unfortunately you don't tell us any details. But I guess you don't save the deinterlacing result as DV in AVI again? If you would, a player would assume an aspect ratio due to the fact that there is DV in AVI.

    A verbose MediaInfo report of both the original video and the deinterlaced result should be useful.
    Quote Quote  
  3. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Much depends on what apps your are working with.

    Since you mention AVISynth (re: Spline64Resize), understand that AVISynth does not take into consideration any Aspect Ratios. Nor does it keep track of them, so cannot "restore". It merely operates academically on samples, which have no inherent ratio (as they are just data points).
    For most apps, AR (whether PAR or DAR) is flagged when encoded and accommodated when decoded. AVISynth does neither of these, it just gets the piped-in data points from a decoder and pipes them out to an external encoder/app.

    My guess is that since you are "deinterlacing" in AVISynth, you are not only decoding DV but are making adjustments on the samples at which point they are also uncompressed.
    Since you will need to send the output to an encoder, you must tell the encoder if you want the image to have a non-square (aka not 1:1) AR. If you don't want an non-square AR, you will need to compensate on your own for the change in the footage by adjusting width or height.

    Since I don't know what the result of your deinterlace looks like, it would be hard to tell what actual AR numbers to apply.
    This also assumes that the codec and/or container you choose in your re-encoding will support AR flags. And some codecs/containers expect you to adjust PAR/SAR (Pixel or Sample AR) while others expect you to adjust DAR/FAR (Display or Frame AR), so it depends on your intended target format.

    Example: if you are going to MPEG1, and your output is standard 4:3 SD 601 PAL size, your PAR would be: 59:54 or 1.0925:1. If you were going to MPEG2, you don't set the PAR but instead set the DAR, which would be 4:3 or 1.3333:1.


    Scott
    Quote Quote  
  4. Originally Posted by LigH.de View Post
    A verbose MediaInfo report of both the original video and the deinterlaced result should be useful.
    Posting. Before and after QTGMC:

    Before:
    General
    Complete name :
    Format : AVI
    Format/Info : Audio Video Interleave
    Commercial name : DV
    Format profile : OpenDML
    File size : 4.48 GiB
    Duration : 21 min 3 s
    Overall bit rate mode : Constant
    Overall bit rate : 30.4 Mb/s
    Recorded date : 2017-05-20 21:44:14.000

    Video
    ID : 0
    Format : DV
    Codec ID : dvsd
    Codec ID/Hint : Sony
    Duration : 21 min 3 s
    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 : 16:9
    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
    Time code of first frame : 00:08:15:24
    Time code source : Subcode time code
    Stream size : 4.24 GiB (95%)

    After:
    General
    Complete name :
    Format : AVI
    Format/Info : Audio Video Interleave
    File size : 10.6 MiB
    Duration : 1 s 0 ms
    Overall bit rate : 89.0 Mb/s
    Writing library : VirtualDub2 build 44282/release

    Video
    ID : 0
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High 4:4:4 Predictive@L6.2
    Format settings : CABAC / 16 Ref Frames
    Format settings, CABAC : Yes
    Format settings, ReFrames : 16 frames
    Codec ID : H264
    Duration : 1 s 0 ms
    Bit rate : 87.3 Mb/s
    Width : 720 pixels
    Height : 576 pixels
    Display aspect ratio : 5:4
    Frame rate : 50.000 FPS
    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 10 bits
    Scan type : Progressive
    Bits/(Pixel*Frame) : 4.212
    Stream size : 10.4 MiB (98%)
    Writing library : x264 core 157 r2935M 545de2f
    Encoding settings : cabac=1 / ref=16 / deblock=1:0:0 / analyse=0x1:0x131 / me=esa / subme=9 / psy=0 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=0 / threads=6 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc=cqp / mbtree=0 / qp=0
    Color range : Limited
    Matrix coefficients : BT.470 System B, BT.470 System G
    Quote Quote  
  5. For 16:9 720x576 you would use --sar 64:45 for full frame . If you have pillarboxing use --sar 16:11

    "SAR" is the sample aspect ratio in MPEG4 terminology. It's analogous to what "PAR" is for MPEG2
    Quote Quote  
  6. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    Additional suggestion: You should not use H.264 video in an AVI container. It does not support all of the features of this video stream. You could instead select the file type "MP4 +faststart" in VirtualDub2. Both the MP4 container and MPEG-4 AVC (H.264) video are parts of the same standard, so the result shall be most compatible to many players. If you have audio too, you may prefer FFmpeg AAC or FFmpeg Lame MP3 from the audio compressors VirtualDub2 offers.
    Quote Quote  
  7. @taigi
    Load your deinterlaced avi into clever FFmpeg-GUI, main, multiplex, set the target file, set DAR to 16:9, set container to mkv or mp4, click multiplex, done.
    Quote Quote  
  8. Originally Posted by LigH.de View Post
    ...AVI container. It does not support all of the features of this video stream.
    What features does it lack exactly? Thank you.
    Last edited by taigi; 19th May 2021 at 11:27.
    Quote Quote  
  9. --
    Last edited by taigi; 20th May 2021 at 20:37.
    Quote Quote  
  10. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Avi doesn't have a well-defined AR flag, it works terribly or not at all with VFR, and it doesn't properly support B-frames, among other legacy issues with filesize, etc. Remember, avi standard was created at end of the 80s/early90s. VFR didn't exist then and Bframes were barely out of the lab at that time.

    Re:mp4, the container standard can contain uncompressed LPCM (not WAV, per se, as that is its own container format) and lossless as well. However, neither is common in mp4 so many/most apps are not designed to include support for it.

    Scott
    Quote Quote  
  11. There are two main problems with AVI:

    Many programs use Microsoft's ancient Video For Windows (VFW) library to read AVI files. VFW is based on a one-frame-in-one-frame out model. So VFW can't handle out-of-order codecs (all modern high compression codecs) without a kludge.

    In theory, the AVI spec is about as flexible and extensible as other modern containers*. It can handle variable frame rates, out-of-order codecs, and it already has an AR flag (that's essentially unsupported by any software). But Microsoft abandoned it 20 years ago (and attempt to replace it with a proprietary container that everyone would have to them pay royalties to use, ASF -- they eventually gave up on that) and without someone to define a standard on how all those features should work there's no software support for them.

    * Avi and most modern containers are all loosely based on the IFF format, created in 1985. https://en.wikipedia.org/wiki/Interchange_File_Format
    Last edited by jagabo; 19th May 2021 at 12:35.
    Quote Quote  
  12. Originally Posted by ProWo View Post
    clever FFmpeg-GUI looks promising, but it stops at "File analysis is in progress".
    Last edited by taigi; 20th May 2021 at 20:36.
    Quote Quote  
  13. mkvtoolnix gui

    add file
    select video track
    in the video properties panel, set aspect ratio , select 16/9
    push start multiplexing
    Quote Quote  
  14. Originally Posted by poisondeathray View Post
    mkvtoolnix gui
    Can it save in MP4?
    Last edited by taigi; 20th May 2021 at 20:35.
    Quote Quote  
  15. Member
    Join Date
    Aug 2013
    Location
    Central Germany
    Search PM
    No, MKVtoolnix creates MKV.

    Did you try to produce MP4 out of VirtualDub2, using its x264 codec (where you can enter SAR aspect ratio pairs)?
    Quote Quote  
  16. Originally Posted by taigi View Post
    clever FFmpeg-GUI looks promising, but it stops at "File analysis is in progress".
    Your deinterlaced output has several errors:
    Source: Duration : 21 min 3 s
    Output: Duration : 1 s 0 ms (probably faulty)

    Source: Bit rate : 24.4 Mb/s
    Output: Bit rate : 87.3 Mb/s (for 720x576 source an absolute nonsense, 2-3 MB/s are quite sufficient for x264 encoding).

    Source: Bit depth : 8 bits
    Output: Bit depth : 10 bits (Why 10 bits from a 8 bit source?)

    I recommend you to re-do the deinterlacing with reasonable values.
    Quote Quote  
  17. I don't know where to enter enter SAR aspect ratio pairs. Is that should be some line to add to h.264 settings?
    Last edited by taigi; 20th May 2021 at 20:35.
    Quote Quote  
  18. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    There are the ratios, http://forum.doom9.org/showpost.php?p=716299&postcount=4, you enter them here
    Image Attached Thumbnails Click image for larger version

Name:	ar.png
Views:	10
Size:	30.9 KB
ID:	59040  

    Quote Quote  
  19. Originally Posted by ProWo View Post
    Your deinterlaced output has several errors:
    Output: Duration : 1 s 0 ms (probably faulty)
    ...
    Output: Bit rate : 87.3 Mb/s (for 720x576 source an absolute nonsense, 2-3 MB/s are quite sufficient for x264 encoding).
    ...
    Source: Bit depth : 8 bits
    Output: Bit depth : 10 bits (Why 10 bits from a 8 bit source?)
    Thanks for an answer and useful notes.
    Output Duration is short, because that was for demo purposes only. I would like to know how to manipulate Bit rate, but don't know. At the moment I try to mimicry the professional quality, so I'm afraid to loose anything by knowing only parts of stuff about video technology. That's why 10 bits instead of 8 - now I understand it - need to check bits before encoding too. Because I know from work on WAVs - if you use 24bits instead of 16bits you just add empty junk to the file improving nothing. The same with video files too probably.
    Quote Quote  
  20. Thanks. Is DAR=SAR in this case?
    Last edited by taigi; 20th May 2021 at 20:33.
    Quote Quote  
  21. Originally Posted by taigi View Post
    Originally Posted by davexnet View Post
    There are the ratios, http://forum.doom9.org/showpost.php?p=716299&postcount=4, you enter them here
    Wow, thanks. Is DAR=SAR in this case? (Possible my personal fight for PAL AR of few last decades will be over soon).
    No, what you think as "PAR" is now called "SAR"

    DAR has no confusion. It's 16:9, or 4:3 in the DV case
    Quote Quote  
  22. It worked and had ended my confusion of few decades on how to restore PAR of DV camera footage, thanks, you all received +karma points.
    Quote Quote  
  23. Member Cornucopia's Avatar
    Join Date
    Oct 2001
    Location
    Deep in the Heart of Texas
    Search PM
    Think of it this way: SAR (Sample AR) formerly PAR (Pixel AR) = the AR of the parts/elements, while DAR (Display AR) or FAR (Frame AR) = the AR of the whole.

    Universal formula:
    Code:
    DAR = Horiz / Vert * PAR
    aka
    Code:
    FAR = Horiz / Vert * SAR

    Scott
    Quote Quote  



Similar Threads