Skip to content
Snippets Groups Projects

MP4-Duration 2

MP4-Duration 2 (is a similar tool to MP3-Duration for MP3-files) is a Rust CLI ("Command Line Interface") application that collects the durations of some given MP4 files and shows them in a human readable format. It uses my own functionality without usage of mp4 crate.

Installation

The executable files for 32bit-versions are stored in i686-* and
64bit-versions are stored in x86_64-*

Download the fitting binary (32/64bit) for your Linux distribution.
Copy the binary to /usr/local/bin/ for local users or and not additionally
to /usr/bin/ for systemwide usage.
Do copy to one path only and not to both!

cp -fv -- mp4duration2 /usr/local/bin/
sudo cp -fv -- mp4duration2 /usr/bin/

Download the fitting Windows-exe for your Windows version (32/64bit)
and copy it to %PROGRAMFILES%.

COPY /B mp4duration2.exe %PROGRAMFILES%

Usage

mp4duration2 [-n] [-s] <filename(s)>

-n	numbering at line start
-s	show summary of whole duration of all given filename(s)

Test Outputs

mp4duration2

Usage: mp4duration2 [-n] [-s] <filename(s)>

---

mp4duration2 *Directors_Cut*.mp4

00:01:33:56     01_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_01_UYHHihhPI6g.mp4
00:00:37:56     02_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_02_V1fmPCYQpT4.mp4
00:00:37:45     03_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_03_Ryl1ZUE7-NI.mp4
00:01:11:44     04_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_04_Au2SK_OZVKQ.mp4
00:01:33:56     Q_U_B_E_Directors_Cut_01.mp4
00:00:37:56     Q_U_B_E_Directors_Cut_02.mp4
00:00:37:45     Q_U_B_E_Directors_Cut_03.mp4
00:01:11:44     Q_U_B_E_Directors_Cut_04.mp4

---

mp4duration2 -n *Directors_Cut*.mp4

1/8     00:01:33:56     01_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_01_UYHHihhPI6g.mp4
2/8     00:00:37:56     02_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_02_V1fmPCYQpT4.mp4
3/8     00:00:37:45     03_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_03_Ryl1ZUE7-NI.mp4
4/8     00:01:11:44     04_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_04_Au2SK_OZVKQ.mp4
5/8     00:01:33:56     Q_U_B_E_Directors_Cut_01.mp4
6/8     00:00:37:56     Q_U_B_E_Directors_Cut_02.mp4
7/8     00:00:37:45     Q_U_B_E_Directors_Cut_03.mp4
8/8     00:01:11:44     Q_U_B_E_Directors_Cut_04.mp4

---

mp4duration2 -s *Directors_Cut*.mp4

00:01:33:56     01_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_01_UYHHihhPI6g.mp4
00:00:37:56     02_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_02_V1fmPCYQpT4.mp4
00:00:37:45     03_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_03_Ryl1ZUE7-NI.mp4
00:01:11:44     04_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_04_Au2SK_OZVKQ.mp4
00:01:33:56     Q_U_B_E_Directors_Cut_01.mp4
00:00:37:56     Q_U_B_E_Directors_Cut_02.mp4
00:00:37:45     Q_U_B_E_Directors_Cut_03.mp4
00:01:11:44     Q_U_B_E_Directors_Cut_04.mp4
all     00:08:02:42

---

mp4duration2 -n -s *Directors_Cut*.mp4

1/8     00:01:33:56     01_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_01_UYHHihhPI6g.mp4
2/8     00:00:37:56     02_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_02_V1fmPCYQpT4.mp4
3/8     00:00:37:45     03_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_03_Ryl1ZUE7-NI.mp4
4/8     00:01:11:44     04_Abigoven_Vandrhall_Q.U.B.E._Directors_Cut_Q.U.B.E._Directors_Cut_04_Au2SK_OZVKQ.mp4
5/8     00:01:33:56     Q_U_B_E_Directors_Cut_01.mp4
6/8     00:00:37:56     Q_U_B_E_Directors_Cut_02.mp4
7/8     00:00:37:45     Q_U_B_E_Directors_Cut_03.mp4
8/8     00:01:11:44     Q_U_B_E_Directors_Cut_04.mp4
all     00:08:02:42

If you are interested in the video files then you can
watch them here on Peertube.


License

MIT License

Copyright (c) 2025 Abigoven

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.