VideoHelp Forum
+ Reply to Thread
Page 2 of 2
FirstFirst 1 2
Results 31 to 47 of 47
Thread
  1. Thanks for all your answers. I'll try to work out a method for my resources over the weekend.
    I think I'll try Sharc's ffmpeg method (if I force lossless recording on it) and Avidemux at the beginning.
    Avisynth will be next, but I need to learn more about it, at least to a minimal degree. Now I see that such tools can really improve the quality of a film (as Sharc showed in #6), but considering that I have about a hundred of these films, if not more, I don't have enough time to 'fine-tune' each film individually. I'll have to adopt some average set of operations.
    You've been very patient and very helpful, thanks again!
    Quote Quote  
  2. Originally Posted by abramq View Post
    ... This works! So I have another solution for my movies. Thanks!
    P.S.
    With -crf 0 the target movie has no video, there is only audio played. Any -crf > 0 works well.
    This worries me a bit, because -crf > 0 already implies compression, which I wanted to avoid at the stage of preparing the "raw" movie for editing.
    Strange, are you sure? Maybe your player is the culprit? Outdated ffmpeg? -crf 0 works perfectly here, see the attached file. Anyway, -crf 1...5 are "visually lossless". You won't be really missing anything of your source (or you tell me...).

    Alternatively, you may also want to try the commandline of post#22. The huffyuv codec is absolutely lossless.
    (You may substitute the huffyuv codec by any other lossless codec and/or other container which is supported by ffmpeg. You would have to modify the commandline accordingly of course).
    Image Attached Files
    Last edited by Sharc; 6th Aug 2024 at 12:59.
    Quote Quote  
  3. Originally Posted by abramq View Post
    Originally Posted by Sharc View Post
    If you just want to crop the borders off you may want to use the ffmpeg commandline:
    Code:
    ffmpeg -i "20030719_165926.MOV" -c:a copy -c:v libx264 -preset slow -crf 20 -pix_fmt yuv420p -vf "crop=320:240:0:0,setdar=4/3" "cropped.mov"
    (You can set -crf 0 to produce a lossless output)
    This works! So I have another solution for my movies. Thanks!
    P.S.
    With -crf 0 the target movie has no video, there is only audio played. Any -crf > 0 works well.
    This worries me a bit, because -crf > 0 already implies compression, which I wanted to avoid at the stage of preparing the "raw" movie for editing.
    There is no advantage with crf 0 for such a small resolution.
    Stay with -crf 20 and -preset veryfast.
    Quote Quote  
  4. Originally Posted by ProWo View Post
    Originally Posted by abramq View Post
    Originally Posted by Sharc View Post
    If you just want to crop the borders off you may want to use the ffmpeg commandline:
    Code:
    ffmpeg -i "20030719_165926.MOV" -c:a copy -c:v libx264 -preset slow -crf 20 -pix_fmt yuv420p -vf "crop=320:240:0:0,setdar=4/3" "cropped.mov"
    (You can set -crf 0 to produce a lossless output)
    This works! So I have another solution for my movies. Thanks!
    P.S.
    With -crf 0 the target movie has no video, there is only audio played. Any -crf > 0 works well.
    This worries me a bit, because -crf > 0 already implies compression, which I wanted to avoid at the stage of preparing the "raw" movie for editing.
    There is no advantage with crf 0 for such a small resolution.
    Stay with -crf 20 and -preset veryfast.
    I don't quite agree. The OP wants to reproduce an exact replica of his source for later post processing, even if the source is of poor quality with artifacts. He wants to reproduce the existing artefacts rather than alter them in any respect. A re-encode with a high crf produces new artefacts, may soften the picture somewhat etc. A new artifact of say one pixel has a higher relative impact on a small framesize of say 320x240 than on a large frame of say 1920x1080. That's one reason why for small framesizes (resolutions) it is generally recommended to reduce the crf for similar perceived reproduction quality compared to larger frame sizes (higher resolutions).
    So for an intermediate file for later postprocessing it makes sense to encode lossless (or visually lossless, low crf) even though the source may be of poor quality.
    Last edited by Sharc; 6th Aug 2024 at 17:08.
    Quote Quote  
  5. Originally Posted by Sharc View Post
    I don't quite agree. The OP wants to reproduce an exact replica of his source for later post processing...
    I didn't see that, sorry...
    Quote Quote  
  6. Originally Posted by ProWo View Post
    Originally Posted by Sharc View Post
    I don't quite agree. The OP wants to reproduce an exact replica of his source for later post processing...
    I didn't see that, sorry...
    No problem. That's what I thought
    Quote Quote  
  7. Originally Posted by Sharc View Post
    With temporal interpolation (video only for this demo):
    Code:
    LWLibavVideoSource("20030719_165926.MOV")
    Crop(0, 0, -32, -48)
    spline36resize(640,480)
    QTGMC(InputType=3) #reduces jaggies, rainbows ...
    assumefps(15.0)
    v_RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f")
    v_RIFE=v_RGB.RIFE(gpu_thread=1, model=25, fps_num=30000, fps_den=1000, sc=true, sc_threshold=0.3) # motion interpolate to 30 fps
    v_YV12=v_RIFE.z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l")
    return v_YV12
    Hello again!
    Installing and configuring AviSynth+ wasn't easy, but I didn't give up Ultimately, there were two solutions left on the battlefield:

    1. VirtualDub2 with filters as below
    Image
    [Attachment 81431 - Click to enlarge]

    2. AviSynth (supported by VirtualDub2) and a script by Sharc as above (I only changed the model from 25 to 54 - the difference is not really noticeable, I wanted to check if the higher model would improve anything)

    From both points, I exported files in VirtualDub2 without any compression and then loaded them into the Filmora video editor and converted them to mp4 at 30 fps.

    The undisputed winner is solution 2. while the image itself is of similar quality, the smoothness of the display is much better than in the first point. Filmora probably can't convert from 15 to 30 fps that well. I enclose here both final movies.

    Perhaps it would be possible to add a 15->30fps filter to the first point, but that's probably due to something external.

    Unfortunately, I encountered a problem - the second point gave me a video without audio... Do I have to process them separately in this method and then somehow join them? I don't hide the fact that it would add a lot of work to me because I have a lot of movies to convert.

    Regards!
    Image Attached Files
    Quote Quote  
  8. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Re the VDub process, you shouldn't be deinterlacing; it's already Progressive as far as I can tell. You're probably taking out good frames, making the motion jerkier.

    If you set up the deinterlacer in VDub, choose Double Rate Top field first then step thru the video, you'll see movement on every second frame. That means it's Progressive already.

    I might have that all wrong, of course, so in that case I will be punished by you know who. But I can cope.
    Quote Quote  
  9. Originally Posted by abramq View Post
    I encountered a problem - the second point gave me a video without audio.
    Here is what you can get from AviSynth with some additional processing, and with audio too:
    Code:
     FFVideoSource("G:\_320GB\500gb\out\test y\20030719_kodak6340.MOV")
    A=ffAudiosource("G:\_320GB\500gb\out\test y\20030719_kodak6340.MOV")
    
     ConverttoYUV422
     assumefps(15)
    
     crop(0,0,320,240)
     src=last 
    
     Deblock(30)
     XAA(mode="di v 2 SangNom2", csharp=1, mask=1, mtype="TEMmod")
     SMDegrain(tr=2,thSAD=800,contrasharp=0,prefilter=3,refinemotion=true,LFR=false)    prefetch(6)
    
     CAS(0.5)  MultiSharpen(1)  Removegrain(1) 
     NonlinUSM(str=0.4, pow=4.0, rad=4)  # adjust mostly str
    
     Finedehalo()
     Dehalo_alpha(rx=2.1, ry=1.6, darkstr=0.5, brightstr=0.5)   
     #AWarpSharpDering(debug=0, diffthresh=16, lumathresh=160)
     prefetch(4)
    
     AiUpscale(2).removegrain(2)
     FRC_rife(colorm="Rec601")
    
     #deep_resize(src.width*2, src.height*2)
     #spline64resize(src.width*2, src.height*2)
     #return StackHorizontal(last, src.bicubicresize(last.width, last.height))
     
    return Audiodub(last,A)
    Image Attached Files
    Quote Quote  
  10. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Nice work Buzz.
    Quote Quote  
  11. Originally Posted by abramq View Post
    .... Unfortunately, I encountered a problem - the second point gave me a video without audio... Do I have to process them separately in this method and then somehow join them? I don't hide the fact that it would add a lot of work to me because I have a lot of movies to convert.
    Modified script (blue) of post#6 to include the audio (and interpolate to 60fps if preferred):
    Code:
    v=LWLibavAudioSource("20030719_165926.MOV")
    a=LWLibavVideoSource("20030719_165926.MOV")
    AudioDub(v,a)
    Crop(0, 0, -32, -48)
    spline36resize(640,480)
    assumefps(15.0)
    v_RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f")
    v_RIFE=v_RGB.RIFE(gpu_thread=1, model=25, fps_num=60000, fps_den=1000, sc=true, sc_threshold=0.3) # motion interpolate to 60 fps
    v_YV12=v_RIFE.z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l")
    
    return v_YV12
    Last edited by Sharc; 13th Aug 2024 at 07:50.
    Quote Quote  
  12. Originally Posted by buzz1891 View Post
    Here is what you can get from AviSynth with some additional processing, and with audio too:
    Code:
     FFVideoSource("G:\_320GB\500gb\out\test y\20030719_kodak6340.MOV")
    A=ffAudiosource("G:\_320GB\500gb\out\test y\20030719_kodak6340.MOV")
     (...)
    Wow, the attached video is impressive, very impressive. Although the characters look a bit like in an oil painting, getting such quality from a 320x240 video is something really big.
    It took me some time to configure AviSynth with all these functions, labels, and scripts but in the end I (almost) succeeded - I can't find FRC_rife anywhere - where can I download it?
    Thank you for this amazing post!
    Quote Quote  
  13. Originally Posted by Sharc View Post
    Modified script (blue) of post#6 to include the audio (and interpolate to 60fps if preferred):
    Code:
    v=LWLibavAudioSource("20030719_165926.MOV")
    a=LWLibavVideoSource("20030719_165926.MOV")
    AudioDub(v,a)
    (...)
    Now I have everything I need (of course after changing a/v variables above ) My and my family thank you!
    Last edited by abramq; 14th Aug 2024 at 02:46.
    Quote Quote  
  14. I can't find FRC_rife anywhere - where can I download it?
    It's just (my) simple wrapper function for the RIFE plugin for fps up-conversion. Just in case you want to use it as is:

    Code:
    function FRC_rife (clip c, int "knum", int "kden", int "model", string "colorm") {
      knum    = default (knum,      2)
      kden    = default (kden,      1)
      model   = default (model,    47)
      colorm  = default (colorm, "Rec709")
      c
      z_ConvertFormat(pixel_type="RGBPS")
      RIFE(model=model, factor_num=knum, factor_den=kden)
      ConvertBits(c.BitsPerComponent).ConverttoYUV420(matrix=colorm)  
      return last
     }
    Quote Quote  
  15. If you don't mind, one more small question: I'm trying to combine several (a dozen or so) short videos into one and only then process them, but it only works with the ++ operator, which, as I've read, is not recommended. I mean this works:
    Code:
     v1=LWLibavVideoSource("20030720_170532.MOV").assumefps(15.0)
     a1=LWLibavAudioSource("20030720_170532.MOV").assumefps(15.0)
     v2=LWLibavVideoSource("20030719_165926.MOV").assumefps(15.0)
     a2=LWLibavAudioSource("20030719_165926.MOV").assumefps(15.0)
     av1=AudioDub(v1,a1)
     av2=AudioDub(v2,a2)
     av1 ++ av2
     Crop(0, 0, -32, -48)
     spline36resize(640,480)
     QTGMC(InputType=3) #reduces jaggies, rainbows ...
     v_RGB=z_ConvertFormat(pixel_type="RGBPS", colorspace_op="709:709:709:l=>rgb:709:709:f")
     v_RIFE=v_RGB.RIFE(gpu_thread=1, model=25, fps_num=30000, fps_den=1000, sc=true, sc_threshold=0.3) # motion interpolate to 30 fps
     v_YV12=v_RIFE.z_ConvertFormat(pixel_type="YUV420P8", colorspace_op="rgb:709:709:f=>709:709:709:l")
     
     return v_YV12
    But this:
    Code:
    v=LWLibavVideoSource("20030720_170532.MOV") + LWLibavVideoSource("20030719_165926.MOV")
    a=LWLibavVideoSource("20030720_170532.MOV") + LWLibavVideoSource("20030719_165926.MOV")
    AudioDub(v,a)
    (...)
    error: Splice: Video frame rate doesn't match (I don't know why, those are identical formats...)
    Code:
    v=LWLibavVideoSource("20030720_170532.MOV").assumefps(15.0) + LWLibavVideoSource("20030719_165926.MOV").assumefps(15.0)
    a=LWLibavVideoSource("20030720_170532.MOV").assumefps(15.0) + LWLibavVideoSource("20030719_165926.MOV").assumefps(15.0)
    AudioDub(v,a)
    (...)
    error: AudioDub: need an audio and a video track
    Code:
    v=LWLibavVideoSource("20030720_170532.MOV" + "20030719_165926.MOV").assumefps(15.0)
    a=LWLibavVideoSource("20030720_170532.MOV" + "20030719_165926.MOV").assumefps(15.0)
    AudioDub(v,a)
    (...)
    error: Failed to avformat_open_input
    Code:
    v=LWLibavVideoSource("20030720_170532.MOV" + "20030719_165926.MOV")
    a=LWLibavVideoSource("20030720_170532.MOV" + "20030719_165926.MOV")
    AudioDub(v,a)
    (...)
    error: Failed to avformat_open_input

    Is there another form of notation?
    Quote Quote  



Similar Threads

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