VideoHelp Forum
+ Reply to Thread
Results 1 to 16 of 16
Thread
  1. Hi, however it's true: I'm a cat

    Please help: consider this source DJI_0001.MP4 that is a original clip of 50P footage of a osmo x3 camera

    https://www.dropbox.com/s/s2qpwef3xomx1ik/DJI_0001.MP4?dl=0

    Original .mp4 files is "good", but I need to create a xdcamhd 50i output file from this 50p source.

    So I try to use this avisynth script:

    Code:
    LoadPlugin("v:\automazioneclip\AviSynth\Lsmash64perVirtualDub64\LSMASHSource.dll")
    vid=LSMASHVideoSource("V:\casola\DJI_0001.MP4").ConvertToYUY2(interlaced=false).AssumeTFF().SeparateFields().SelectEvery(4, 0, 3).Weave()    
    aud=LWLibavAudioSource("V:\casola\DJI_0001.MP4",stream_index=1      )
    left=GetChannel(aud, 1)
    right=GetChannel(aud, 1)
    both=mergechannels(left, right)
    audiodub(vid, both)
    ConvertAudioTo16Bit()
    exposed output is now 50i but in the output image I see a little flickering jittering artifacts in the detailed area.

    https://www.dropbox.com/s/fj0q43sf6pdn404/output.mxf?dl=0 is the "problematic" output but the twittering on details is not too in evidence, however if possible I like to remove it.

    Please is there a way to a apply a little filtering that only acts in the detailed area and preserve the rest of image from an excessive blurring or loss of detail? or a filter that acts with lowpass filter on moving parts?
    Image
    [Attachment 49556 - Click to enlarge]


    thanks
    Last edited by marcorocchini; 16th Jul 2019 at 17:37.
    Quote Quote  
  2. Add a slight vertical blur before interlacing. You can use a mask to limit it to sharp horizontal edges.
    Quote Quote  
  3. Originally Posted by jagabo View Post
    Add a slight vertical blur before interlacing. You can use a mask to limit it to sharp horizontal edges.

    "a slight vertical blur before interlacing"

    please can you modify the avisynth script to do that?
    Quote Quote  
  4. Since your camera is oversharpening I'd blur a little horizontally too. Blur(0.5, 1.0). Adjust to suit.
    Quote Quote  
  5. thanks jagabo, it works but now I ask a question:

    I have noted that, because of the lens, the jittering artifacts are presents overall in the central portion of image. Can I apply the blur only in the central area perhaps using a soft gradient mask with key ? something like the attached mask (I cannot able to be create a gradient mask)

    https://www.dropbox.com/s/jx0hbq0089if7yv/mask.tga?dl=0
    Quote Quote  
  6. One way of blurring an image is to downscale it and upscale it. Here I also used BinomialBlur() to blur more while downscaled:

    Code:
    ImageSource("mask.tga") 
    ConvertToYV12()
    BilinearResize(64,36).BinomialBlur(5.0).Spline36Resize(width,height)
    Image
    [Attachment 49571 - Click to enlarge]
    Quote Quote  
  7. Not hugely related to the topic at hand, but am I missing something in that AviSynth script in the original post or would it actually convert 50p to 25i, not 50i?
    Quote Quote  
  8. 25i and 50i are the same thing. Marketing just started using 50i because it sounds better.
    Quote Quote  
  9. thank you jagabo but the avisynth-script how it can be changed to introduce the mask.tga, and where I can download the right mask.tga?

    I suppose that mask.tga contain an alpha-key channel or I mistake?

    however once is generate the .tga how it can be applyed in the avisynth script to get the blur only in the "white" area contained in the mask.tga?
    Quote Quote  
  10. Originally Posted by jagabo View Post
    what program have you use to generate this radius? it's similar as the one I need

    simple I think I need a .tga of it with an alpha channel, and overlay with the blur setting Blur(0.5, 1.0) so that the blur is active - in the final image - only inside the radius and with it's gradient. But how the script should be modified to do that?
    Quote Quote  
  11. Originally Posted by marcorocchini View Post
    what program have you use to generate this radius? it's similar as the one I need
    Any picture editor can do the job. Make it the same resolution as your video, Draw a white oval inside of a black screen and then blur it. I use PhotoFiltre for such things all the time.

    But how the script should be modified to do that?
    I use BMP and here's a sample script:

    B=Blur(0.5, 1.0)
    Mask=ImageSource("Blur.bmp")
    Overlay(Last,B,0,0,Mask)


    That's if you want it done for the entire video.
    Quote Quote  
  12. The TGA image you linked to included an alpha channel but it was the same as the image. So you could use the image or the alpha a mask. I gave you the sample AviSynth code to create a blurry mask from the TGA image. Slightly modified for use in the context of your script:

    Code:
    LSmashVideoSource("DJI_0001.MP4")
    ovalmask = ImageSource("mask.tga", pixel_type="RGB32").ConvertToYV12(matrix="PC.601").BilinearResize(64,36).BinomialBlur(5.0).Spline36Resize(width,height)
    Overlay(last, last.Blur(0.5, 1.0), mask=ovalmask)

    If you needed to use the alpha channel instead of the image:

    Code:
    LSmashVideoSource("DJI_0001.MP4")
    ovalmask = ImageSource("mask.tga", pixel_type="RGB32").ShowAlpha().ConvertToYV12(matrix="PC.601").BilinearResize(64,36).BinomialBlur(5.0).Spline36Resize(width,height)
    Overlay(last, last.Blur(0.5, 1.0), mask=ovalmask)
    Or you could just use the blurry image i uploaded:

    Code:
    LSmashVideoSource("DJI_0001.MP4")
    ovalmask = ImageSource("blur.jpg").ConvertToYV12(matrix="PC.601")
    Overlay(last, last.Blur(0.5, 1.0), mask=ovalmask)
    Quote Quote  
  13. Image
    [Attachment 49588 - Click to enlarge]
    thanks seems to works

    in the meantime I have try a something like this to pass also audio:

    Code:
    LoadPlugin("v:\automazioneclip\avisynth\plugins\LSMASHSource.dll")
    #LoadPlugin("v:\automazioneclip\AviSynth\Lsmash64perVirtualDub64\LSMASHSource.dll")
    LSMASHVideoSource("v:\casola\concatHD.mov")
    B=Blur(0.1,0.5)
    Mask=ImageSource("d:\blur4.jpg")
    Overlay(last,B,0,0,Mask)  
    
    vid=last
    aud=LWLibavAudioSource("V:\casola\DJI_0001.MP4")
    left=GetChannel(aud, 1)
    right=GetChannel(aud, 1)
    both=mergechannels(left, right)
    audiodub(vid, both)
    ConvertAudioTo16Bit()
    Quote Quote  
  14. if I don't ask too much: can I do the same using only ffmpeg?
    Quote Quote  
  15. please help a cat: I try to do the same thing but using ffmpeg

    my source DJI_0001.MP4 is https://www.dropbox.com/s/s2qpwef3xomx1ik/DJI_0001.MP4?dl=0

    and this is the mask: Image
    [Attachment 49592 - Click to enlarge]


    I try to get the blur only on the white zone of the mask file using this ffmpeg commandline:

    Code:
    ffmpeg.exe -i v:\casola\DJI_0001.MP4 -i d:\bluR4.jpg -filter_complex "[1:v][1:v]alphamerge,boxblur=10[alf];[0:v][alf]overlay[v]" -map "[v]" -an -c:v libx264 maskedblur.mp4
    I get this wrong result:

    Image
    [Attachment 49593 - Click to enlarge]


    where is the error in the ffmpeg commandline? and how can I tell to ffmpeg that, possibly, it have to apply the equivalent blur of avisynth B=Blur(0.1,0.5)

    And a second question:

    I need to add the
    Code:
    -vf interlace
    into the commandline, but in what point?

    thanks
    Last edited by marcorocchini; 20th Jul 2019 at 09:30.
    Quote Quote  
  16. I try this:

    Code:
    ffmpeg64bit_2019.exe -y -threads auto -i DJI_0001.MP4 -i d:\bluR4.jpg -loop 1 -filter_complex "[0:v][1:v]alphamerge,boxblur=10[alf];[0:v][alf]overlay[v]" -map "[v]" -pix_fmt yuv420p -c:v libx264 -profile:v main -level:v 4.2 -g 33 -bf 2 -crf 22 -flags +ildct+ilme -top 1 -c:a aac -strict -2 -b:a 256k -ar 48000 maskedBlur.mp4
    I get this result:

    Image
    [Attachment 49594 - Click to enlarge]


    but the output stream is alwais 50 FPS, at this point I need to apply blur as avisynth (like B=Blur(0.1,0.5)) and interlace using something like

    Code:
    -vf interlace=lowpass=0:scan=tff
    but where I can intergrate the interlace command in the commandline?

    and why during encoding I get "buffer queue overflow" error?

    Image
    [Attachment 49595 - Click to enlarge]
    Quote Quote  



Similar Threads

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