VideoHelp Forum




+ Reply to Thread
Results 1 to 7 of 7
  1. There was 4 frames (24366,24367,24368,24369 frame) damaged in my video record (196420 frames in total). I extract damaged frames as .bmp with AvsPmod. And fixed with photoshop.

    Tried many time, couldn't replace them .

    Some tries without success:

    Code:
    #Source
    ...
    B=ImageSource("E:\Poem (1972)\GBR\Theatrical Cut\%03d.bmp", end=196420).ConvertToYV12 ()
    
    
    ReplaceFramesSimple(last, B, mappings="[24366 24369]")
    ------------------

    Code:
    #Source
    ...
    
    B=ImageSource("E:\Poem (1972)\GBR\Theatrical Cut\000.bmp", end=196420).ConvertToYV12 ()
    
    ReplaceFramesSimple(last, B, mappings="[24366 24369]")
    Any replies appreciated!
    Quote Quote  
  2. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    What does "couldn't replace them" mean? The old frames didn't change? You see error messages?

    RemapFrames has a tricky syntax. I tried this years ago on a clip that had frames out of sequence:
    Code:
    BaseVid=last
    SourceVid=ImageSource("E:\Poem (1972)\GBR\Theatrical Cut\000.bmp",end=4,pixel_type="YV12")
    
    BaseClip=BaseVid
    BaseClip=BaseClip.RemapFrames(mappings="
    [24366 24369] [0 3]
    ",SourceClip=SourceVid)
    return last
    Last edited by LMotlow; 26th Apr 2020 at 00:07.
    - My sister Ann's brother
    Quote Quote  
  3. I do it a slightly different way, and a single frame at a time. Maybe you can modify the following snippet to make it replace all your frames at once:

    Q=ImageSource("xxxxx.bmp",End=xxxxx).ConvertToYV12 ()
    ReplaceFramesSimple(Last,Q,Mappings="xxxxx ")


    xxxxx is the frame number to be replaced and xxxxx.bmp is the edited picture (named after its frame number). Q is used so as not to interfere with other letters used throughout the script.

    And, as LMotlow wrote, always include the error messages that VDub gives you.
    Quote Quote  
  4. I'm glad about responses, thanks!

    Sorry for not being clear.

    This thing made me angry.

    All 4 scripts in below opening avspmod without error. But all of them has own problem:


    All replaced frames are total black.

    Code:
    B=ImageSource("E:\Poem (1972)\GBR\Theatrical Cut\%03d.bmp", end=196420).ConvertToYV12 ()
    
    
    ReplaceFramesSimple(last, B, mappings="[24366 24369]")

    All replaced only with 000.bmp:

    Code:
    B=ImageSource("E:\Poem (1972)\GBR\Theatrical Cut\000.bmp", end=196420).ConvertToYV12 ()
    
    ReplaceFramesSimple(last, B, mappings="[24366 24369]")
    Nothing changed, same bad frames here:

    Code:
    BaseVid=last
    SourceVid=ImageSource("E:\Poem (1972)\GBR\Theatrical Cut\000.bmp",end=4,pixel_type="YV12")
    
    BaseClip=BaseVid
    BaseClip=BaseClip.RemapFrames(mappings="
    [24366 24369] [0 3]
    ",SourceClip=SourceVid)
    return last
    Only frame 22366 replaced with 000.bmp:

    Code:
    last=FFVideoSource("POEM.mkv")
    
    Q=ImageSource("000.bmp",End=24366).ConvertToYV12 ()
    ReplaceFramesSimple(Last,Q,Mappings="24366")
    Quote Quote  
  5. If the file names are 24366.bmp .....

    Code:
    orig=FFVideoSource("POEM.mkv")
    
    Q=ImageSource("%05d.bmp",start=24366, End=24370, fps=orig.framerate).ConvertToYV12()
    
    orig.trim(0,24365) + Q + orig.trim(24371,0)
    If the filenames were 000.bmp.... It would be

    Code:
    Q=ImageSource("%03d.bmp",start=0, End=4, fps=orig.framerate).ConvertToYV12()
    If you converted to the BMP for photoshop using ConvertToRGB default settings, it would use Rec601 . Then ConvertToYV12() would be correct to "reverse" it. Normally 709 is used for "HD", but you didn't mention what you have
    Quote Quote  
  6. Originally Posted by poisondeathray View Post
    If the file names are 24366.bmp .....

    Code:
    orig=FFVideoSource("POEM.mkv")
    
    Q=ImageSource("%05d.bmp",start=24366, End=24370, fps=orig.framerate).ConvertToYV12()
    
    orig.trim(0,24365) + Q + orig.trim(24371,0)
    If the filenames were 000.bmp.... It would be

    Code:
    Q=ImageSource("%03d.bmp",start=0, End=4, fps=orig.framerate).ConvertToYV12()
    If you converted to the BMP for photoshop using ConvertToRGB default settings, it would use Rec601 . Then ConvertToYV12() would be correct to "reverse" it. Normally 709 is used for "HD", but you didn't mention what you have
    Thank you , really!

    I can sleep now.
    Quote Quote  
  7. Member
    Join Date
    May 2014
    Location
    Memphis TN, US
    Search PM
    Originally Posted by poisondeathray View Post
    If the file names are 24366.bmp .....

    Code:
    orig=FFVideoSource("POEM.mkv")
    
    Q=ImageSource("%05d.bmp",start=24366, End=24370, fps=orig.framerate).ConvertToYV12()
    
    orig.trim(0,24365) + Q + orig.trim(24371,0)
    If the filenames were 000.bmp.... It would be

    Code:
    Q=ImageSource("%03d.bmp",start=0, End=4, fps=orig.framerate).ConvertToYV12()
    If you converted to the BMP for photoshop using ConvertToRGB default settings, it would use Rec601 . Then ConvertToYV12() would be correct to "reverse" it. Normally 709 is used for "HD", but you didn't mention what you have

    Good job, spotting that simple fix.
    - My sister Ann's brother
    Quote Quote  
Visit our sponsor! Try DVDFab and backup Blu-rays!