I am using adobe after effect 2015 and I got a black screen in mocha ae after importing MP4 file. I have set the both FPS and resolution as same. Why? - mocha.js

I am using adobe after effect 2015 and when I import MP4 file into the mocha AE it gets black. I set the video and composition FPS as same as well as the resolution and i am using I3 5gen computer and on board GPU. Can u tell what is the reason for that.

Related

Why does a video larger than 8176 x 4088 created using AVFoundation come out with a uniform dark green color on my Mac?

When I use AVFoundation to create an 8K (7680 x 4320) MP4 with frames directly drawn onto pixel buffers obtained from the pixel buffer pool, it works with kCVPixelFormatType_32ARGB.
However if I use kCVPixelFormatType_32BGRA, the entire video has a uniform dark green color instead of the actual contents. This problem occurs for resolutions above 8176 x 4088.
What could be causing this problem?
AVAssetWriter.h in SDK 10.15 and in SDK 11.3 says:
The H.264 encoder natively supports ... If you need to work in the RGB domain then kCVPixelFormatType_32BGRA is recommended on iOS and kCVPixelFormatType_32ARGB is recommended on OSX.
AVAssetWriter.h in SDK 12.3 however says:
The H.264 and HEVC encoders natively support ... If you need to work in the RGB domain then kCVPixelFormatType_32BGRA is recommended on iOS and macOS.
AVAssetWriter.h on all three SDKs however also says:
If you are working with high bit depth sources the following yuv pixel formats are recommended when encoding to ProRes: kCVPixelFormatType_4444AYpCbCr16, kCVPixelFormatType_422YpCbCr16, and kCVPixelFormatType_422YpCbCr10. When working in the RGB domain kCVPixelFormatType_64ARGB is recommended.
Whatever be the recommendations, the below prelude states that all of them are just for optimal performance and not for error free encoding!
For optimal performance the format of the pixel buffer should match one of the native formats supported by the selected video encoder. Below are some recommendations:
Now, Keynote movie export with H.264 compression also results in the same problem with the same size limits on my Mid-2012 15-inch Retina MacBook Pro running Catalina (supports upto Keynote 11.1). This problem doesn't occur on a later Mac running Monterey where the latest version 12.2 of Keynote is supported.
I have not included code because Keynote movie export is a simple means to reproduce and understand the problem.
My motivation for asking this question is to obtain clarity on:
What is the right pixel format to use for MP4 creation?
What are safe size limits under which MP4 creation will be problem free?

How to add colorProfile with AVAssetWriter to video recorded from screen using CGDisplayStream

I've written a screen-recording app that writes out H.264 movie files using VideoToolbox and AVWriter. The colors in the recorded files are a bit dull compared to the original screen. I know that this if because the colorProfile is not stored in the video-file.
This is closely related to How to color manage AVAssetWriter output
I have created a testbed to show this on github ScreenRecordTest
If you run this app you can start recording using CMD-R and stop it using the same CMD-R (You have to start and stop recording once to get a fully written movie-file). You will find the recording in your /tmp/ folder under a name similar like this: "/tmp/grab-2018-10-25 09:23:32 +0000.mov"
When recording the app shows two live images: a) the frame gotten from CGDisplayStream -and- b) the cmSampleBuffer that came out of the compressor.
What I found out is that the IOSurface that is returned from CGDisplayStream is not color-managed, so you'll notice the "dull" colors already before compression. If you un-comment line 89 in AppDelegate.swift
// cgImage = cgImage.copy(colorSpace: screenColorSpace)!
this live-preview will have the correct colors. Now this is only for displaying the IOSurface before compression. I have no idea how to make the other live-preview (after compression) (line 69 in AppDelegate) show correct colors (say: how to apply a colorProfile to a CMSampleBuffer) or most important how to tag the written video-file with the right profile so that when opening the .mov file I get the correct colors on playback.

How to preserve transparency when using png to make video with ffmpeg

I have a series of png's that have an alpha channel as a background. Each file is named like file_name.0001.png and so on, in subsequent order. I'd like to join these png's into a video with ffmpeg and maintain the transparency.
I've tried a couple of things but I suspect I'm running into a codec issue. When I run ffmpeg, the video is created but the background is black.
If it makes a difference, I'm wanting to use the video in Microsoft Powerpoint. Thanks!
Edit
The suggested duplicate is very close to what I was looking for, thank you! The only reason it's not a complete solution is none of the options presented in the other thread work well with Microsoft Powerpoint. None of the codecs used in the suggested solution play well with Powerpoint. This is not the fault of ffmpeg, but of Powerpoint.
Though ffmpeg doesn't seem to be able to do what I need, I found that imagemagick did the trick. I was able to create a gif from the images and the alpha channel was preserved. I used the following:
convert -dispose 3 -coalesce images.*.png gif_file_name.gif
The -dispose 3 is critical as it tells imagemagick to clear the image prior to overlay, otherwise, you can see each image overlaid on each other (since they have the transparent background).
I couldn't get ffmpeg to create a video that preserved the alpha channel and was Powerpoint friendly (not the fault of ffmpeg). Though ffmpeg doesn't seem to be able to do what I need, I found that imagemagick did the trick. I was able to create a gif from the images and the alpha channel was preserved. I used the following:
convert -dispose 3 -coalesce images.*.png gif_file_name.gif
The -dispose 3 is critical as it tells imagemagick to clear the image prior to overlay, otherwise, you can see each image overlaid on each other (since they have the transparent background).

Filter/find animated GIFs in Windows

I am looking for a way to "find" animated GIFs so I can remove them from a folder.
This must work on Windows 7 or Windows XP.
Edit: I am looking to distinguish between animated and regular GIFs. If I could select all GIFs that might be ok as then I could sort by size, but some GIFs are saved with the extension .jpg! That is why I think I probably need a special Image viewer program.
You can use ImageMagick to get the number of frames in a GIF like this:
identify -format "%[scene]\n" YourImage.gif[-1]
identify -format "%[scene]\n" YourImage.jpeg[-1]
It actually gets the frame number of the last frame, so if the image has 37 frames, it will tell you that frame 36 (starting at zero) is the last. So, an animated GIF will give an output of 1 or more since it has multiple frames.
This also works, if the image is mis-named by using a different name suffix. ImageMagick isn't fooled by this, it will still discover that in reality it is a GIF. If it is a standard JPEG, or a GIF with only 1 frame it will return 0.
ImageMagick is free and available for OSX, Linux and Windows - here.

matlab - VideoReader frames aren't decoded accurately

I am working with video in Matlab, and having trouble.
I'm using Matlab R2012a on a Mac OS X 10.8.2 (Mountain Lion).
I can load a video in using VideoReader and grab a frame like so:
vid = VideoReader('movie.mp4');
pic = read(vid, 20);
imshow(pic);
However, what I see in Matlab is..
Instead of this (in VLC)..
Not only is movement being garbled (the turquoise truck) but the green truck in the background is actually gone by that frame. I'm guessing the codec is compressing the movie in such a way that Matlab isn't compensating for. However, I can't find any other video format that Matlab will accept.
The video shown is mpeg4, yuv420p. I see Matlab mentions a lot about mpeg2 being supported and AVI being the preference. I've converted the video to all sorts of formats using ffmpeg but Matlab has given the following error for every other file format:
Error using VideoReader/init (line 447)
Failed to initialize internal resources.
Error in VideoReader (line 132)
obj.init(fileName);
Any thoughts?
Got it.
Thanks to #wakjah for the tip about QuickTime. A video editor friend suggested MPEG StreamClip to convert to the QuickTime format.
This tool took my mp4 file and let me Export as QuickTime.
Sure enough, Matlab loaded it up the mov file no problem and the artifacts are gone.
Cheers.

Resources