How do you automate making gifs from videos? - photoshop

I have around 50 video clips that I need to make into gifs. I'm aware of the process to make a gif using photoshop. I was wondering if there was a way to automate this so I don't have to spend too much time doing it.

You can do it by creating actions in photoshop. Open one clip, create new action and record what you are doing. Then open all your clips and press play. Haven't tried it with clips yet but that's the auto way.
Other way, there are websites that convert clips into gifs. Both take same amount of time, but some websites are more prepared for this.

If you have linux or cygwin you can use ImageMagick.
convert -quiet -delay 1 plane.avi plane.gif
http://www.imagemagick.org/Usage/video/
Off the top of my head, you could do this as a shell script to do all 50 in a directory:
for file in *.avi; do
convert -quiet -delay 1 "$file" $(basename "$file" ".avi").gif
done

If you like to do it programatically you can use http://gifserver.levy.se by adding the url to the video like http://gifserver.levy.se?video=urlTovideo.mp4&format=json
You can checkout the source from github at https://github.com/marlev/gifserver

Related

Is there a way to save a matplotlib animation as a video (with ffmpeg) so that the last frame is held for N seconds?

I'm using FFMpegWriter to save a matplotlib animation as a video. I'd like to hold the last frame for some seconds at the end of the video.
As a workaround, one could modify the animation itself by repeating the last frame for a number of extra steps. This number of steps can be computed as a function of the desired "hold duration" and the interval/fps of the animation.
Nonetheless, I'd like to know if there's a cleaner way to do the same without artificially modifying the animation itself and using instead some extra arguments for the writer (which uses ffmpeg in my case). Unfortunately I don't know much of ffmpeg so I'd like to have some help.
Thank you.
Answering my own question. I ended up running a ffmpeg command (with subprocess.run) after saving the video with matplotlib:
ffmpeg \
-i <your-input-file> \
-vf tpad=stop_mode=clone:stop_duration=<your-stop-duration> \
<your-output-file>
I've not tried if it's possible to pass this filter to FFMpegWriter directly.

How to make android animation like new Google app, "Playbook for Developers"?

This is the link for the app Playbook for Developers.
these are examples of animations::
I think, this app use AnimatedVectorDrawable.
However it is very difficult to create a complex animation, unless there is any tool that converts vectors as svg2android made ools as Adobe Illustrator into vectors android can identify.
I would be most grateful if you tell me how to make these animations and if there is any tool to make using tools such as Adobe After Effects.
Unzip the apk and you will find out that they are gif files.
And it seems that they are using https://github.com/koral--/android-gif-drawable to load gif files.

Unable to load app preview in iTunes connect

Has anyone been able to load an app preview video in iTunes connect? I receive an error every time, saying "Your file could not be loaded. Please try again."
Any workaround to this, that you're aware of?
I'm here to save the day. The root of the issue is that itunesconnect does not like the format of the file saved by quicktime, or pretty much any format for that matter.
I was able to find just 1 file format that worked. You will need a free program called HandBrake
Use this program to convert the file you are trying to upload with the options I have highlighted in this screenshot:
(Optional) If your video has no sound, go to the audio tab in HandBrake and remove the track, like so:
Note, when you are doing multiple conversions in a row, sometimes the output size gets screwed up, keep an eye on that (it might be a bug in handbrake).
That's it! Upload the file created by HandBrake and it works! Consider donating to the developer of HandBrake for an awesome app.
Edit: Quote from comments:
For those who are struggling (like I was) to make a video 1080p
(1920x1080), don't forget to go to the Picture tab and: change the
Anamorphic setting to "Off", change the Modulus setting to "8" and
last but not least change the Cropping setting to "Custom" and set the
Top, Bottom, Right, Left to "0" – gaskbr Aug 18
Edit 2: You have to set the audio right also, looks like Apple don't accept files without audio channels anymore. Set the codec to AAC, 44.1 (or 48 kHz), bitrate 256.
I have confirmed that it is because of the low upstream speed of certain ADSL, I have to buy a 3G hotspot to upload my preview video.
iMovie10.0.6 can export 'App Preview.mp4' directly, no need to convert by HandBrake.
Apple has answered me that 'Please be advised that we cannot guarantee a successful delivery if you are on a slow internet connection.'.
But I think Apple should improve their upload service like Google does.
I was having the same issue and Handbrake wasn't helping.
Then I found this:
https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/Properties.html#//apple_ref/doc/uid/TP40011225-CH26-SW14
I put together my app preview video in After Effects. So when I rendered the movie out I matched the App Preview Specifications seen in the link above and my app previews finally uploaded properly.
I had the same problem and found out that I had to strictly follow the video specifications defined here: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/Properties.html#//apple_ref/doc/uid/TP40011225-CH26-SW14
My level was set to 5.1, audio bitrate was at 192 kbps and at 48 kHz. So I could upload the video but it showed this error message. With the correct settings every thing works fine!
I think the relevant change I made was setting the level from 5.1 to 4.0.
Some specifications you might consider for H.264 videos:
- CBR between 10 and 12 Mbps.
- Max Level 4.0.
- Audio at 256 kbps AAC with 44.1 kHz.
- Max 30 fps.
- Max 500 Mb.
- Min 15 sec, max 30 sec.
Messing about with Handbrake etc. was tedious so I made an app specifically for converting videos for iTunes Connect.
https://itunes.apple.com/gb/app/preview-video-converter/id1137451860?mt=12
Sometimes the error has nothing to do with your video or format. It's THEIR server.
I had a video that uploaded fine one day and got the ERROR : "Your app video preview is in the wrong format." I did everything I could to tweak, check, change, re-export etc etc to fix it - thinking that it was me. It wasn't.
They have server issues and give an error when there's nothing wrong on your end.
HOW IT WORKED FOR ME
Logout of iTunes Connect
Relax
Go to sleep
Wake up in the morning, relogin to iTC and try again. IT WORKS! With the exact same video file in the exact same format!!!
My steps were to upload the new video. Once I see the play button in Safari, I played the video all the way through. Closed that popup. Save. Then submit. I did get that message that says it could take 24 hrs for video to process but I did not get the format error.
Good luck. Hope this helps someone.
To know more precisely why a video is being rejected, open the developer console, and look at the code. Although Apple doesn't show the problem in the interface, the code reveals why a video was rejected.
In our case, it looked like this:
errorCodes: Array (5)
0"MOV_H264_LEVEL_TOO_HIGH"
1"MOV_AUDIO_IS_MISSING"
2"MOV_AUDIO_CODEC_NOT_ACCEPTABLE"
3"MOV_INVALID_AUDIO_FORMAT"
4"MOV_AUDIO_TRACKS_DURATION_TOO_SHORT"
Array Prototype
localizedMessage: "The H264 Level is too high. Please refer to Apple's documentation for appropriate formats."
nonLocalizedMessage: "H264 Level is too high. Please refer to Apple's documentation for appropriate levels."
statusCode: 400
suggestionCode: "MOV_RESAVE_LOWER_LEVEL"
Use iMovie and create an App Preview project, then export it as an App Preview video.
If you are starting with mp4 videos created by ScreenCastOmatic, these steps work almost perfect:
http://daimtech.wordpress.com/2014/09/26/how-to-create-and-submit-a-preview-video-for-app-store-apps-using-mavericks-and-ios-8/
The one missing step is the audio needs to be in stereo form. Use ffmpeg with -strict 2 -ac 2 for the output file to create stereo aac, like so:
ffmpeg -i Preview.mp4 -strict -2 -vf scale=1136:640 **-ac 2** output.mp4
Adding this because I finally was able to capture a video from the Simulator and convert it to properly upload on the App Store.
First, to capture the video:
xcrun simctl io booted recordVideo myvideo.mp4 --codec h264 --force
Then, to convert it:
ffmpeg -I myvideo.mp4 -vf scale=1600:1200,setsar=1:1 -c:v libx264 -crf 1 -profile:v high -level:v 4.0 -r 30 -c:a copy rescaledvideo.mp4
The above rescales to iPad size, makes sure the H.264 level is acceptable, and sets the frame rate to 30fps. Apple also requires an audio track. Since the simulator doesn't have one you can add one like this:
ffmpeg -f lavfi -i anullsrc=channel_layout=stereo:sample_rate=44100 -I rescaledvideo.mp4 -shortest -c:v copy -c:a aac rescaledvideo+audio.mp4
I wrote a script here to capture and convert iOS simulator videos:
https://github.com/kkieffer/appPreview
You can do it online using this site
http://video.online-convert.com/convert-to-mp4
and set the following
vid bitrate : 10240
frame rate: 30
audio quality: 256
My problem was that my video was too short. Apparently, a 15 second video won't do it. So I just recorded a longer video.
I used Apple's built in screen recorder available in iOS 11.X. No video formatting needed.
Absolute nightmare 😱 This is what I did.
I recorded the app using my device and quicktime which gave me a portrait video, then created an 'app preview project' using iMovie, and exported it as an 'app preview project'. The device I had that day was an iPhone 6.
The resulting dimensions from iMovie were 750 x 1334 px but iTunes Connect was asking for 1080 x 1920 px which was surprising given what the documentation from apple was saying and also that its all just supposed to work iMovie 🤷‍♂️.
so then I used this site to convert my video to a .mov file and set the screen size to 1080 x 1920 (portrait (reverse for landscape)) set the audio codec to mp3 and video to mp4 (all of this was after trial and error)
finally I converted the .mov file to .MP4
Finally was able to upload to iTunes connect and it worked 🎉
😉✌️
Just had the same issue. I resolved it by exporting the original video to mp4. It didnt worked by converting with HandBrake.
I couldn't get it to work with Handbrake either, but I did get it to work (finally) with Quicktime 7. I don't even know if Apple sells iTunes 7 anymore, but it has more export options than the newer version of Quicktime do. I think iMovie might give you similar export options.
I started with a Quicktime movie (mov) file recorded from my Mac in Yosemite using the iPhone as a video source.
In Quicktime 7 I went to File -> Export and chose Movie to Quicktime Movie, and used the following settings for audio and video.
Adding this here incase it helps someone else.
I was also having trouble with this and didn't think the Handbrake method was required for me because I was using Adobe CC (After Effects > Adobe Media Encoder), so I was able to specifically choose all the correct settings according to the Apple Guidelines.
But in my case the issue wasn't the format, but possibly the length it took to upload / upstream bandwidth (an undocumented timeout?).
Tried it at home with crappy Australian cable 40mb mp4 file at 60kb/s, took about 20minutes to fully upload, and kept showing that error after it, with various formats.
Switched to my office internet which uses fibre, it uploaded in 5 seconds successfully, no format change required.
Like some of the other answers here, the Apple specifications helped a lot: https://developer.apple.com/library/ios/documentation/LanguagesUtilities/Conceptual/iTunesConnect_Guide/Appendices/Properties.html#//apple_ref/doc/uid/TP40011225-CH26-SW14
A slow internet connection could be the problem.
I also got the error message "Your file could not be loaded. Please try again." while uploading the app preview video.
I could solve the problem by switching from wifi with 160 kBit/s upload to my companies internet connection with Ethernet and 12 Mbit/s upload.
Sometimes there are issues on the iTunes Connect server and you have to wait a little bit before trying to submit again. Usually when you upload a video and then save it, you'll get this message on top of the video:
Processing app video. This process could take up to 24 hours.
Sometimes when I save videos that I know should work, I don't get this and I get the message mentioned in the OP. Try coming back to it later and it will probably work (assuming you've followed all of Apple's guidelines).
If you have used QuickTime to make a screen recording, try changing the frame rate to 30fps using ffmpeg:
https://stackoverflow.com/a/28939013/1588248
I try with Apple guide to create new movie.
I small tip that when you drop video to ItunesConnect and click save button together with it, don't wait. Then you have processing screen appear. Wait from here.
That's my way, hope this help!
My solution is just to change screenshot Japanese name to English name then it works.
FWIW, here are the ScreenFlow 5 settings I used successfully to upload my app preview:
Web - High: Customized
H.264 Video:
Framerate: 30fps
Datarate: 1200 kbits/sec
Profile: Main
Keyframe Rate: Automatic
AAC Audio:
Sample rate: 44.1kHz
Datarate: 256 kbits/sec
Channels: Stereo
The important bit seemed to be not to uncheck the AAC Audio.
Using the unsupported file name characters was the issue in my case – I had to remove "space bars" from my video's file name.
I use ffmpeg to modify videos so they are accepted in iTunes connect (modify as you need):
# Reduce frame rate from 60 to 30
ffmpeg -y -r 30 -i input.mp4 -strict -2 output-almost.mp4
ffmpeg -y -i output-almost.mp4 -filter:v "setpts=0.5*PTS" -strict -2 output.mp4
rm -f output-almost.mp4
# Trim video
# From second 10, take 30 seconds
ffmpeg -i input.mp4 -strict -2 -ss 10 -t 30 -async 1 output.mp4
# Set codec, bitrate, etc....
ffmpeg -i input.mp4 -c:v libx264 -profile:v baseline -level 4.0 -pix_fmt yuv420p -c:a aac -ac 2 -b:a 256k -b:v 10M -movflags faststart -strict -2 output.mp4
Also, sometimes when I press "save" in iTunes connect, after I uploaded the video, I get an error. But, then I change the tab to see another screenshots size, then I go back, press save again, and... it's saved without any error (awesome Apple...)
Some other advice:
Record video using a Simulator.
Add silent mp3 (get here) audio track using OnlineConverter
Use HandBreak as described above but also remember to set the resolution as required (depends on device).

How to get the video file for a movie currently playing in browser?

So I have a youtube page open where I can watch a video.
But this video was taken down by the user. My open page still has the video, if you go to it again (refresh) the new page does not.
Since I have the video loaded in my browser tab (chrome), how can I go about finding the actual file and saving it?
In the old days of YouTube, it may have been possible to find the single video file on your harddrive and save it, but this is no longer the case. As explained in this Computerphile video, all YouTube videos are now split into tiny pieces and downloaded piece by piece.
You can observe this for yourself if you open up Chrome (or Firefox's) Dev Tools and watch the nnetwork tab. You'll see:
all of the pieces of the video loading bit by bit.
One additional thing you'll learn from the Network tab is that the videos are downloaded as octet streams, so you won't be able to find the links to the pieces hidden in the DOM.
One thing you migth try is, in the Network tab, clear the results and then move the cursor to the beginning of the video. You should see the streams come up again. Right click on the path name and then do a "save as", and save it as 0000.mp4 (or whatever), for all the pieces. You should be able to reassemble these pieces in any video editing software. I tested this by getting two pieces from a random YouTube video.
I couldn't find anything that doesn't require a restart (and hence reload) of Chrome.
One (kludgy) hack if possible, though, would be to run a screen video capture and play the video.
I have done this long back using IE6, i.e. fetch the file from the temporary files location and rename it to the extension flv.
The following links should point you in the right direction, but can't say it will work for sure, as I believe recent chrome versions seem to have a defensive cache implementation.
Ubuntu Forum solutions
You might need to tweak the above for your use.
Run a screen recording/capture program such as:
Screenr
CamStudio
Then edit out the youtube bar if its visible.
The buffered video is cached at the following location:
C:\Users\<user name>\AppData\Local\Temp\flaxxxx.tmp
Note you have to change to whatever user you are using, and xxxx is a random number. Also, the .tmp file might be hidden, so make sure your windows explorer is displaying the hidden files.
While the tab is open, you won't be able to copy the file, but if you close it, the file will be automatically deleted. For doing so, download HoboCopy, extract it and after that, run cmd as administrator. Change the directory on the console to the directory where you have extracted HoboCopy and type the following command:
hobocopy C:\users\<user name>\Appdata\Local\Temp C:\videos fla1234.tmp
<user name> - replace with your windows username
C:\videos - the directory where you want the video to be copied to
fla1234.tmp - the name of the file to be copied.
Wait for the copy to be done and then you can rename the destination file, changing '.tmp' to '.flv'. This file can be played with any FLV supporting media player.
i find this software to get the video from temp files folder and play it http://www.nirsoft.net/utils/video_cache_view.html
Video file is cached, therefore suggested ways can help you to save the file. But if you deal with same problems I offer using IDM(Internet Download Manager). After installation of this application for every online video stream (e.g. all flv files in youtube) IDM brings a small picture that you can click on it and downloading will be started automatically without need of any configuration.
You have to install a browser extension to download YouTube videos. You won't find a simple URL for an mp4 file in the HTML source. Try googling "youtube downloader" + your browser name.
As far as I recall, YouTube videos are not served as a continuous HTTP resource, but instead divided into small chunks and assembled client-side by the Flash player. This is why you can jump into the middle of a video, without having to buffer the first half of the video.
Generally speaking, YouTube don't want you to rip their content, so they aren't exactly making it easy for downloaders.

avs2avi stripping audio channel?

I'm trying to build a video using a command line wizard I've written. To do this, I am constructing an AVISynth file (in this case, a huge 1,820-line, 94Kb file) and use avs2avi to render it.
It works great, but for some reason it doesn't save the audio.
Here's the general layout of my AVS:
# lots of code to generate the video here
vid = titles+main+ending
aud = WAVSource("render.wav")
AudioDub(vid,aud)
It plays fine in Media Player, audio and all. But with this command line:
avs2avi render.avs render.avi -c XVID
It renders the video without any sound. Similarly, if I drop the -c XVID parameter, I get the dialog asking me for a compression format and I still get no sound.
What gives, and how can I fix this? The only alternative I'm seeing is using something like VirtualDub to put the audio track back in, but it seems like a hassle.
Edit: It doesn't work with simple scripts either.
BlankClip(length=100,width=256,height=256,fps=25).AudioDub(WAVSource("beep.wav"))
Produces sound in Media Player, and a silent video through avs2avi.