Author Topic: Help with cropping an MP4 in Windows 7  (Read 308 times)

qsdnlj

  • Newbie
  • *
  • Posts: 2
Help with cropping an MP4 in Windows 7
« on: June 07, 2019, 02:34:57 AM »
I'm having trouble with using Avidemux 2.6.21 in Windows 7 to crop an MP4. It kind of works, but it generates three separate files, and the video file doesn't work very well, and it doesn't work at all without the other two.

I got the original MP4 from Youtube: by using a Youtube downloader site, I downloaded a 700 MB MP4, and it works fine. I started Avidemux, opened the file and used Video Filters (Ctrl+Alt+F) to set the crop values. I then set Video Output to "Mpeg4 AVC (x264)", clicked on "Configure" and set Encoding Mode to "Video Size (Two Pass)" with a Target Video Size of 200 MB. I then set the Output Format to "Video Only" because I don't need the audio and wanted to save space. Finally, I saved the file as an AVI and let the encoder run for nearly an hour until it was finished.

The results only partially work. I have three files: output.avi (199 MB), output.avi.stats (8.18 MB), and output.avi.stats.mbtree (54.1 MB). The main video file (output.avi) does not work at all in VLC media player: it doesn't give an error, it just opens a blank screen with a runtime of 00:00 that cannot be scrolled through, and eventually closes after about one minute. It does work in Smplayer, but it doesn't display the total run time, and there's no way to move the video to a specific point. And if output.avi is moved to a different folder than the other two files, or if the other two files are deleted, then even Smplayer is unable to run it. Finally, if I try to use Avidemux itself to open output.avi, it gives me errors ("Cannot find a demuxer for output.avi" and "Could not open the file") and fails.

I get the same results whether I save it as an MP4 (rather than an AVI), or try "Average Bitrate (Two Pass)" (rather than "Video Size (Two Pass)"). I'm not sure what I'm doing wrong.

Any help would be appreciated. Thanks!

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3186
Re: Help with cropping an MP4 in Windows 7
« Reply #1 on: June 07, 2019, 02:44:27 PM »
I'm having trouble with using Avidemux 2.6.21

This is an unsupported ancient, legacy version, please use at least the last release, better the latest nightly.

edit: if Windows 7 you run is 32 bits, please use the latest nightly from here. These builds are 32 bits MinGW builds similar to 2.6.x with 3.3.9 FFmpeg in the core and with most of the applicable improvements of the main development branch.

Quote
I then set the Output Format to "Video Only" because I don't need the audio and wanted to save space.

Mistake no. 1. "Video Only" is raw video stream, you need a stream stored in a suitable container.

Quote
Finally, I saved the file as an AVI

Slapping an extension onto a file doesn't change the file, it is still a raw video stream. Setting Output Format to "AVI" would have been a big mistake no. 2, however. Please don't mux H.264 video stream containing B-frames into AVI, AVI lacks features mandatory for H.264 with frame reordering (i.e. with B-frames), use either MP4 or MKV for H.264 video streams instead.

To exclude audio tracks, deselect them in "Audio" --> "Select Track".
« Last Edit: June 07, 2019, 03:04:55 PM by eumagga0x2a »

qsdnlj

  • Newbie
  • *
  • Posts: 2
Re: Help with cropping an MP4 in Windows 7
« Reply #2 on: June 07, 2019, 07:18:16 PM »
Thank you, that solved almost everything. It still generates three files, but now I can delete the two other files and just use the one video file.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 3186
Re: Help with cropping an MP4 in Windows 7
« Reply #3 on: June 07, 2019, 07:28:21 PM »
It still generates three files

The other two contain data needed for the second pass of encoding, they can be safely deleted once the encoding has been completed.