gifsicle.exe on Windows 7 - Invalid argument error - visual-studio-2010

I'm trying to build a GIF image from several different GIF images using GIFSICLE.exe utility. Here is the link to the utility that I'm referring here: http://www.lcdf.org/gifsicle/
I've all the individual GIF frames saved in "Frames-GIFs" folder and the gifsicle.exe is also placed in the same folder. Here is the command line that I'm passing:
gifsicle --delay=10 --loop *.gif > test.gif
I following error:
gifsicle: *.gif: Invalid argument
Can someone please guide me to build a proper Command Line for gifsicle and make animated GIF using a series of GIF image files?
*P.S.: This is an attempt to make a Screen Recorder in Visual Basic that records screen activity in animated GIF image format. I've completed code that takes screenshots of predefined area at a preset frequency (delay parameter for gifsicle). If you can suggest any better alternative, your suggestions are welcome. :-)

Related

FFmpeg image sequence to video with variable image durations

I have been looking for a way to convert a sequence of PNGs to a video. There are ways to do that using the CONCAT function within FFmpeg and using a script.
The problem is that I want to show certain images longer than others. And I need it to be accurate. I can set a duration (in seconds) in the script file. But I need it to be frame-accurate. So far I have not been successful.
This is what I want to make:
Quicktime video with transparancy (Prores4444 or other codec that supports transparancy + alpha channel)
25fps
This is what I have: [ TimecodeIn - TimecodeOut in destination video ]
img001.png [0:00:05:10 - 0:00:07:24]
img002.png [0:00:09:02 - 0:00:12:11]
img003.png [0:00:15:00 - 0:00:17:20]
...
img120.png [0:17:03:11 - 0:17:07:01]
Of course this is not the format of the script file. Just an idea about what kind of data I am dealing with. The PNG-imagefiles are subtitles I generate elsewhere in my application. I would like to be able to export the subtitles as a transparent movie that I can easily import in my video editing software.
I also have been thinking of using blank transparent images I will use as spacers, between the actual subtitle images.
After looking around I think this might help:
On the FFMPEG site they explain about making a timed slideshow
In the Concat demuxer section they talk about making a slideshow, based on a text file, with references to the image files and the duration of the image.
So, I create all the PNG images I need. These images have the subtitle text. Each image holds one subtitle page.
For the moments I want to hide the subtitle, I use a blank PNG.
I generate a text file as explained on the FFMPEG website.
This text file will reference to all the PNGs. For the duration I just calculate the outcue - incue. Easy... I think...

Converting multiple Postscript images into an animated gif

I have several postscript images of the form "filename_0001.ps", "filename_0002.ps", etc. I would like to create an animated gif with each of the files as a frame in the animation, but I do not know how I would go about doing that. I have over 500 files that I would like to include in a single gif and would like to avoid creating the animated gif by hand.
I googled around for a bit and found this. At the very bottom it seems to suggest that there is a one line command that can be used to make the gif, but I haven't been able to figure out how to use it in my case.
Any suggestions would be appreciated.
I've used ghostscript and ImageMagick's convert to do this. I used these commands
gs -sDEVICE=png48 -g500x500 -o bezan%03d.png bezanim.ps
convert bezan*.png bezan.gif
to produce this animation for this Codegolf.Stackexchange challenge, where the frames were separate pages of a single postscript program.
You can probably do it with the single command
convert filename_*.ps anim.gif
and convert will shell-out to ghostscript as needed. But for my case, I wanted to specify the arguments to ghostscript directly.

Generate all the files (.vtt + sprite) for the Tooltip Thumbnails options of Jwplayer

What is the best way to generate the ".VTT" file and the jpg sprite attached with it for the Tooltip Thumbnails of Jwplayer (http://www.jwplayer.com/blog/building-tooltip-thumbnails-with-encodingcom/- ?
I know how to make an image sprite with php, but i dont know how to make the screenshots of each video with the time in second.. I think there must be a server tool to do all the tasks it but i cant find it.
Thanks
I wrote a script to do this task. Given a video file (MP4 or M4v), generate thumbnail images, compress into a sprite, and generate a VTT file compatible with JWPlayer tooltip thumbnails. All of the image manipulation uses tools from ffmpeg, ImageMagick, and optionally sips and optipng. The WebVTT generation part, I had to write.
You will have to install ffmpeg & imagemagick, at a minimum to use this.
Github code is here: https://github.com/vlanard/videoscripts (under sprites/).
The basic gist is:
Create a bunch of thumbnails, e.g. every 45th second from a video
ffmpeg -i ../archive/myvideofile.mp4 -f image2 -bt 20M -vf fps=1/45 thumbs/myvideofile/tv%03d.png
Resize those thumbnails to be small, e.g. 100pixels wide
sips --resampleWidth 100 thumbs/myvideofile/tv001.png thumbs/myvideofile/tv002.png thumbs/myvideofile/tv003.png
OR if sips not available, use imageMagick utility:
mogrify -geometry 100x thumbs/myvideofile/tv001.png thumbs/myvideofile/tv002.png thumbs/myvideofile/tv003.png
Get the height & width dimensions of one of the thumbnails to use as the basis of our grid coordinates, using ImageMagick utility
identify -format "%g - %f" thumbs/myvideofile/tv001.png
which returns output like :
100x55+0+0 - tv001.png
from which we parse 100 and 55 as our Width & Height, and the general geometry of each thumbnail (W, H, X, Y)
We then generate our single spritemap from the individual thumbnails. We determine the target grid size (e.g. 2x2, 8x8) to suit the number of thumbnails we generated for this video, as well as passing in the sprite geometry, using an ImageMagick utility
montage thumbs/myvideofile/tv*.png -tile 2x2 -geometry 100x55+0+0 thumbs/myvideofile/myvideofile_sprite.png
Optionally we can run an extra compression step here to make the sprite smaller
optipng thumbs/myvideofile/myvideofile_sprite.png
We then generate a VTT file based on the number of thumbnails we created, using
the interval that we used to space out the thumbnails to label each time segment, and
using the known coordinates of each consecutive image within our sprite that maps to
the associated segment.
I've developed a Ruby gem to easily create .VTT file and sprite of thumbnails.
Thanks for inspiring #randalv!
You can take a look at it here:
https://github.com/scaryguy/jwthumbs
Usage
Instantiate your video file:
movie = Jwthumbs::Movie.new("YOUR_VIDEO.mp4")
Jwthumbs::Movie.new accepts second parameter as a options hash. You can configure several stuff at the same time you instantiate your video like this:
movie = Jwthumbs::Movie.new("YOUR_VIDEO.mp4", seconds_between: 60, sprite_name: "my_sprite_name.jpg")
or after you instentiated your video, you can use Jwthumbs::Movie file to configure things:
movie = Jwthumbs::Movie.new("YOUR_VIDEO.mp4")
movie.seconds_between = 60
movie.sprite_name = "my_sprite_name.jpg"
and then to create your thumbnails and .VTT file just run this command.
movie.create_thumbs!
I know this is already a few years old but I had the same problem and found a command line tool which generates sprites pretty fast and since 1.0.6 supports WebVTT creation out of the box. The name is mt and you can check it here.
Quoting from their documentation you can use it like this:
just run mt and provide any video file as args: mt video.avi
Some of the settings can be changed through runtime flags provided
directly to mt for more information just run mt --help
Option 1 :
You can use the encoding.com's API and tell them to export vtt file too
I recommend to read "How can I create time synced thumbnails for use in JW player?" explanation from encoding.com's Knowledge base
Option 2 :
use movie thumbnailer (mtn), this is a command line tools running on UNIX, Windows systems. But you will have to write a custom script to generate the VTT file corresponding
Super fast! Thanks to FFmpeg's libavcodec.
Command line program: canbe used on remote connections to co-location servers, or used in scripts.
Batch mode: recursively search directories for movie files. Run at lower priority (nice 10 on Linux, idle on Windows) by default.
To run at normal priority use -n option.
Thumbnails are group together in one jpeg file and can be saved individually too (-I
option).
Work fine with Unicode filenames in both Linux & Windows
(might need to change the font with -f fontfile).

How to modify a .png image with VBScript

I have a need to select a portion of a .png file, with specific cordinators, and delete this area then save the file back with the same name.
I would appreciate if you can help to come up with a VBScript script that can accomplish this task.
It would be great if all proesses happen in the background, but it would be ok too if the image file has to be open and visible. Thanks a bunch!!!
A PNG file, like any other binary file can be edited with CMD or VBS.
A PNG file layout is as follows:
File header
"Chunks" within the file
Pixel format
Transparency of image
Compression
Interlacing
Animation
Read the PNG format in RFC 2083 to know how to edit/create a PNG file at binary/bit level.
To speed up the editing process, libraries are available for application level editing.
Here are some VBA codes for image manipulation.
ImageMagick also provides libraries that can be accessed via VBS for image editing.
Here's a VBScript Image Class for bmp and pcx files (which PNG can be converted to before editing via WIA).
Loadpicture function described here doesn't seem to support PNG, but this discussion might solve it.
The Windows Image Acquisition Library v2.0 supports PNG, BMP, JPG, GIF and TIFF image formats, and comes with Windows Vista and later versions. Sample scripts are available to demonstrate "image manipulation using the ImageFile object". The Vector.ImageFile property also "creates an ImageFile object from raw ARGB data".
More sample codes here & here show how to rotate, flip, scale, crop, etc with WIA Image constants in vbs. To remove unwanted areas of image (with given coordinates), use the crop function.
Here's a discussion of WIA 2.0 image editing on stackoverflow.
VBScript doesn't have any image editing functions, so you need an external tool for that. For example, GIMP can do image processing from the command line (see here). ImageMagick provides a scriptable component in addition to the command-line interface (details here).
To run a command line from a VBScript script, you can use the WShShell.Run method. To create an instance of a COM scriptable component, use the CreateObject function.

JPEG Shows in Firefox but Not IE8

I'm working on a Sidebar Gadget and cannot get my JPEGs to show up (PNGs work). When I try to open the file by itself in IE8 it doesn't work. Firefox, of course, can open it fine.
JPEG Details:
Dimensions: 1080X900
180 dpi
Bit depth 24
Color representation: uncalibrated
I've found some things talking about the images being compressed incorrectly (?) but I haven't been able to get it working...
Any clues?
IE8 drops support for CMYK JPEG and renders them as the infamous red X without so much as a warning.
If you have ImageMagick:
identify -verbose image.jpg
will show you the image colorspace. If it's CMYK, you can convert to RGB with:
convert broken.jpg -colorspace RGB fixed.jpg
If you need to do CMYK to RGB conversion on a whole batch of JPEG-images, this command may be helpful to you:
for i in *.jpg; do convert "$i" -colorspace RGB "$i"; done
PS: If you'd like to see what is going on, just add -verbose:
for i in *.jpg; do convert "$i" -colorspace RGB -verbose "$i"; done
I had a similar issue with IE8 not displaying two JPEG images. FF, Safari, Chrome all displayed them without complaint but IE acted as if the files were not there. I have no idea what was going on, but a quick image conversion to gif or png fixed the problem. Just another in a long line of confirmations that IE sucks.
Had similar problems with existing images, which will not show up in IE8.
Problem is, as converter42 says: CMYK-Images
Convert them to RGB colorspace and all is good
The Solution with the PNG is not the best, because PNG files can be MUUUCH larger than JPGS.
If you are using photoshop for creating the jpgs. Try the below.
Open the file and go to 'Image' menu
Go to Mode
Select RGB
Save and upload to server.
This should work.
Why are you dealing with the image at 180 dpi and not the 72dpi screen resolution? At screen resolution the image will be roughly double that size. Still, the size is manageable for any browser.
When creating a gadget, you should be using PNGs for all the elements of the gadgets. Are you having issues displaying JPEG photos?
Have you looked for the yellow bar at the top of IE that blocks certain suspicious content from being loaded (popups, activex, javascript, etc.)? If it appears, try telling it to "allow".
Lastly, what are you using to compress your images to JPEG?
EDIT: If you want to do batch conversion use the batch converter in photoshop or use the Actions panel to record the conversion process for a single image, then replay the action on an entire folder. Additionally, you can save this action to a "droplet" which is a small application containing the action that you can drop an image or folder on top to.
Alternatively, if you don't fell like learning Actions, XNView is an excellent image viewer and converter that supports something like 160 different image formats and can batch convert and batch rename huge lists of files.
I fixed this issue by opening the CMYK JPEG file in Windows Paint and then saving as a JPEG, which Paint encodes as RGB by default. Not a great solution because I'm sure that Paint's converter is not as robust as Photoshop's, but this can be a quick fix if the job needs to be done now and there's no access to the tools above.

Resources