mkarhumaa / gifmaker

Software for converting video segments to animated GIF.
2 stars 0 forks source link

Implement video to GIF animation converter tool #17

Closed mkarhumaa closed 10 years ago

mkarhumaa commented 10 years ago

input: Video file output: GIF animation

mkarhumaa commented 10 years ago

9d8189184b705d9434673ab5e5e30c14904bf0e2

Now the application is able to capture frames from video by hard coded parameters. Need to add parameters.

mkarhumaa commented 10 years ago

For converting time interval to milliseconds: http://stackoverflow.com/q/5351483

mkarhumaa commented 10 years ago

Runnable jar file: https://www.dropbox.com/s/i6jgfzo93fszdl8/converter.jar

you can test it for example by following command: $ java -jar converter.jar inputvideo.mp4 inputsrt.srt 1 2 4-10

Requires Java 1.7.

mkarhumaa commented 10 years ago

Need to add instructions for command line arguments.

mkarhumaa commented 10 years ago

Added instructions and config file.

mkarhumaa commented 10 years ago

Latest build: https://www.dropbox.com/s/i6jgfzo93fszdl8/converter.jar

mkarhumaa commented 10 years ago

https://www.dropbox.com/sh/j5x2hrrti6x6hbg/uiOpWNaDFZ In shared dropbox folder some example outputs of converter. Now converter creates a directory structure specified earlier today.

Dropbox folder includes also latest build.

olihub commented 10 years ago

Bug found! Negative resize_factor causes infinite loop within the program.

"converter.resize_factor=-1" in converter.config file "java -jar converter.jar input.mp4 input.srt 1-3" - CMD

mkarhumaa commented 10 years ago

Oh wow! :D

I'll fix this asap.

2013/11/26 olihub notifications@github.com

Bug found! Negative resize_factor causes infinite loop within the program.

"converter.resize_factor=-1" in converter.config file "java -jar converter.jar input.mp4 input.srt 1-3" - CMD

— Reply to this email directly or view it on GitHubhttps://github.com/mkarhumaa/gifmaker/issues/17#issuecomment-29275222 .

olihub commented 10 years ago

Another cool bug :) "..input.mp4 input.srt 3-1" crashes the program.

Maybe we need a check for invalid parameters? (wrong order in this case)

olihub commented 10 years ago

No bugs this time but is there some easy way to change the speed of the output? Dropping fps down to 1 gave us reasonable file size (1 MB). However, it takes quite long to browse through the images at normal video speed.

mkarhumaa commented 10 years ago

Hmm.. The speed of the animation could be configurable too. It should not be very big deal to implement.

Now it (should) automatically adjusts the speed so that the length of the output animation is same than length of input video. Length does not depend on framerate because some of the frames are skipped when using lower framerate. 27.11.2013 17.51 "olihub" notifications@github.com kirjoitti:

No bugs this time but is there some easy way to change the speed of the output? Dropping fps down to 1 gave us reasonable file size (1 MB). However, it takes quite long to browse through the images at normal video speed.

— Reply to this email directly or view it on GitHubhttps://github.com/mkarhumaa/gifmaker/issues/17#issuecomment-29394809 .

HenriH89 commented 10 years ago

The wrong order of the segment numbers-issue is now fixed and updated to the code. Now it just ignores the faulty parameter.

mkarhumaa commented 10 years ago

Speed can now be configured from the config file.

mkarhumaa commented 10 years ago

I added also the script execution feature to the converter. I dunno if it is really needed, it can be easily removed if needed.

mkarhumaa commented 10 years ago

Latest build can be found in dropbox.

olihub commented 10 years ago

"java -jar converter.jar THE_WIRE.mp4 THE_WIRE.srt 3-5 21-22 10 3-107 285-290 429-431 506-527" Unintentional space in parameters crashed the converter.

mkarhumaa commented 10 years ago

To Henri:

Exception in thread "main" java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.eclipse.jdt.internal.jarinjarloader.JarRsrcLoader.main(JarRsrcLoader.java:58) Caused by: java.lang.IndexOutOfBoundsException: Index: 4, Size: 4 at java.util.ArrayList.rangeCheck(ArrayList.java:604) at java.util.ArrayList.get(ArrayList.java:382) at com.gifmakers.Converter.parseSRT(Converter.java:431) at com.gifmakers.Converter.main(Converter.java:156) ... 5 more

HenriH89 commented 10 years ago

Alright. I'll fix that.

HenriH89 commented 10 years ago

I made some big changes to the SRT parser. It should now work without problems. The problem was that it didn't work when the same segment number occured more than once in the parameters.