VideoHelp Forum
+ Reply to Thread
Results 1 to 17 of 17
Thread
  1. Video files out of my Sony camera with .mts extension (i believe is MKV format?) when loaded to VirtualDub2 have a lot of frames corrupted. If i convert them to mp4 container (no re-encoding) with AviDemux then they open just fine, not a single corrupted frame.

    What can be causing this? Inside original VirtualDub with VirtualdubFFMpegPlugin .mts files have no lag, but playback is sluggish.

    Video source file https://www.upload.ee/files/15281379/00017.zip.html
    Quote Quote  
  2. .mts or .m2ts are container formats for Mpeg transport streams. Typical for videocams and blu-ray discs.
    VirtualDub2 shows corrupted frames until it hits the next keyframe (a matter of the decoder). In your case keyframes (I-frames) are found every 24 frames (24, 48, 72 etc.) in the videostream.
    Quote Quote  
  3. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    That source file you posted is already an MP4 (AVC/H264 codec). Can you post up the original MTS file?

    I've got an M2TS file here that is AVC (ie H264). Conceivably, your MTS file is also AVC, as indicated by your "no-recoding" comment (all AVIDemux was doing was changing the container, not the actual video codec). Hence, it could be that VDub just can't handle the "MTS" part of it/container.

    You can analyse the guts of a file using Mediainfo. It will tell you what the underlying codec is. Afte you open the file in Mediainfo, go to the "Tree" view.
    Quote Quote  
  4. Originally Posted by Alwyn View Post
    That source file you posted is already an MP4 (AVC/H264 codec). Can you post up the original MTS file?
    My bad here is .MTS file straight from camera. https://www.upload.ee/files/15288487/mts.zip.html

    Originally Posted by Sharc View Post
    VirtualDub2 shows corrupted frames until it hits the next keyframe (a matter of the decoder).
    From what i understand decoder MP4 in VirtualDub2 is located in file called avlib-1.vdplugin, perhaps i can try alternative decoder, what are the ones available to allow importing MP4 files?

    I have used FFMpeg Input Plugin 2.0 for original VirtualDub, but its sluggish pressing play button, are there others?
    Quote Quote  
  5. Originally Posted by VidNoob123 View Post
    From what i understand decoder MP4 in VirtualDub2 is located in file called avlib-1.vdplugin, perhaps i can try alternative decoder, what are the ones available to allow importing MP4 files?
    The problem with garbled frames for random seeking with VirtualDub2 is for .mts or .m2ts container mainly. For .mp4 I don't get any problems here, except perhaps for the first few frames. Maybe because my files files were using the mp4 option 'faststart'.
    Last edited by Sharc; 31st May 2023 at 03:14.
    Quote Quote  
  6. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    The underlying codec of the MTS is AVC (or H264). I changed the container to MP4 with AVIDemux (Copy, Copy, Muxer>MP4) and it plays more smoothly in VDub 2 than the MTS file with no grey frames scrubbing back and forth along the timeline.

    Unfortunately, AVIDemux doesn't have a batch function.
    Quote Quote  
  7. You can convert to .mp4 container like
    Code:
    ffmpeg.exe -i "%~1" -c:v copy -c:a copy "%~1_.mp4"
    Save this line as a .bat or .cmd text file, put it as an icon onto your desktop and drag and drop your .mts onto that icon.

    Or for batch processing:
    Code:
    @echo off
    :next
    if "%~1"=="" goto done
    ffmpeg.exe -i "%~1" -c:v copy -c:a copy "%~1_.mp4"
    shift
    goto next
    :done
    Drag and drop your many .mts onto that icon.
    Last edited by Sharc; 31st May 2023 at 04:16.
    Quote Quote  
  8. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Good one Sharc.

    Oops. There's a flash and then nothing. Where would the MP4 end up?
    Last edited by Alwyn; 31st May 2023 at 05:52. Reason: Changed the Oops.
    Quote Quote  
  9. Same folder as the source, unless you would specify the destination path explicitly.
    Add pause at the end of the script to see any error messages.
    If ffmpeg is not in the system path you may have to specify the full path to the ffmpeg.exe
    Quote Quote  
  10. Member
    Join Date
    May 2005
    Location
    Australia-PAL Land
    Search Comp PM
    Originally Posted by Sharc
    specify the full path to the ffmpeg.exe
    That worked. Thanks.
    Quote Quote  
  11. Originally Posted by Alwyn View Post
    The underlying codec of the MTS is AVC (or H264). I changed the container to MP4 with AVIDemux (Copy, Copy, Muxer>MP4) and it plays more smoothly in VDub 2 than the MTS file with no grey frames scrubbing back and forth along the timeline.

    Unfortunately, AVIDemux doesn't have a batch function.
    Actually it does two ways to batch, i already adopted the easier one for converting all my MTS to MP4 yesterday. Used windows .bat file
    Code:
    @echo off
    
    set "imageFolderPath=%~dp1"
    
    mkdir "%imageFolderPath%\MP4"
    
    for %%F in ("%imageFolderPath%*.mts") do "C:\Program Files\Avidemux 2.8 VC++ 64bits\avidemux_cli.exe" --video-codec "copy" --audio-codec "copy" --output-format "MP4" --load "%%F" --save "%%~pF\MP4\%%~nF.mp4" --quit
    My concern however was if its possible to use another MP4 plugin for VirtualDub to open MTS without bug.
    Quote Quote  
  12. Originally Posted by VidNoob123 View Post
    My concern however was if its possible to use another MP4 plugin for VirtualDub to open MTS without bug.
    An alternative method is the directshow input driver. So if you have a decoder such as lav filters installed it will use that

    There is a x64 version of the driver here
    http://www.virtualdub.org/beta/DShowInputDriver-0.93.zip

    Beware, sometimes directshow can be buggy . It's like a last resort
    Quote Quote  
  13. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by VidNoob123 View Post
    Video files out of my Sony camera with .mts extension (i believe is MKV format?) when loaded to VirtualDub2 have a lot of frames corrupted. If i convert them to mp4 container (no re-encoding) with AviDemux then they open just fine, not a single corrupted frame.

    What can be causing this? Inside original VirtualDub with VirtualdubFFMpegPlugin .mts files have no lag, but playback is sluggish.

    Video source file https://www.upload.ee/files/15281379/00017.zip.html
    I had the same problem with my mts.
    The error is only in the preview when you jump between keyframes, when converting it will be ok.
    Use Cache Input Driver (you're probably using ffmpeg Input Driver).
    No need to convert.
    Quote Quote  
  14. Originally Posted by rgr View Post
    I had the same problem with my mts.
    The error is only in the preview when you jump between keyframes, when converting it will be ok.
    Use Cache Input Driver (you're probably using ffmpeg Input Driver).
    Could you elaborate on that, i am not that good with this things, how i switch input diver in VirtualDub2?

    P.S. I had this corrupted frames show in the MP4 videos i exported from VDub as well.
    Quote Quote  
  15. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Link:

    Quote Quote  
  16. Originally Posted by rgr View Post
    Link:
    Did not have ffmpeg plugin installed for VirtualDub2 so it was corrupted on Caching input driver.

    Could you try my video in post #4 and see if you get corruption?
    Quote Quote  
  17. Member
    Join Date
    Aug 2018
    Location
    Wrocław
    Search PM
    Originally Posted by VidNoob123 View Post
    Originally Posted by rgr View Post
    Link:
    Did not have ffmpeg plugin installed for VirtualDub2 so it was corrupted on Caching input driver.

    Could you try my video in post #4 and see if you get corruption?
    I think I made a mistake With "Cache input driver" it is as you describe, with "ffmpeg input driver" everything is ok.
    But rendering to x264 even with "Cache input driver" is ok, frames are distorted only in preview.
    Quote Quote  



Similar Threads

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