VideoHelp Forum
+ Reply to Thread
Results 1 to 20 of 20
Thread
  1. I have 4 video files (mkv container) of the same event but one of them has a variable frame rate mode and other 3 have a constant frame rate mode. MediaInfo says that in all cases the frame rate is 25fps. All videos are interlaced. What is the best way (software, settings) to join them?
    Quote Quote  
  2. Anyone willing to explain how to do this with AviSynth?
    Quote Quote  
  3. Something like this in AviSynth:

    Code:
    function CFRSource(string filename)
    {
        a = LWlibavAudioSource(filename)
        v = LWlibavVideoSource(filename, fpsnum=25000, fpsden=1000)
        AudioDub(v,a)
    }
    
    
    av1 = CFRSource("file1.mkv")
    av2 = CFRSource("file2.mkv")
    av3 = CFRSource("file3.mkv")
    av4 = CFRSource("file4.mkv")
    
    av1++av2++av3++av4
    You'll need the LSMASHSource plugin: http://avisynth.nl/index.php/LSMASHSource
    Last edited by jagabo; 20th May 2020 at 07:18.
    Quote Quote  
  4. Thanks jagabo. I'm using MeGUI to run AviSynth scripts. MediaInfo says that all videos have a constant bitrate mode with a bitrate of 17.6 Mb/s and a maximum bitrate of 18 Mb/s. How to adjust encoding parameters to keep the original quality?
    Quote Quote  
  5. When encoding with lossy codecs you will always lose quality. But if you encode with x264 at the slow preset (or any of the slower presets if you can stand to wait) at CRF 12 your output will hard to tell from the original, even when examining enlarged still frames. At 18 the video will look almost as good as the original at normal playback speeds but if you zoom in to still frames you'll see small differences.

    It's possible to remux (no loss of quality) your mixed CFR and VFR videos into a single A/V file. But some players may have problems with it. ffmpeg is probably the best tool for that.
    Quote Quote  
  6. Thanks jagabo, it's clear now.

    Another question I have is related to my dilemma whether to deinterlace videos in my soccer video archive. I have a bunch of soccer matches and till now I was watching those videos on my old CRT monitor. I would like to buy some modern monitor but as far as I understood, they are showing a progressive content only. What would be better to do considering that I would play those videos on my computer only? I was thinking if I keep them in the original interlaced form, perhaps some real-time deinterlacers in the future would be able to deinterlace them while playing. Not sure how good are current real-time deinterlacers, perhaps someone can write more about that.
    Quote Quote  
  7. Member
    Join Date
    Mar 2008
    Location
    United States
    Search Comp PM
    Originally Posted by Santuzzu View Post
    Thanks jagabo, it's clear now.

    Another question I have is related to my dilemma whether to deinterlace videos in my soccer video archive. I have a bunch of soccer matches and till now I was watching those videos on my old CRT monitor. I would like to buy some modern monitor but as far as I understood, they are showing a progressive content only. What would be better to do considering that I would play those videos on my computer only? I was thinking if I keep them in the original interlaced form, perhaps some real-time deinterlacers in the future would be able to deinterlace them while playing. Not sure how good are current real-time deinterlacers, perhaps someone can write more about that.
    If the files are flagged interlaced, the media player used in playback would most likely de-interlace on the fly. Similar to playing them on the TV.
    I would leave them alone
    Quote Quote  
  8. If you are going to reencode the videos anyway (to reduce the file size, filter noise, etc.), and if you are willing to wait for the long encoding times using QTGMC(), you should deinterlace before encoding. Otherwise, don't bother. TVs and media players all have the ability to deinterlace, typically with quality similar to Yadif(mode=1).
    Quote Quote  
  9. So, we could say that cons of choosing deinterlacing are:

    1) Too long processing time
    2) Possibility that someday might appear better deinterlacing algorithms from the aspect of visual quality

    Is there anything else I'm missing here?
    Quote Quote  
  10. Originally Posted by Santuzzu View Post
    So, we could say that cons of choosing deinterlacing are:

    1) Too long processing time
    2) Possibility that someday might appear better deinterlacing algorithms from the aspect of visual quality
    That's the way I see it. You might add that encoding after QTGMC to 60p increases the bitrate requirement a little (over encoding at 30i). And some older devices can't handle 60p playback.
    Quote Quote  
  11. Originally Posted by jagabo View Post
    Something like this in AviSynth:

    Code:
    function CFRSource(string filename)
    {
        a = LWlibavAudioSource("file1.mkv")
        v = LWlibavVideoSource("file1.mkv", fpsnum=25000, fpsden=1000)
        AudioDub(v,a)
    }
    ...
    Shouldn't the "file1.mkv" be "filename?"

    Studying and trying to understand your interesting code...
    Last edited by GrouseHiker; 19th May 2020 at 21:55.
    Quote Quote  
  12. Thanks jagabo and davexnet. I guess I will do some processing, including deinterlacing, with SD videos only. HD videos I will leave like that.
    Quote Quote  
  13. Originally Posted by GrouseHiker View Post
    Originally Posted by jagabo View Post
    Something like this in AviSynth:

    Code:
    function CFRSource(string filename)
    {
        a = LWlibavAudioSource("file1.mkv")
        v = LWlibavVideoSource("file1.mkv", fpsnum=25000, fpsden=1000)
        AudioDub(v,a)
    }
    ...
    Shouldn't the "file1.mkv" be "filename?"
    Oops, sorry. Copy/paste error. It should be filename. Fixed the original post.
    Quote Quote  
  14. Isn't it
    Code:
    filename + ".mkv"
    ?
    Quote Quote  
  15. Sorry, more typos (corrected in the original post). Filename is the name of the string variable passed to CFRSource(). As you can see it's called with:

    Code:
    av1 = CFRSource("file1.mkv")
    av2 = CFRSource("file2.mkv")
    av3 = CFRSource("file3.mkv")
    av4 = CFRSource("file4.mkv")
    So the variable "filename" already includes the ".mkv" extension. Writing the function this way allows it to be used to called with different file types -- mkv, mp4, m2ts, etc. The fully corrected example:

    Code:
    function CFRSource(string filename)
    {
        a = LWlibavAudioSource(filename)
        v = LWlibavVideoSource(filename, fpsnum=25000, fpsden=1000)
        AudioDub(v,a)
    }
    
    
    av1 = CFRSource("file1.mkv")
    av2 = CFRSource("file2.mkv")
    av3 = CFRSource("file3.mkv")
    av4 = CFRSource("file4.mkv")
    
    av1++av2++av3++av4
    If you know the extension is always going to be mkv you could do something like this:

    Code:
    function CFRSource(string filename)
    {
        a = LWlibavAudioSource(filename+".mkv")
        v = LWlibavVideoSource(filename+".mkv"), fpsnum=25000, fpsden=1000)
        AudioDub(v,a)
    }
    
    
    av1 = CFRSource("file1")
    av2 = CFRSource("file2")
    av3 = CFRSource("file3")
    av4 = CFRSource("file4")
    
    av1++av2++av3++av4
    Last edited by jagabo; 20th May 2020 at 07:30.
    Quote Quote  
  16. Originally Posted by jagabo View Post

    Code:
    function CFRSource(string filename)
    {
        a = LWlibavAudioSource(filename)
        v = LWlibavVideoSource(filename, fpsnum=25000, fpsden=1000)
        AudioDub(v,a)
    }
    Why do you force the frame rate on the video and not have to force frame rate on the audio?
    Quote Quote  
  17. Audio doesn't have a frame rate, only a duration. Force the frame rate of the 25p CFR segments to 25 fps has no effect. Forcing the frame rate of the VFR source will convert the frame rate to constant, 25 fps. This will be accomplished by duplicating or decimating frames as necessary. The overall length of the video won't be changed. Since the running time of the video doesn't change the running time of the audio doesn't need to change either.
    Quote Quote  
  18. Originally Posted by jagabo View Post
    Audio doesn't have a frame rate, only a duration. Force the frame rate of the 25p CFR segments to 25 fps has no effect. Forcing the frame rate of the VFR source will convert the frame rate to constant, 25 fps. This will be accomplished by duplicating or decimating frames as necessary. The overall length of the video won't be changed. Since the running time of the video doesn't change the running time of the audio doesn't need to change either.
    Thanks... got it!

    What happens to the audio, when the clip is simply brought in with?:

    Code:
    LWlibavVideoSource(filename, fpsnum=25000, fpsden=1000)
    I don't seen any reference to audio here http://avisynth.nl/index.php/LSMASHSource/LWLibavVideoSource
    Quote Quote  
  19. LWlibavVideoSource() only gets the video. There will be no audio.
    Quote Quote  
  20. Originally Posted by jagabo View Post
    LWlibavVideoSource() only gets the video. There will be no audio.
    Hiding in plain sight - should have caught that - thanks!
    Quote Quote  



Similar Threads

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