VideoHelp Forum
+ Reply to Thread
Results 1 to 8 of 8
Thread
  1. Member
    Join Date
    Sep 2021
    Location
    Valencia
    Search Comp PM
    Hello:
    I have quite a number of MP4 format videos, the quality of the videos is not always good, but I can watch them in VLC player. I found that I can use VLC player to fix some bad videos when I play it, therefore, most of the time, the quality of the videos is OK.
    But since I have a lot of those MP4 videos, I want to know if I can run some DOS command just like watching the videos and always fix the errors in the videos.
    Or, if you know other tools to repair videos in Windows 10, and I can use command line to fix them. Please let me know, and give me some general instructions.
    Thanks,
    Quote Quote  
  2. In what way are you fixing the video? Are you talking about fixing bad colors, brightness, contrast? Or about corrupt files that don't play properly in some players?
    Quote Quote  
  3. Member
    Join Date
    Sep 2021
    Location
    Valencia
    Search Comp PM
    Hi,
    I give you one small file to look.
    Image Attached Files
    Quote Quote  
  4. When I play that video with VLC I get many pauses in the audio and/or video, occasional corruption of the picture, and the brightness pumps lighter and darker at the start. Which of the problems are you fixing? What are you doing in VLC that "fixes" them? Are you re-muxing? Applying some filters? Re-encoding?
    Quote Quote  
  5. Member
    Join Date
    Sep 2021
    Location
    Valencia
    Search Comp PM
    Hello:
    Basically, I followed the instructions from here: https://www.nucleustechnologies.com/blog/free-methods-to-repair-corrupt-mp4-video-files/
    I can use VLC player to see the video in a smoother way.
    But I want to fix most of the issues you have seen and save as a new MP4 file.
    I need some kind of DOS command, so I can run the command to repair MP4 files, as all the MP4 files have similar issues.
    I don't bother the audio, but for occasional corruption of the pictures, do you have any suggestion on how to repair the corruptions?
    Thanks,
    Quote Quote  
  6. That site recommends two things: just playing the mp4 video with VLC (VLC may handle damaged files better than some other players), or renaming the .mp4 file .avi and using VLC's automatic reindexing function. Renaming your file to .avi here makes no difference in how VLC handles it. There's no indication the timecodes are being rebuilt and playback is exactly the same. This makes sense since VLC doesn't determine the file type by the extension but rather by the contents (avi headers are very different than mp4 headers). So there's no reason it should treat a renamed file any differently the the original The video (mp4 or avi) plays for 6 minutes. Comparing the game clock to real time you can see that it's playing at the correct speed overall.

    A remux (of the original mp4 or the renamed avi) using VLC results in a video that doesn't have all the pauses. But the running time is reduced from 6 minutes to about 4.25 minutes. All the pauses are gone but if you compare the game clock to real time you see it jump where the pauses used to be. VLC command line to remux:

    Code:
    "g:\program files\videolan\vlc\vlc" input.mp4 --sout="#std{access=file,mux=mp4,dst='vlc_remux.mp4'}" vlc://quit
    Remuxing with ffmpeg results in a 6 minute video that's essentially the same as playing the original mp4 in VLC.

    Code:
    "g:\program files\ffmpeg64\bin\ffmpeg" -fflags +genpts -i "input.mp4" -vcodec copy -acodec copy  -movflags faststart "ffmpeg_remux.mp4"
    The pauses are on a slightly different frame (the original pauses on the last frame before the pause, the ffmpeg remux pauses on the first frame after the pause) but otherwise the video is the same as the original.
    Quote Quote  
  7. Member
    Join Date
    Sep 2021
    Location
    Valencia
    Search Comp PM
    Hello:
    Thanks for your reply, I tried to use ffmpeg command to repair the video, but the result is almost the same.

    I am thinking about another way: from the same web site, where I downloaded the video, it has different resolution for the same game. The one I uploaded in the question is 1280px By 720px. But there are other resolutions, like: 420px By 270px, I downloaded one of such small resolution, the quality of the small resolution seems to be rather good.

    So, what I want to do is like this: if I can use some software, which can create higher resolution images from the small resolution images, like: make an image of 1280X720 from an image of 420X270, then I can use the software to replace some of the pauses with make-up images, in this way, the result video could have a better quality (like without pauses, the pauses are the most important factor I am concerning). I showed here one small resolution video and one big resolution video for the same game, not for soccer game, however, this time, the both videos have good quality. But hope you understand my meaning.
    What do you think?
    Image Attached Files
    Quote Quote  
  8. The problem you're having isn't in the playback. The frozen frames are actually encoded that way. The missing frames do not appear in the file. No program is going to be able to restore them. I used ffprobe to dump stats of all the frames:

    Image
    [Attachment 62061 - Click to enlarge]


    At the far left is the frame number. Column F is the time at which the frame is to be displayed (in seconds). Column G is duration of the frame (in seconds). Note that frames 122 to 126 are all displayed for 0.033 or 0.034 seconds -- that's normal for a 30p video. But frame frame 128 is displayed for 4.8 seconds -- that's normally the time of 144 frames. That indicates 143 frames are missing between frame 128 and 129. When you watch the video you see that 4.8 second pause. So there's nothing wrong with the playback, that pause is exactly what's specified in the mp4 file. The frames were lost before that mp4 file was created. You can't fix it, there's no data in the file to restore those missing frames.

    Your idea of using a low res version of the video to replace the frames missing in the high res version is possible but it's probably a lot more work than it's worth. The two videos you supplied are identical aside from the different starting frame and frame size.
    Quote Quote  



Similar Threads

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