Firstly, let me say this is actually a request for a script, so if I'm posting in the wrong place, please just let me know and I'll request the close of this and go there instead - I have just found askubuntu to be the most helpful and least patronising of the forums I visit, so wanted to try here first.
I'm running Ubuntu LTS 16.04 Destop, if that matters.
What I am requesting is a bash file (it doesn't have to be bash, I'm just more likely to understand how it works so I can learn from the experience if it is) which will go through a single specific directory full of media files (specifically movies; mp4
, mkv
, avi
, mpg
are the only extensions) and produce a log file called "0.log"
(so it's easier to find at the top of the list) and provide the following information in a easy to read format:
- Filename
- Extension
- Length of Movie
- Dimensions of Movie (width x height)
- Is there an error with the file
- if it's possible, what the error is
I can gather all this information using the ffmpeg function, but I can only do it one at a time, manually putting the information into a spreadsheet, which as I'm sure you can understand, is taking an infinite* amount of time.
*not strictly true
when typing:
ffmpeg -i filename.ext
The information needed appear under the list of libs used, as an example, an output could read:
.......
other stuff that i don't need
.......
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
[aac @ 0x142fc20] element type mismatch 3 != 0
Input #0, matroska,webm, from '13 (2010).mkv':
Metadata:
encoder : libebml v1.2.0 + libmatroska v1.1.0
creation_time : 2011-07-29 21:37:53
Duration: 01:37:12.19, start: 0.000000, bitrate: 1999 kb/s
Stream #0:0: Video: h264 (High), yuv420p, 1280x536 [SAR 1:1 DAR 160:67], 24 fps, 24 tbr, 1k tbn, 48 tbc (default)
Stream #0:1: Audio: aac (HE-AAC), 48000 Hz, 5.1, fltp (default)
Stream #0:2: Subtitle: subrip (default)
That first line after the list of libs is the example of a possible error with the file, it is omitted when the file checks out *there is no "this file is okay" replacement, it's just not there. There are a number of errors that can occur, so I'm guessing you just have to check between the final lib (in this case libpostproc; and Input #0; to see if anything is there or not.
You can see the Duration (in this case 01:37:12.19), and the Dimensions (in this case 1280x536).
Can anyone either do this for me, or point me towards existing software that can do it. Eventually the output will be placed into a spreadsheet, but I can handle formatting and stuff easily enough myself, I really just need raw data to work from. Or show me how to do it myself. I suffer from mild brain damage which has killed my short term memory, so i'm struggling to use online tutorials to try to work through it.
Thanking you in advanced,
Danny
0 Answers