VideoHelp Forum
+ Reply to Thread
Results 1 to 22 of 22
Thread
  1. Hi, but I'm a ***

    please consider the attached EdiusOUT.mp4 source:

    mediainfo says

    Video
    ID : 1
    Format : AVC
    Format/Info : Advanced Video Codec
    Format profile : High@L4
    Format settings, CABAC : Yes
    Format settings, ReFrames : 2 frames
    Format settings, GOP : M=3, N=30
    Codec ID : avc1
    Codec ID/Info : Advanced Video Coding
    Duration : 29 s 320 ms
    Bit rate mode : Constant
    Bit rate : 18.0 Mb/s
    Width : 1 920 pixels
    Height : 1 080 pixels
    Display aspect ratio : 16:9
    Frame rate mode : Constant
    Frame rate : 50.000 FPS
    Original frame rate : 25.000 FPS

    Color space : YUV
    Chroma subsampling : 4:2:0
    Bit depth : 8 bits
    Scan type : Interlaced
    Scan type, store method : Separated fields
    Scan order : Top Field First
    Bits/(Pixel*Frame) : 0.174
    Stream size : 63.2 MiB (98%)
    Language : English
    Encoded date : UTC 2017-11-30 23:02:40
    Tagged date : UTC 2017-11-30 23:02:40


    I need to build an .avs that "convert" it with an output 50P and YUY2 4:2:2.

    The source is a 50i interlaced video file so I need to deinterlace and double framerate. Output have to be progressive.

    How I have to do? thanks
    Image Attached Files
    Quote Quote  
  2. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Your sample video already runs at 50fps and is interlaced. If you deinterlace for double frame rate the video will play at 100fps progressive, which is 2 times 50i. So if you want "double frame rate progessive", the only choice is 100p. Meanwhile your sample doesn't even play correctly and has horrible time code problems. I don't know about the original source, but someone has certainly ruined the mp4 sample. The sample is not workable.
    - My sister Ann's brother
    Quote Quote  
  3. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Perhaps a bob deinterlace followed by 2:1 frame decimate ?
    Quote Quote  
  4. You can use AssumeFPS(25) to "fix" the framerate

    Otherwise it's the same as your other scripts for interlaced downscaling, reinterlace, (and colormatrix) . You've asked this question before
    Quote Quote  
  5. This is common problem. The frame rate reported by MediaInfo is the field rate, not the frame rate. Many programs interpret this incorrectly. Exactly how you treat it depends on the source filter you use:

    Code:
    LSmashVideoSource("EdiusOUT.mp4") 
    AssumeTFF()
    AssumeFPS(25)
    Trim(0,framecount/2-1)
    Yadif(Mode=1, order=1) # or QTGMC
    Code:
    ffVideoSource("EdiusOUT.mp4") 
    Trim(0,framecount-1)
    SelectEven()
    AssumeTFF()
    Yadif(Mode=1, order=1) # or QTGMC
    Both of those will give you 50p YV12. ConvertToYUY2() if necessary.
    Last edited by jagabo; 12th Jan 2020 at 23:38.
    Quote Quote  
  6. Interesting; slightly different results with different versions of lsmash / ffms2

    There should be 733 frames, or 1466 fields (or bobbed frames) . The version of lsmash I'm using gets this correct, no need from the trim
    Quote Quote  
  7. With the versions I have the source filters screw up near the end of the clip. Hence the trims. Lsmash is a few years old -- I should probably update it.

    By the way, I was using a 64 bit build of AviSynth+.
    Last edited by jagabo; 13th Jan 2020 at 06:56.
    Quote Quote  
  8. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by poisondeathray View Post
    Interesting; slightly different results with different versions of lsmash / ffms2

    There should be 733 frames, or 1466 fields (or bobbed frames) . The version of lsmash I'm using gets this correct, no need from the trim
    I got decent results only with LSMASH.
    - My sister Ann's brother
    Quote Quote  
  9. The one I'm using is here
    https://github.com/HolyWu/L-SMASH-Works/releases

    GPU decoding works for this branch too

    LSmashVideoSource() is usually consistent for MP4, but there are some errors on non linear seeking here . LWLibavVideoSource() with the indexing works
    Quote Quote  
  10. Thanks for the link. I updated and use LWlibavVideoSource() and new the Trim() isn't necessary.

    Code:
    LWlibavVideoSource("EdiusOUT.mp4") 
    AssumeTFF()
    AssumeFPS(25)
    Yadif(Mode=1, order=1)
    You're correct LSMASHVideoSource() has trouble with random seeks. It also has problems with the two leading B frames with negative time codes (the video was cut from an open GOP source) -- it repeats the initial I frame for each of those. LWlibavVideoSource() is smart enough to skip those frames.
    Quote Quote  
  11. You're correct LSMASHVideoSource() has trouble with random seeks. It also has problems with the two leading B frames with negative time codes (the video was cut from an open GOP source) -- it repeats the initial I frame for each of those. LWlibavVideoSource() is smart enough to skip those frames.
    I have had trouble using interpolation functions with LWLibavVideoSource as the source plugin for M2TS files, those issues disappeared when the files were loaded with FFVideoSource. Could it be related with the differences in behaviour that you describe here ? Is there a general guideline as to which Avisynth source plugin to preferably use for each type of video file format ?
    (I don't mean to hijack the thread of a ***, but since the *** has been sleeping for about 24 hours...)
    Quote Quote  
  12. Originally Posted by abolibibelot View Post
    You're correct LSMASHVideoSource() has trouble with random seeks. It also has problems with the two leading B frames with negative time codes (the video was cut from an open GOP source) -- it repeats the initial I frame for each of those. LWlibavVideoSource() is smart enough to skip those frames.
    I have had trouble using interpolation functions with LWLibavVideoSource as the source plugin for M2TS files, those issues disappeared when the files were loaded with FFVideoSource. Could it be related with the differences in behaviour that you describe here ? Is there a general guideline as to which Avisynth source plugin to preferably use for each type of video file format ?
    (I don't mean to hijack the thread of a ***, but since the *** has been sleeping for about 24 hours...)
    It might be that specific version;

    In my experience LSmash is way more consistent than FFMS2 for transport streams. Especially interlaced AVC. All versions were. FFMS2 readme warns about this

    There is a python super duper random seek script and excel spreadsheet with results tabulated by chaosking, and almost all versions fail seek test except certain versions of LSmash.

    Hard to say , because you have a monster script, a gazillion calls.
    Quote Quote  
  13. oh my ***

    Image
    [Attachment 51455 - Click to enlarge]


    Originally Posted by jagabo View Post
    This is common problem. The frame rate reported by MediaInfo is the field rate, not the frame rate. Many programs interpret this incorrectly. Exactly how you treat it depends on the source filter you use:

    Code:
    LSmashVideoSource("EdiusOUT.mp4") 
    AssumeTFF()
    AssumeFPS(25)
    Trim(0,framecount/2-1)
    Yadif(Mode=1, order=1) # or QTGMC
    Code:
    ffVideoSource("EdiusOUT.mp4") 
    Trim(0,framecount-1)
    SelectEven()
    AssumeTFF()
    Yadif(Mode=1, order=1) # or QTGMC
    Both of those will give you 50p YV12. ConvertToYUY2() if necessary.
    what is "framecount"? is it calcutated from a batch script?
    Quote Quote  
  14. and however the first 2/3 frames seems repeated. Is it normal?
    Quote Quote  
  15. Framecount is a global in AviSynth -- the number of video frames. I already explained why the first frame appears 3 times.
    Quote Quote  
  16. It might be that specific version;

    In my experience LSmash is way more consistent than FFMS2 for transport streams. Especially interlaced AVC. All versions were. FFMS2 readme warns about this

    There is a python super duper random seek script and excel spreadsheet with results tabulated by chaosking, and almost all versions fail seek test except certain versions of LSmash.

    Hard to say , because you have a monster script, a gazillion calls.
    No, in that case those were pre-processing scripts, not the final encoding script (for which an AVI / Lagarith rendered file was loaded with AVISource with no such issue), and the one the second-to-last screenshot (in the thread linked above) was taken from is actually very small, 33 seconds, with a list of 79 FrameSurgeon commands, which normally should be manageable (I made a former version of that movie with all the interpolation commands applied at the encoding stage, there were about 4800 of them and it didn't explode). Here is the native M2TS file, 34MB :
    https://www.mediafire.com/file/pvojgkqxu4t8mii/20151224_145719.m2ts/file
    Here is FrameSurgeon with the currently installed versions of the associated plugins :
    FrameSurgeon + associated plugins (32 bits).7z
    And here is the FrameSurgeon command file used for this video file :
    20151224_145719 FrameSurgeon.txt
    To reproduce the issue (unless it's somehow specifically related with my system, or unless the whole reality is just an illusion and we are the figments of the imagination of a sleeping ***), load the script in AVSPMod, go to frame 240 and refresh, it should show a wrong frame (the first frame of the video actually), then scrub backwards to frames 237-239 (interpolated from 236 and 240 according to the "I3 237" command) to see them weirdly scrambled. Or if you refresh on frame 241, frame 240 appears as a duplicate of frame 241, and frames 237-239 appear almost normal but not properly interpolated (= slightly blurry). Or if you scrub back and forth repeatedly around those frames (but this is harder to reproduce, seems more random), they may start to stutter and the interpolated frames 237-239 will appear extremely blurry. This doesn't happen with FFVideoSource.

    Code:
    LoadPlugin("C:\Logiciels autonomes\MeGUI\tools\lsmash\LSMASHSource.dll")
    LWLibavVideoSource("G:\[path]\20151224_145719.m2ts", threads=1)
    
    FrameSurgeon(cmd="G:\[path]\20151224_145719 FrameSurgeon.txt", show=false)
    Anyway, that movie is now considered finished (unless I foolishly decide to give it yet another whirl of seriously diminished returns improvements come next december, or ten years from now when half the people who are likely to be remotely interested in watching it will have shuffled off their mortal coil), but I'd still be interested in having a better understanding of what's going on here.


    EDIT : I forgot to include the version of LSMASHSource currently used, which is the one in MeGUI's "tools" subfolder (dated 2017-02-24) :
    LSMASHSource (from MeGUI).7z
    Last edited by abolibibelot; 13th Jan 2020 at 17:44.
    Quote Quote  
  17. Image
    [Attachment 51459 - Click to enlarge]


    but can FrameSurgeon replace (for example)

    Code:
    SmoothFPS2(50000,1000)
    ?
    Quote Quote  
  18. and however I wonder: this strange condition of "ambiguous framerate" .. e.g "Frame rate : 50.000 FPS
    Original frame rate : 25.000 FPS
    " is common also for porogressive sources ?!? or affects only interlaced ?!?
    Quote Quote  
  19. I've only seen this particular problem (confusion over the true frame rate) with interlaced video with Scan type = Separated fields. It's not uncommon.
    Last edited by jagabo; 13th Jan 2020 at 19:43.
    Quote Quote  
  20. Originally Posted by abolibibelot View Post
    To reproduce the issue
    Very weird indeed. You don't need any scripts, just source filter. Go to frame 240. Refresh .

    Affects several Lsmash versions, x86, x64, including the latest. Threads=1 too. Both avs/vapoursynth versions too

    But only CPU. GPU decoding via Nvidia/CUVID works (decoder="h264_cuvid") with those newer branches work (with the framesurgeon script too). What a flip flop! It used to be GPU decode quite unstable in lsmash, very flaky. (And DGDecNV, the "gold standard" works of course here too)

    (FFMS2 works here , as you reported, several versions. But beware it has many more "fails" than Lsmash overall across all scenarios)

    It might be related to the frame repeat flag in your video. But problem still persists with repeat=true and selecteven() or selectodd()


    With your permission , I'd like to report this lsmash CPU decoding seek issue with your sample video - it's the only way things get "fixed" . And there is an active developer around right now.
    Last edited by poisondeathray; 13th Jan 2020 at 20:06.
    Quote Quote  
  21. Originally Posted by marcorocchini View Post

    but can FrameSurgeon replace (for example)

    Code:
    SmoothFPS2(50000,1000)
    ?
    No, it's used for interpolating over (replacing) specific frame ranges, using "good" reference frames (you manually specify the ranges)
    Quote Quote  
  22. Very weird indeed. You don't need any scripts, just source filter. Go to frame 240. Refresh .
    Yes, for the display of frame #1 instead of #240 it behaves that way with just the LWLibavVideoSource line, but what I described was specifically meant to reproduce the particular scrambled screenshot from the Doom9 thread (and I probably wouldn't have noticed it without the insane level of scrutiny required to fix footage frame by frame). Most likely this effect is simply due to the fact that the interpolation algorithm is trying to interpolate three frames in a row out of two very different adjacent frames (#236 and #1 "posing" as #240).

    Affects several Lsmash versions, x86, x64, including the latest. Threads=1 too. Both avs/vapoursynth versions too

    But only CPU. GPU decoding via Nvidia/CUVID works (decoder="h264_cuvid") with those newer branches work (with the framesurgeon script too). What a flip flop! It used to be GPU decode quite unstable in lsmash, very flaky. (And DGDecNV, the "gold standard" works of course here too)
    "Gold standard" in what sense ? GPU decoding is not an option on my current system as I don't have a discrete graphic card...

    (FFMS2 works here , as you reported, several versions. But beware it has many more "fails" than Lsmash overall across all scenarios)

    It might be related to the frame repeat flag in your video. But problem still persists with repeat=true and selecteven() or selectodd()

    With your permission , I'd like to report this lsmash CPU decoding seek issue with your sample video - it's the only way things get "fixed" . And there is an active developer around right now.
    Alright then... perhaps my aunt Monique will finally have her 15 minutes of fame ! (She has no follower, she doesn't post on Twitter, she doesn't even own a computer.)
    If that matters, the video was shot with a Panasonic ZS7 / TZ10 compact camera.
    Perhaps send me a private message if there's some feedback somewhere at some point...
    Could you figure out why it affects this frame in particular ? Is there a way to systematically detect those problematic frames ? I tried SeekTester (suggested on the Doom9 thread) but only got a "script error" message (tried several source plugins, several file formats), don't know if I did something wrong.


    @ marchorocchini
    but can FrameSurgeon replace (for example)
    As already explained by “poisondeathray”, and as the name implies, FrameSurgeon is specifically meant to fix / replace / interpolate bad / corrupted / blurry frames, visually identified as such. It can handle quite a lot of interpolations in the same script (as a separate list of commands) but it's not meant as an automated filter to convert the framerate – although, from what I could understand, it is roughly based on the same methods "under the hood".
    Quote Quote  



Similar Threads

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