Comments (11)
Thanks for your feedback :)
regarding the first point: the empty gap at the end of the video is/was originally intended as i mostly used it for stuff that has some credits and an opener at the end/beginning of a video, so i decided to "cut" away a few percent of the video (4 minutes or 10.10% to be exact) see: https://github.com/mutschler/mt/blob/master/mt.go#L100-L105
Actually you can override this behavior since 1.0.2
by using the --to
trigger with an timestamp. For example if your video is 2 mins 15 seconds you could use --to=00:02:15
. But i get that in most use cases that's not really an option, so adding a new trigger to fix this (like --no-credits
) isn't a big deal! Gonna put that on top of my ToDo list. Not really sure about the name, if you have something more clear in mind tell me ;)
about the second one:
if i get you correctly you'd like some sort of --interval
trigger, which lets you specify that each interval a new screenshot should be made till we reach the end of the video?
that would be a little bit more complicated, as i'd have to make sure that both triggers (--numcaps
as well as --interval
) work together or i have to decide which one overrides the other. In my current idea interval
dos what you have to do manually atm: videoDuration / interval
rounded down to the next whole number and set that as numcaps
if you meant that, that's also not a problem ;)
Except that I'll have to catch and "round" again if one likes to "hold" the grid.
Example:
lets say you call mt with -n 16 -c 4
that's fine but if you'll do --interval 4 -c 4
which will translate (for demo purposes) to -n 15 -c 4
you'll get 1 image in the last row standing there somewhat "alone". i don't know if you'd want to "hold the grid" with the interval option or if you don't care at all... personally i would say if you are after "he... gimme a screenshot every 4 seconds till the video is over" you are more after the "4 seconds" then a nice looking grid?
from mt.
a little example on the first point i've talked about:
test video with 1 minute 11 seconds produces the following output:
mt -n 16 VIDEO
INFO[0000] generating screenshot 01/16 at 00:00:03
INFO[0000] generating screenshot 02/16 at 00:00:07
INFO[0000] generating screenshot 03/16 at 00:00:11
INFO[0000] generating screenshot 04/16 at 00:00:15
INFO[0000] generating screenshot 05/16 at 00:00:19
INFO[0000] generating screenshot 06/16 at 00:00:23
INFO[0000] generating screenshot 07/16 at 00:00:27
INFO[0000] generating screenshot 08/16 at 00:00:31
INFO[0000] generating screenshot 09/16 at 00:00:35
INFO[0000] generating screenshot 10/16 at 00:00:39
INFO[0000] generating screenshot 11/16 at 00:00:43
INFO[0000] generating screenshot 12/16 at 00:00:47
INFO[0000] generating screenshot 13/16 at 00:00:50
INFO[0000] generating screenshot 14/16 at 00:00:54
INFO[0000] generating screenshot 15/16 at 00:00:58
INFO[0000] generating screenshot 16/16 at 00:01:02
mt -n 16 --to="00:01:11" VIDEO
INFO[0000] generating screenshot 01/16 at 00:00:04
INFO[0000] generating screenshot 02/16 at 00:00:08
INFO[0000] generating screenshot 03/16 at 00:00:13
INFO[0000] generating screenshot 04/16 at 00:00:17
INFO[0000] generating screenshot 05/16 at 00:00:22
INFO[0000] generating screenshot 06/16 at 00:00:26
INFO[0000] generating screenshot 07/16 at 00:00:31
INFO[0000] generating screenshot 08/16 at 00:00:35
INFO[0000] generating screenshot 09/16 at 00:00:39
INFO[0000] generating screenshot 10/16 at 00:00:44
INFO[0000] generating screenshot 11/16 at 00:00:48
INFO[0000] generating screenshot 12/16 at 00:00:53
INFO[0000] generating screenshot 13/16 at 00:00:57
INFO[0000] generating screenshot 14/16 at 00:01:02
INFO[0000] generating screenshot 15/16 at 00:01:06
INFO[0000] generating screenshot 16/16 at 00:01:10
from mt.
Thanks, in answer to you questions, I think:-
-
I think most people would want the full length by default, so maybe make full length the default, and --credits an option for the existing behaviour instead? If you don't agree then --full seems a good trigger.
-
--interval seems like a good name if you want to add this option, which would be very useful. Both triggers shouldn't be used together. Interval should probably override numcaps since it's an unknown number of screengrabs, and would override the existing default behaviour. So, --interval 3 (for example) would take screengrabs every 3 seconds while < duration. Not bothered at all about the finished grid size. I would perhaps suggest a Default number of columns that is based on the Square Root (rounded to the nearest integer) of the number of images though (if the number of columns is not specified). Only a single line of code, but that should always produce a square-ish grid which seems logical to me.
Either way, if you used floating point or milliseconds then that would be useful, but as long as screengrabs exist evenly to the full length of the video duration then that is the most important requirement for us.
Thanks again for considering these modifications.
from mt.
@richardbushell ok, i think im going this way: i'm adding an --skip-credits
option which defaults to false... so basically i'm going to change the default behavior of mt there... we well see how that works out ;)
Interval should be good to go, just did some quick tests yesterday and the only thing that i still have to catch is overriding IF interval
and numcaps
are given the same time. i Might have to use a global variable to handle this... so long story short: both options will be included in the next version :)
from mt.
Sounds perfect, thank you. Just drop a reply here when it's available and I'll give it a try!
from mt.
@richardbushell i've just pushed out a new version, releases should appear any minute on the releases tab. Happy testing ;)
EDIT: there you go, binaries published as well
from mt.
@mutschler thanks, I've had a chance to test. Well done, yes both methods now work as expected.
There is just one issue, which may be a timing or rounding error. My video is 2.15.240 length (6 frames, or 240 ms longer than 2 mins 15 seconds). Both interval and numcaps methods said they took a screengrab at 2.15, but both of these contained just a Black Screen. The video ends with a white frame containing text, there is no black frame at all, so it must have taken this frame after the video duration, or otherwise failed and resulted in this final black frame being generated incorrectly. This is likely a timing or rounding issue. Did you want to drop me an email with your own email address and I'll send you the video file if you wish for cross-referencing. My email address is [email protected]
from mt.
Glad to hear that it's working as you expected it to... about the black frame at the end you might be right, I'd say it's a rounding error too. I'll check that again also I've send you an email if you'd send me the video file maybe with the created image and used settings as well that would be nice. That way I can make sure we are seeing the exact same behaviour while testing it
from mt.
Thanks for the Mail.
I think i have something to fix it, since i don't know if you are building from source i've send you an mail with Links to the Binaries containing that fix. if you build from source just pull in the latest changes and it should work :)
from mt.
@richardbushell any news on this?
from mt.
Sorry, got busy on something else. Yes, it now works fine. Thanks for the addition interval and skip-credits options, they are very useful for our generic requirements. Thank you.
from mt.
Related Issues (20)
- Add a license HOT 1
- panic: runtime error: integer divide by zero (mt.go:129) HOT 2
- Clean up redundant calls to os.Exit following log.Fatalf
- Using as a library HOT 10
- Not accurate screenshots when using --interval HOT 3
- How do I create a static binary? HOT 4
- Padding between images HOT 3
- setting from and to ignored when numcaps is 1 HOT 5
- font argument not correctly used HOT 2
- Version 1.10 reports 1.09 HOT 1
- undefined: nude.IsImageNude HOT 2
- Add info about audio-track HOT 3
- Migrate from dep to go modules
- Unable to build, screengen issue? HOT 4
- unknown flag: --filename HOT 2
- 100% CPU Usage HOT 1
- can't seek to timestamp... HOT 1
- Not able to build a windows binary HOT 2
- Start at 00:00:00 is ignored HOT 2
- building fails currently HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mt.