Prompted by a couple reports, here's a new bugfix release of VCS. It most importantly fixes an incompatibility with Bash 5.0 which made the script put all the captures in a single row.
A couple minor bugs are also fixed, where using mawk would produce some errors and print the wrong file sizes, and the evasion offsets (which are used to avoid blank screengrabs) weren't really being used.
See the full changelog for more details.
- vcs 1.13.4
- vcs-1.13.4.gz (script only)
or
vcs-1.13.4.tar.gz (script, sample configuration, manpage and profiles) - deb, rpm, PKGBUILD & xz
- as usual at p.outlyer.net/vcs
Discover more from OutlyerNet
Subscribe to get the latest posts to your email.
I appreciate it, Thank you so much!!
I was looking for a similar tool for some time.
I had to modify it a bit according to my needs.
It was easy with almost zero BASH knowledge as the script is very well-organized.
Thank you, tip granted!
Thank you! I did my best to keep it organized and documented since it's a fairly complex and big script, I'm glad that was useful for someone else. If you think your modifications can be of use to others I'm always open to suggestions and patches.
Hello Toni,
sorry i just saw your reply now. 🙁
I modified script behavior if output file exists.
I use another bash script to invoke VCS for every video file on a folder recursively and for me it was handy to add an option to keep already existing output to reduce overall runtime.
I send you the modified script via e-mail and you can decide if it is useful or not.
Also i failed to find out where to add jpeg quality settings to reduce jpeg output sheet size. I think this feature would be useful as well.
Thank you again for this great – and free – tool! 🙂
Thank your for your suggestion and submission.
As for JPEG quality, while there's no specific command-line option to set it, it can be set through command-line overrides or configuration files (see https://p.outlyer.net/vcs/docs/conf_files)
To set it from the command-line use, e.g.:
$ vcs -O quality=85 …
Wow, i did not notice this feature. Thank you for quick response! :bow:
Excellent! 🙂
I am happy again, that I now can continue using the -S option, and that the Footer has finally returned.
However, some new thing seems to have entered the realm of vcs: -T pc3
I replaced the line "if [[ 8 = "$(tput -T pc3 colors)" ]]; then" with the line "if [[ 8 = "$(tput colors)" ]]; then" and colors returned. Before the change I always got the error: "tput: unknown terminal "pc3""
The system I run the vcs script on is old, very old, so it has no knowledge of updated Terminal versions, if that might be the case.
The code though, seems to me that you only need to compare the number 8 with how many colors the Terminal actually supports, and in my case that's 8. What the -T option has got to do with anything, I am not sure. Something more modern perhaps? Or has it something to do with your system? Personally I could live without the colors. They are not necessary for the functionality of the application.
Anyway, great work! 🙂
Thank you for your input. Getting tput to produce consistent output across different OSes is harder than I'd like and it involved some hair pulling when dealing with BSDs, so that may be the source of the pc3 type, I honestly can't remember right now.
Nonetheless, I'm taking note of this for further testing.
Best Regards.
I used vcs-1.13.2 for a long time, but after my system upgrade the media info on the upper right side shifted out from the contact-sheet.
I upgraded to vcs-1.13.4 but it would not run as a script starting from my filebrowser (this is handy to right-click a file, start vcs and get an easy contactsheet for the file)
As I found out the problem is the tput detection:
"stty: 'standard input': Inappropriate ioctl for device"
"tput: No value for $TERM and no -T specified"
I went back to the old detection, pasted/replaced it into the new script and now it is working again:
I thought I let you know. Perhaps you can improve your new detection to run without exiting if no Terminal is found.
It definitely can be improved. As I replied above I ended up with some solution that seemed to work across systems at the time but it wasn't that solid, obviously.
Thank you for your feedback, I'm taking note to refine it further.
It seems the version 1.13.4 jumps over the function that was there in earlier versions (if memory serves me), the function that corrected timing for "decimal seconds". If a thumbnail landed on, say 05:24.100, the script corrected that to 05:25.00. But now it is left as an exercise to the reader to figure out what that 05:24.100 means. 🙂
Not a big problem, it just looks a little weird with three digits instead of the "normal" two. I put that in quotes since nothing in 2020 so far has been "normal".
Live well and prosper, and breathe carefully when you're out there. 😉
I'm not sure what you mean, I can't remember having such correction, timestamps are explicitly printed with two decimals. I'm getting two decimals on my system, maybe it is some weird interaction with a newer version of some package?
There was no rounding either as you seem to imply, the closest I can think of is when using MPlayer as capturer seeking doesn't have such precision. You can force using MPlayer with the -M switch if you prefer that behaviour.
output file is in 64b bit depth. how can I set it to lower bit such as 24?
I've haven't encountered such problem yet, and it sounds fairly weird.
You may try editing the script and adding
-depth 8
to the final bigconvert
command (on line 4135 in version 1.13.4) and see if that does the trick.Would it be possible to somehow specify to only screenshot half of the video image (for 180 side-by-side VR videos)?
Or would this require new features to be added to the VCS?
Not at this moment, yes it would need changes. I'm taking note since it might be useful, thank you for asking.
Hi,
I was getting:
Detected video length can't be reached. Safe measuring enabled.
On a video with a length that was not an integer (it has N.51 seconds).
The script did look at other length and produced a screensheet but I figured that a fractional second is probably not that useful so getting rid of it would get rid of the warning.
So I slightly modified your script to get rid of it and it worked.
I got some captured image off by a couple millisecond between the original version and the no fractional second version when there are only a few captured images, as is to be expected, but for me it worked well.
In case you are interested, the diff for it is:
Reaching the end shouldn't be affected by fractional seconds, so this may hint at other problems. I'm taking note of this, thank you for your contribution!
I'm having a problem with 1.13.4. I'm using ffmpeg 4.3.2 (release just before most current one). VCS is putting the bitrate in place of the width in the dimension field.
https://imgur.com/rdvfl8i
I guess they've changed the format of the output. Thank you, I'll look into it as soon as I have some spare time.
I can't reproduce, my version of ffmpeg 4.3.2 (and also 4.4) generates a proper header.
Can you copy the output of running
vcs -DD
?(Output from a different video but has the same problem)
Thank you, I'll see if I can I figure out what's the issue and let you know either way
Hey,
I'm using VCS via Homebrew Install (https://formulae.brew.sh/formula/vcs#default) and since the last update of imagemagick (?) I get dozens of error messages:
convert: Expected operator at '.mean*100' @ error/fx.c/GetOperator/2408
Can someone help please?
Sorry for the delay in aproving the message, I missed it. I can confirm the latest version of ImageMagick produces such warnings, I'll look into it.
Based on what I can see the error disables "blank frame evasion" but shouldn't have any other side effect.
In the mean time until I publish an update the trunk version should be working properly: https://svn.outlyer.net/svn/pub/video-contact-sheet/trunk/dist/vcs
With the new script I'm getting issues the following error:
No compatible version of getopt in path, can't continue.
Enhanced getopt (i.e. GNU getopt) is required
That's weird, I can't think of any recent change that would trigger that. Did it work in previous versions on the same system?
I observe the same issue as KW with the trunk version you linked above.
The issue is on line 186. Brew version has this:
"`
declare GETOPT=/usr/local/opt/gnu-getopt/bin/getopt
"`
The trunk version has:
"`
declare GETOPT=getopt
"`
When I backport the most important change you did in the trunk version (`fx:image.mean` > `fx:mean`) then indeed the error messages on .mean*100 are gone.
The homebrew's version of vcs has this at line 186:
declare GETOPT=/opt/homebrew/opt/gnu-getopt/bin/getopt
While Toni's just uses whatever is on path:
declare GETOPT=getopt
… which on macOS is non-gnu version of getopt.
Hi, I developed a small gui for the VCS script.
You can find it here:
https://github.com/tudo75/vcs-creator
Recently got an update of ImageMagick:
"""
$ magick –version
Version: ImageMagick 7.1.1-33 Q16-HDRI x86_64 22263 https://imagemagick.org
Copyright: (C) 1999 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenCL OpenMP(4.5)
Delegates (built-in): bzlib cairo djvu fftw fontconfig freetype heic jbig jng jp2 jpeg jxl lcms lqr ltdl lzma openexr pangocairo png raqm raw rsvg tiff webp wmf x xml zip zlib zstd
Compiler: gcc (14.1)
"""
Because of that, the "convert" command now gives a deprecation warning:
"""
WARNING: The convert command is deprecated in IMv7, use "magick"
"""
Trying to do that, replacing all the calls to 'convert' for 'magick', the temp images seem to be problematic (I've added a few printouts of the suspected code blocks):
"""
[i] Capturing in range [04:49.49-19:17.95]. Total length: 20:25.35
[i] Generating capture #1/4 (04:49.49)…
magick: no images found for operation `-geometry' at CLI arg 7 @ error/operation.c/CLIOption/5479.
magick: magick -background 'transparent' -fill 'transparent' '/dev/shm/vcs.SGteWR/vcs-ZQ0dJj-cap-000001.png' \( -geometry 267×200! \) -flatten \( -box '#000000aa' -fill 'White' -stroke none -pointsize '9' -gravity 'SouthEast' -font '/usr/share/fonts/TTF/DejaVuSans.ttf' -strokewidth 3 -annotate +5+5 ' 04:49.49 ' \) -flatten -gravity None -flatten \( -background black +clone -shadow 50×2+4+4 -background none \) +swap -flatten -trim +repage -flatten '/dev/shm/vcs.SGteWR/vcs-zQhKDd.png'
"""
If I try to cp those two temp images on the line below the 'magick' command, they become 0 byte files.
The video renderer ffmpeg has also gone through a couple of steps of upgrades over the years, I now have:
"""
$ ffmpeg -version
ffmpeg version n6.1.1 Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 13.2.1 (GCC) 20230801
"""
So commands like '-vframes' is now '-frames:v' and so on. No errors, just friendly suggestions in the man page. I replaced those also, but still the same problem.
I should have listened more carefully when our kindergarten teacher went through Bash. 😉 IOW, I'm sure it's something simple I am not understanding.
N.b. I can still use vcs with the normal 'convert' command, but depending on how "militia force" serious the ImageMagick gang is going to be about deprecation warnings and removal of old code, it might stop working at some point in the future and I think that would be sad.
Any ideas? Thanks! 🙂
I'm still using an older ImageMagick on my system but I've recently learnt about
magick
becoming the one command, yes. And I've seen a couple examples of it using a slightly different format for its arguments, likely the source of your problems, but I'm yet to look into it.I wouldn't worry about
convert
and the other separate IM tools disappearing overnight, but an update is in order to get rid of the warning.As for FFmpeg, I've been using the modern syntax you mention when using it to convert videos for quite a while now, and I can't tell if the older argument style will be removed anytime soon, but I'd prefer to delay any changes as much ad possible since I remember some inconsistency with ffmpeg's version numbering in the past for its versions in the wild, and I'd rather not try to guess what syntax to use.
Thank you for your input, hopefully the next small update won't take too long to be ready.
Thanks for the info. 🙂
Another thing that is a little bit annoying, but isn't a very big deal, is the fact that videos made from a phone where the image is rotated in metadata, doesn't produce a correct aspect ratio. For example, a video that is stored as 1920×1080 (16:9), but shown as 1080×1920 (9:16), due to metadata rotation, vcs will create thumbnails in 1920×1080 aspect ratio (16:9) but show them rotated correctly, which means the image at 9:16 gets squashed to fit into 16:9. Like I said, not a very huge deal, but it looks somewhat silly and it would be great if it was possible to fix.
I've tried to see if I could set the aspect parameter but it doesn't seem to do much when the rotation is made in metadata. Metadata usually state something like:
"`bash
Side data:
displaymatrix: rotation of -90.00 degrees
"`
Good tip, I didn't think about this case, will have to look into these files and figure out how to handle metadata-only rotation
Initial support for ImageMagick 7 and rotated video is in the development version (rotation will be in the wrong direction in some cases for now, but should serve as a starting point to test the feature):
https://git.outlyer.net/outlyer/video-contact-sheet/raw/branch/master/dist/vcs
Hi, thanks for your tools! I'm wondering if vcs supports zero-padding mode(no padding between frames), as I see the sample picture bbb_excfgs_5x4_160px_config.jpg is. I want to use "-n 16 -c 4 -H 25%" args to make a 4×4 tile and make the output picture has the same width of video. Thank you!
Sure, the
--disable
argument can do that, you'll need to disable padding and shadows, so add-dp -ds
to remove all spacing between thumbnailsThank you for your quick and detail reply, and have a nice day 🙂
Thanks for the great utility! I have vcs installed via brew on MacOS Sonoma. This may not be something you can test, but maybe you can offer suggestions as to what might be the issue:
When I use vcs on local volumes, everything works as expected as far as the output image file permissions go. However, if I attempt to output a vcs contact sheet to a smb server volume, the file has no read or write permissions for user, group or other. Normal terminal commands like touch, mkdir, etc create files with proper permissions from the same terminal shell.
The other question I have is: Does vcs have to have an interactive terminal? When I try to use vcs within various automation apps that don't have a terminal environment, vcs gives the error of "no interactive shell". I can work around this by prefixing the vcs command with "TERM=dumb", but just wondered if that requirement should be necessary.
Thank you, John
Hi and thanks for your input.
For the first issue I have no idea what's wrong, although I don't use MacOS it seems obvious permissions should be inherited from the user session running vcs, though I haven't done much testing on SMB myself. I'll let you know if I figure out something.
As for the second question, don't worry, the error is a byproduct of trying to detect if it can print with colours and such, but an interactive shell is not a hard requirement and in fact setting an appropriate TERM value as you do is the usual workaround.
Best Regards!
Thanks for the prompt reply. I'll see if posing the question on StackExchange can suggest where my system may be tripping up irt file permissions.
Feel free to let me know if you find out something new about the issue.