VideoHelp Forum




+ Reply to Thread
Page 2 of 3
FirstFirst 1 2 3 LastLast
Results 31 to 60 of 62
  1. In AviSynth RGB can be any frame size. In YUY2 the width must be even. In YV12 the width and height must be even. Cropping or adding an odd number of scan lines off the top of an interlaced frame will result in a field order reversal. I'd recommend sticking with even numbers all the time.

    Be sure the frames are progressive before scaling them.

    Assuming takearushfan's numbers are right, and using even numbers:

    - crop to 700x448 (offset from top left - 12px across, 99px down)
    - scale 649x463
    - pad 36px left, 6px top, 35px right, 11px bottom

    Code:
    # make video progressive, then:
    Crop(12,100,700,448)
    BilinearResize(648,464)
    AddBorders(36,8,36,8)
    You can perform the crop and resize in a single step:

    Code:
    # make video progressive, then:
    BilinearResize(648,464,12,100,700,448)
    AddBorders(36,8,36,8)
    And for better compression, make the black borders mod 8 instead of mod 4:

    Code:
    # make video progressive, then:
    BilinearResize(648,464,12,100,700,448)
    AddBorders(32,8,40,8)
    Last edited by jagabo; 27th Feb 2012 at 07:17. Reason: fixed the frame height values
    Quote Quote  
  2. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by manono View Post
    Even if permitted to (which you won't if keeping to the original YV12 colorspace), you don't want to crop and/or resize using odd numbers.
    I was wondering if that would be an issue. Here's the values adjusted to be mod2:

    - crop 700x448 (offset from top left - 12px across, 100px down)
    - scale 648x464
    - pad 36px left, 6px top, 36px right, 10px bottom

    Originally Posted by takearushfan View Post
    Um, if the PAL source was originally 720x576 then you've already confused me at step #1.
    The width is cropped fro 720 to 700 to discard the thin black bars at the side (they don't form part of the 4:3 image), the height is cropped down to 448 so the same amount of content in the frame is visible when compared to the NTSC version.

    By default, some tools crop equal amounts from all sides if not instructed to do otherwise. Thats what the 12px and 98px values are for - the area to be cropped needs to be displaced marginally to the right and also towards the bottom of the frame.

    Doing the cropping changes the viewable image area from 4:3(1.33:1) to 1.714:1.

    The (1.714) image is scaled to 648x464* to fit properly within the (1.78 - 720x480) NTSC frame - taking into account that the NTSC frame has small black bars at the top/bottom, which I think is best to keep.

    *mathematically this number could/should? be 666x464, but it depends on whether the NTSC DVD's 16:9 image is contained within a 704x480 area of the 720x480 frame.

    The last point is complex. There's a lack of clarity in the DVD spec regarding the usable image area of the digital frame. Some sources say the whole 720x480 are can be used to contain an image, other sources say only a 704x480 (or 714x480) region should contain usable image.

    DV/Digibeta/D1 and much of the (digital) broadcast industry follow the latter standard, which forms part of the Rec.601 spec. The DVD spec is not so clearly defined. Well, not publicly defined anyway. Over $6,800 for a copy of it...
    Quote Quote  
  3. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by jagabo View Post
    Code:
    # make video progressive, then:
    Crop(12,100,700,448)
    BilinearResize(648,464)
    AddBorders(36,56,36,56)
    To clarify; the crop/scale values would convert from PAL to NTSC resolution. So AddBorders(36,6,36,10) with the other parameters will give a frame size of 720x480.

    De-interlacing and frame-rate conversion would need to fit around that somehow.
    Quote Quote  
  4. Originally Posted by intracube View Post
    DV/Digibeta/D1 and much of the (digital) broadcast industry follow the latter standard, which forms part of the Rec.601 spec. The DVD spec is not so clearly defined. Well, not publicly defined anyway. Over $6,800 for a copy of it...
    In one thread around here someone with the DVD spec reported that it refers to the MPEG 2 spec for aspect ratios. The MPEG 2 spec is very clear: the full frame contains the indicated display aspect ratio. But with DVDs sourced from video tape, the MPEG 2 spec is usually ignored and the rec.601 spec is used. Ie, the industry professionals don't care (or don't know?) about the slight difference.
    Quote Quote  
  5. Originally Posted by intracube View Post
    Originally Posted by jagabo View Post
    Code:
    # make video progressive, then:
    Crop(12,100,700,448)
    BilinearResize(648,464)
    AddBorders(36,56,36,56)
    To clarify; the crop/scale values would convert from PAL to NTSC resolution. So AddBorders(36,6,36,10) with the other parameters will give a frame size of 720x480.
    Yes, I screwed up. I just fixed the post.
    Quote Quote  
  6. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Well, as if things aren't bad enough when I'm wide awake, attached is a sleep-deprived sample. However, it does show where I need to make the cut.
    You can see how the fullscreen's borders suddenly appear where the cut takes place.
    I accidentally "colourliked" in reverse, making the clean NTSC starting clip match the dirty PAL colors.
    The clip also points out the noticeable shift in the sound.
    Nonetheless, I thought I'd show you something since I haven't posted in a bit.
    Quote Quote  
  7. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by jagabo View Post
    In one thread around here someone with the DVD spec reported that it refers to the MPEG 2 spec for aspect ratios. The MPEG 2 spec is very clear: the full frame contains the indicated display aspect ratio. But with DVDs sourced from video tape, the MPEG 2 spec is usually ignored and the rec.601 spec is used. Ie, the industry professionals don't care (or don't know?) about the slight difference.[
    I had a quick search to see if I could dig up that thread, but I don't know what to search for other than; dvd aspect ratio mpeg specification. Ideally, I'd like to see a scan or word-for-word copy of the relevant section from the spec with my own eyes. I don't disbelieve what you're saying, but I'd like to see the context of this thread.

    Of course, even if it's confirmed that the DVD spec doesn't follow Rec.601 - there's still the separate argument on what the spec *should* have been

    takearushfan; The PAL section in your latest attachment has some regular frame duplication going on - every five frames. It also looks like there's some dropped frames as well.

    Are you attempting to slow the PAL bits to 23.976fps and adjust the audio accordingly - or something else?
    Quote Quote  
  8. Originally Posted by intracube View Post
    I had a quick search to see if I could dig up that thread, but I don't know what to search for other than; dvd aspect ratio mpeg specification. Ideally, I'd like to see a scan or word-for-word copy of the relevant section from the spec with my own eyes.
    So would I.

    Originally Posted by intracube View Post
    I don't disbelieve what you're saying, but I'd like to see the context of this thread.
    It was in the context of whether the aspect ratio on DVD followed the rec.601 or MPEG spec. I don't think the entire thread was about that though.
    Quote Quote  
  9. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by intracube View Post
    takearushfan; The PAL section in your latest attachment has some regular frame duplication going on - every five frames. It also looks like there's some dropped frames as well.

    Are you attempting to slow the PAL bits to 23.976fps and adjust the audio accordingly - or something else?
    ... I'm trying to follow all the advice here but I still end up with duped and dropped frames from the PAL clips.

    Yep, I'm trying to slow the PAL audio to match the lower pitch of the NTSC.

    I'm also not sure how to handle to borders. I understand how the manipulation helps to match the AR, but even though the top/bottom bars are the same, it's a little too obvious that side bars suddenly appear.
    Quote Quote  
  10. out of curiosity, how much extra content is there in total ?
    Quote Quote  
  11. Originally Posted by jagabo View Post
    It was in the context of whether the aspect ratio on DVD followed the rec.601 or MPEG spec. I don't think the entire thread was about that though.

    I believe this was the thread
    https://forum.videohelp.com/threads/327702-Is-704x480-with-a-16-9-DAR-valid-for-DVD

    The person with the offical dvd & blu-ray specs is "shon3i" . You can pm him at doom9
    Quote Quote  
  12. No, that wasn't the thread. It was a later thread where someone claimed to have access to the DVD spec at work. He verified that the DVD spec refers to the MPEG 2 spec for aspect ratio information.

    The MPEG 2 spec: http://www.comp.nus.edu.sg/~cs5248/l03/IEC-13818-2_Specs.pdf
    Quote Quote  
  13. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by poisondeathray View Post
    out of curiosity, how much extra content is there in total ?
    Roughly a minute and a half total.
    Quote Quote  
  14. Member 2Bdecided's Avatar
    Join Date
    Nov 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by poisondeathray View Post
    Originally Posted by jagabo View Post
    It was in the context of whether the aspect ratio on DVD followed the rec.601 or MPEG spec. I don't think the entire thread was about that though.
    I believe this was the thread
    https://forum.videohelp.com/threads/327702-Is-704x480-with-a-16-9-DAR-valid-for-DVD
    That's an interesting thread.

    I've always stuck with 704...
    http://forum.doom9.org/showthread.php?t=44977&page=2
    http://forum.doom9.org/showthread.php?p=1525105#post1525105

    ...because otherwise you'll get one aspect ratio on most stand-alone DVD players, and a different aspect ratio on most PC software DVD players...
    http://forum.doom9.org/showthread.php?p=1072530#post1072530

    ...but 704 isn't legal for anamorphic 16x9 on DVD...
    http://forum.doom9.org/showthread.php?p=1549376#post1549376


    As for what PAR is used on commercial DVDs, you can find examples of both. Usually it's not obvious which has been used. I suspect SD studio cameras have always used ITU PAR (unless they've drifted out of alignment), and many 16x9 Hollywood movie transfers have used Generic PAR (the calibration sequences on many DVDs do!). Then there's some Bollywood releases, which get things so wrong that you have to guess the "correct" PAR by inventing a unique one for each DVD!

    Cheers,
    David.
    Quote Quote  
  15. Originally Posted by 2Bdecided View Post
    ...but 704 isn't legal for anamorphic 16x9 on DVD...
    http://forum.doom9.org/showthread.php?p=1549376#post1549376
    According to shon3i (who apparently has the DVD spec) it is legal.

    https://forum.videohelp.com/threads/327702-Is-704x480-with-a-16-9-DAR-valid-for-DVD?p=2...=1#post2029895

    Just because one (or a few) player has problems with it doesn't mean it's not legal. Many players have problems with many different legal features.
    Quote Quote  
  16. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    Originally Posted by takearushfan View Post
    ... I'm trying to follow all the advice here but I still end up with duped and dropped frames from the PAL clips.

    Yep, I'm trying to slow the PAL audio to match the lower pitch of the NTSC.
    Post the complete script you're using to convert the PAL video. Maybe someone will spot an error.

    I'm also not sure how to handle to borders. I understand how the manipulation helps to match the AR, but even though the top/bottom bars are the same, it's a little too obvious that side bars suddenly appear.
    The side bars can be reduced by 'zooming' in on the PAL bits further. I'll try and work out what the best parameters are for Avisynth.
    Quote Quote  
  17. Originally Posted by takearushfan View Post
    I'm trying to follow all the advice here but I still end up with duped and dropped frames from the PAL clips.
    I gave you ways of doing that in this post:

    https://forum.videohelp.com/threads/343911-Using-NTSC-%2816-9%29-and-PAL-%284-3%29-sour...=1#post2143969

    Originally Posted by takearushfan View Post
    I'm trying to slow the PAL audio to match the lower pitch of the NTSC.
    Then use this:

    Originally Posted by jagabo
    The PAL clip should have gone through Something like TFM().AssumeFPS(24000,1001)
    Quote Quote  
  18. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by takearushfan View Post
    I'm trying to follow all the advice here but I still end up with duped and dropped frames from the PAL clips.
    I gave you ways of doing that in this post:

    https://forum.videohelp.com/threads/343911-Using-NTSC-%2816-9%29-and-PAL-%284-3%29-sour...=1#post2143969

    Originally Posted by takearushfan View Post
    I'm trying to slow the PAL audio to match the lower pitch of the NTSC.
    Then use this:

    Originally Posted by jagabo
    The PAL clip should have gone through Something like TFM().AssumeFPS(24000,1001)
    I know, but what I meant is I'm getting the same results even when using that code. Then again, I might've used that code at one time but forgot to use it for the latest clip with duped/dropped frames < bad wording, I know.
    Quote Quote  
  19. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by 2Bdecided View Post
    ...but 704 isn't legal for anamorphic 16x9 on DVD...
    http://forum.doom9.org/showthread.php?p=1549376#post1549376
    According to shon3i (who apparently has the DVD spec) it is legal.

    https://forum.videohelp.com/threads/327702-Is-704x480-with-a-16-9-DAR-valid-for-DVD?p=2...=1#post2029895

    Just because one (or a few) player has problems with it doesn't mean it's not legal. Many players have problems with many different legal features.
    The Scream DVD I have is 704. It's the only one that shows that resolution so I found it very odd. It's interesting to see it mentioned here.
    Quote Quote  
  20. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Originally Posted by intracube View Post
    Originally Posted by takearushfan View Post
    ... I'm trying to follow all the advice here but I still end up with duped and dropped frames from the PAL clips.

    Yep, I'm trying to slow the PAL audio to match the lower pitch of the NTSC.
    Post the complete script you're using to convert the PAL video. Maybe someone will spot an error.

    I'm also not sure how to handle to borders. I understand how the manipulation helps to match the AR, but even though the top/bottom bars are the same, it's a little too obvious that side bars suddenly appear.
    The side bars can be reduced by 'zooming' in on the PAL bits further. I'll try and work out what the best parameters are for Avisynth.
    Thanks very much
    Quote Quote  
  21. Member
    Join Date
    Oct 2010
    Location
    England
    Search Comp PM
    More expansion (smaller borders at the sides):
    - crop 700x431 (offset from top left - 12px across, 100px down)
    - scale 684x464
    - pad 18px left, 6px top, 18px right, 10px bottom

    Code:
    BilinearResize(684,464,12,100,700,431)
    AddBorders(18,6,18,10)
    --

    Full expansion (no borders at the sides):
    - crop 700x408 (offset from top left - 12px across, 100px down)
    - scale 720x464
    - pad 0px left, 6px top, 0px right, 10px bottom

    Code:
    BilinearResize(720,464,0,100,700,408)
    AddBorders(0,6,0,10)
    I can't easily run Avisynth to check the parameters, but hopefully they're ok.
    Quote Quote  
  22. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Okay jagabo, and all you guys, I'm really sorry but for the life of me I cannot get the audio to match the NTSC pitch. And yes, I obviously tried the code you posted. I've looked up documentations, tried rearranging steps and scripts, etc... nothing works. What are the exact steps to be taken and in what order do you perform them?
    Thanks.
    Quote Quote  
  23. Member 2Bdecided's Avatar
    Join Date
    Nov 2007
    Location
    United Kingdom
    Search Comp PM
    Originally Posted by jagabo View Post
    Originally Posted by 2Bdecided View Post
    ...but 704 isn't legal for anamorphic 16x9 on DVD...
    http://forum.doom9.org/showthread.php?p=1549376#post1549376
    According to shon3i (who apparently has the DVD spec) it is legal.

    https://forum.videohelp.com/threads/327702-Is-704x480-with-a-16-9-DAR-valid-for-DVD?p=2...=1#post2029895

    Just because one (or a few) player has problems with it doesn't mean it's not legal. Many players have problems with many different legal features.
    I've only seen a Chinese copy of the spec, but to someone who read+spoke Chinese, this wasn't very clear at all. So until I get to see the English version myself, I'll reserve judgement.

    But I still use 704 for 16x9 myself!

    Cheers,
    David.
    Quote Quote  
  24. AssumeFPS(), ChangeFPS(), etc. don't change the audio. You have to use AssumeSampleRate() and ResampleAudio() to change the pitch and length. Since you are changing the frame rate from 25 to 24000/1001 you need to stretch the audio by the same amount. That means reducing the sample rate to 24000 / 1001 / 25 (0.959041) times the original sample rate. So mulitply the sample rate by that, 48000 * 0.959041 = 46034. Since DVDs can't play 46034 Hz audio you then need to resample it to 48 KHz.

    Code:
    #starting 25 FPS PAL video with 48000 Hz audio
    AssumeFPS(24000,1001) # time stretch the video
    AssumeSampleRate(46034) #time stretch the audio
    ResampleAudio(48000) #back to 48000 Hz samples
    I don't know how AviSynth's audio resampling compares to a good audio editor.
    Last edited by jagabo; 1st Mar 2012 at 07:01.
    Quote Quote  
  25. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by jagabo View Post
    Code:
    #starting 25 FPS PAL video with 48000 Hz audio
    AssumeFPS(24000,1001) # time stretch the video
    AssumeSampleRate(46034) #time stretch the audio
    ResampleAudio(48000) #back to 48000 Hz samples
    You can combine the first two steps by using
    AssumeFPS(24000, 1001, sync_audio=true)

    That saves you having to do the calculation to work out the intermediate sampling rate (46034).
    Quote Quote  
  26. Member
    Join Date
    May 2006
    Location
    United States Of America
    Search Comp PM
    Long-winded update:

    For now I'm just going to stick with the audio issue I'm having.

    I figure it might help if I provide the steps I use, as well as the scripts involved. I'm doing this because despite jagabo's generous, repeated outlining and providing code samples, I just can't get the PAL audio the lower to the NTSC pitch.

    I have one folder with the NTSC VOBs and another folder with the PAL VOBs.

    I use one script for working on the NTSC and another separate one for the PAL clips.

    Again, for the time being I'm scrapping the cropping, borders and resizing. I'll focus on that once I figure out what's wrong with the audio nightmare.

    Here's what I've tried:

    1. Use DGIndex on a portion of the NTSC version using "forced film", since the application reports it as pure film. Therefore, I DO NOT incorporate TFM and Decimate into this portion's script.

    2. Use DGIndex on the same portion of the PAL version, "honoring" the pulldown flags. Therefore I obviously DO use TFM and Decimate in this version's script.

    -

    The NTSC script:

    MPEG2Source("VTS_01_1.d2v")
    # for the sake of this issue, there's nothing else to do here, right?

    -

    The PAL script:

    MPEG2Source("VTS_01_1.d2v").TFM().TDecimate()
    AssumeFPS(24000, 1001, sync_audio=true)

    -

    For the NTSC clip:

    Open the NTSC clip (via the script) in VDub
    Video > Direct stream processing
    Audio > Direct stream processing, using "Audio from other file". The file chosen is the NTSC one that's a result of the DGIndex's demuxing. Save.

    For the PAL clip:

    Open the PAL clip (via the script) in VDub
    Video > Direct stream processing
    Audio > Direct stream processing, using "Audio from other file". The file chosen is the PAL one that's a result of the DGIndex's demuxing. Save.

    I then view/listen to both and notice that the PAL pitch is still higher than the NTSC
    Quote Quote  
  27. Originally Posted by takearushfan View Post

    The PAL script:

    MPEG2Source("VTS_01_1.d2v").TFM().TDecimate()
    AssumeFPS(24000, 1001, sync_audio=true)



    For the PAL clip:

    Open the PAL clip (via the script) in VDub
    Video > Direct stream processing
    Audio > Direct stream processing, using "Audio from other file". The file chosen is the PAL one that's a result of the DGIndex's demuxing. Save.

    I then view/listen to both and notice that the PAL pitch is still higher than the NTSC
    There is no audio loaded in the script, so if you choose the DGIndex demuxed file, it's the same as the original

    You need to load audio into the script for the assumefps and sync_audio=true to work, also it looks like you are IVTCing the PAL video = bad . You don't need TFM().TDecimate() for PAL - telecine only refers to NTSC



    PAL

    Code:
    vid = MPEG2Source("VTS_01_1.d2v").TFM()
    aud = NICAC3Source("PALaudio.ac3")
    audiodub(vid,aud)
    AssumeFPS(24000, 1001, sync_audio=true)
    EDIT: I believe there was a field shift in the PAL version so there is a TFM() inserted to field match
    Quote Quote  
  28. Originally Posted by takearushfan View Post
    2. Use DGIndex on the same portion of the PAL version, "honoring" the pulldown flags. Therefore I obviously DO use TFM and Decimate in this version's script.
    No. Do not Decimate. Use AssumeFPS(24000,1001) and slow down the audio.
    Quote Quote  
  29. Member
    Join Date
    Jul 2009
    Location
    Spain
    Search Comp PM
    Originally Posted by poisondeathray View Post
    PAL
    Code:
    vid = MPEG2Source("VTS_01_1.d2v").TFM()
    aud = NICAC3Source("PALaudio.ac3")
    audiodub(vid,aud)
    AssumeFPS(24000, 1001, sync_audio=true)
    You also need to add ResampleAudio(48000) if you are going to join this with the NTSC section or save to a new DVD.
    (It can be omitted if just quickly testing the pitch.)
    Quote Quote  
  30. Originally Posted by takearushfan View Post
    2. Use DGIndex on the same portion of the PAL version, "honoring" the pulldown flags. Therefore I obviously DO use TFM and Decimate in this version's script.
    And that's where the screwup is. As mentioned, you do not IVTC a PAL video. Since you're IVTCing it (improperly), the later AssumeFPS does nothing as it doesn't change the length, and therefore the audio pitch doesn't change.
    Quote Quote  



Similar Threads

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