I don't know what I'm doing anymore.
I'm trying to convert an MP4 video I recorded with Open Broadcaster Software to a series of PNG frames. I first tried Adobe Media Encoder CS5. Unfortunately, I found the exported image quality unsatisfactory.
Here are some examples:
Below is a screenshot of the movie I took with VLC Media Player.
In my opinion, the quality here is flawless. Zoom in -- the pixel edges are quite pronounced.
Below here is a frame I exported with Adobe Media Encoder.
If you zoom in, you'll notice annoying little pixel echos. I feel like the image has been ever so slightly scaled and then re-scaled.
Here are two comparisons.
Notice the VLC screenshot is quite crisp and precise. I'd like to see that same pixel precision on every frame I export.
It was quite apparent I was losing quality with AME.
I tried many, many times to match the source video's settings when I exported. No luck.
It was already clear to me VLC was capable of outputting the frames I needed with the quality I wanted.
I mean, it took perfect video screenshots.
So I tried to export every frame of the movie using VLC's Scene video filter.
I set the 'Recording ratio' to '1' so that VLC would export every single frame.
Apparently, VLC is unable to export every single frame. Whenever it tries to do this, most of
the exported images are corrupt and empty. This bug has been known since 2008, and
still remains unfixed.
After this, I tried numerous different programs to no avail. I tried AVS Video Editor,
VirtualDub, VirtualDubMod, MediaCoder, Convert MP4 to Any and a few others I've
already forgotten.
None of them can convert an MP4 video to a series of lossless PNG images.
Next I looked at ffmpeg.
This thing is beyond me. I have to use the Command Prompt?
People say it can do the job, but I have no idea how to work it.
Well, to summarize, I need a program that can export either .png images or .tiff images from an MP4 video.
I want a program that can do this with zero compression. Does anyone know of one? VLC would work if it could just
export every frame.
I just want a series of perfect, crystal-clear screenshots.
+ Reply to Thread
Results 1 to 30 of 44
-
Last edited by Baldrick; 8th Sep 2014 at 02:09. Reason: New title
-
Try ffmpeg
ffmpeg -i input.mp4 -r 25 -f image2 imagefolder\images%05d.png
and I added mp4 to png to your thread title. -
Another possible solution:
VirtualDub + input plugin (e.g. ffinputdriver), then export as PNG sequence -
-
Now that I've edited each frame in Photoshop, I'd like to convert all the PNG images back to an MP4 video. How might I do this without any compression?
Again, I'd like to retain pixel clarity.
I was planning to do this in Adobe Premier Pro, but Pro can't handle 154,721 pictures.
Also, I'm not worried about losing the audio. -
Probably you have used the wrong method right from the start.
What kind of edit you needed can ONLY be done in PhotoShop???
Converting 154721 PNGs back to MP4 w/o compression???No way!
PNG is in RGBA format while MP4 is in YUV, completely different things.
You should do your editing in NLE, and save any intermediate file as loseless AVI(lagarith/utvideo). When you are ready to publish it, encode it to mp4.Stopping development until someone save me from poverty or get me out of Hong Kong...
Twitter @MaverickTse -
-
Corrupt ? try a different decoder. New ffv1 (v1.3) encodes require the newest ffv1 decoder. It looks like you are importing into ?Adobe . It won't work because there is no new ffv1 VFW decoder
MP4 is just a container ; although YUV is the most common for video, it can hold RGB formats (e.g. libx264 RGB) . RGB has no subsampling, so pixel edges are crisp. YUV can be subsampled or not subsampled (YUV444)
You should probably start over and do it properly.
1) You need to keep the same colorspace and color subsampling , otherwise you will unnecessarily lose quality. Use mediainfo (view=>text) on the original MP4, copy & paste back the results here
PNG uses lossless compression - so you don't have compression losses - BUT you can still incur other losses from manipulations such as chroma up/down scaling, colorspace conversions if your original wasn't video wasn't in RGB by converting it to PNG for photoshop. There are probably better, faster ways to do this directly (and faster without a folder of PNG images)
2) To keep the pixellated look during scaling, you need to use "nearest neighbor" algorithm - that's probably why you had problems in Adobe Media Encoder, it was using a different kernal for interpolation (it uses scaling similar to bicubic with MRQ enabled). I'm assuming you're doing some scaling because your screenshot is 1485x1080, but the settings say 1440x900 . Maybe you should explain what is going on there. Note there are variations of "nearest neighbor", some algorithms assume center of the pixel for the scaling center, others assume scaling from top left corner of pixels
Also , there is a Rec601 vs. 709 mismatch (colors are shifted) . This suggest that your original was recorded in YUV
3) You said "cropping and scaling" - but your gif screenshot just shows scaling 1485x1080 to 704x512 . Exactly what manipulations is being done in photoshop ? Only scaling ? -
Stopping development until someone save me from poverty or get me out of Hong Kong...
Twitter @MaverickTse -
Here is a demonstration on a simple NN resize using AviUtl. Just take a few minutes... may be taking an hour depending on your video's length and PC spec, but certainly not days...
(You may skip the unsharp mask and anti-ringing filter if you are happy with the plain resize)Stopping development until someone save me from poverty or get me out of Hong Kong...
Twitter @MaverickTse -
I'll start from the beginning. I recorded a series of 29 gameplay videos, which I then spliced together in Adobe Premiere Pro CS5 to make one final video.
The videos however, require some editing.
I recorded a Flash game with a small frame size. Much of the image is composed of black.
First, I crop out the negative space, leaving me with a frame size of 704x512. I then upscale the image to HD and slightly shrink the canvas leaving a final size of 1440x1080.
I did this with every single frame from all 29 videos. Since Premiere Pro can't work with so many images at once, I decided to export each frame set
to its corresponding movie using FFmpeg, and then import the 29 frame-fixed videos into Pro for the splicing I mentioned above.
This was my strategy.
I used the ffv1 encoder because I heard it was a lossless codec. What other should I use?
I would if I knew what 'doing it properly' entailed.
MediaInfo.txt
I'm afraid I don't know what any of this means. . .
It's slightly more than just doubling the resolution. I'm also cropping a significant amount of black space and nudging the canvas size a little.
Can AviUtl export a file with a frame larger than 1280x720? -
VirtualDub can do all that with internal filters. And also AviSynth can do that. If all your MP4 screen recordings are with the video at exactly the same position inside the black border, one could certainly write you an AviSynth script which will do all the required cropping and resizing, and you would only have to exchange the MP4 source file names.
But because the original gameplay obviously had a limited number of colors in a palette, encoding the original captures to AVC in MP4 with Open Broadcaster was already a bad idea. It should have been recorded in RGB first, even though that would mean huge intermediate files, but they can later be reduced to a palette of max. 256 colors and maintain original sharp colors. Encoding as AVC in MP4 already converted RGB to YUV 4:2:0 once, therefore right after recording you already lost a little quality.
Where exactly does the gameplay come from? Is it a game for an old home computer system you play in an emulator (e.g. for a C=64)? In this case, your emulator software may already be able to export a video capture in a native color format. -
@TheUninformed
You're.... really uninformed.... you have PS and Premiere at hand, and why would you think Premiere can't do what you want in the first place!?
A simple crop->resize-> export exists even in VirtualDub, AviDemux, Avisynth, AviUtl...any editor you name it.
Cropping is easy as long as the black canvas does not change its position over time
Why a program can't export a frame size above HD? 4K video may be a bit problematic, but any modern editor should be able to output a FullHD frame.
If you have paid for Premiere, go study its tutorial and video editing in general. Otherwise you waste money and making yourself a FOOL by presenting such a workflow.
I'd strongly suggest you stop doing anymore editing, until you have learned the fundamentals.
if you don't believe me what you are trying to do is very simple, you can upload a short sample, I bet any experienced user here should be able to return the fixed clip to you in half an hour(once they got the sample).Stopping development until someone save me from poverty or get me out of Hong Kong...
Twitter @MaverickTse -
I don't see the option in PotPlayer for converting an MP4 to a series of PNG frames. What am I missing here?
They that give up essential liberty to obtain a little temporary safety deserve neither liberty or safety.
--Benjamin Franklin -
@ drjtech:
Stears555 is the first member of any forum I read (and there are several) who ever managed to get on my ignore list. And I am not the only one ignoring him. Completely unrelated replies are only one reason to deserve that. -
It is lossless, and works great . But not with vfw decoders (you won't be able to reimport into adobe). There are many lossless codecs, but I you need to understand part of your problem occurred right at capturing, as you recorded in YUV 4:2:0 , not RGB . At least consider doing it differently next time as you 've already incurred loss by converting them to PNG
What "lossless" codec you use depends on what you plan on doing with it, how you plan to use it. There are potential compatibility issues, storage issues (huge filesizes), playback issues. There are many tradeoffs to be made between encoding vs. decoding speed, compression ratio etc...
It's true you can do those manipulations in Premiere, but not the upscaling using nearest neighbor - you cannot change the algorithm besides bilinear or modified bicubic with lanczos2 -
It'd be much more challenging/interesting to crop something like this (the main video is moving around)
:
movingBorderBunny.mp4
I manage to write a plugin that return this so far:
movingBorderBunny-correct1.mp4Stopping development until someone save me from poverty or get me out of Hong Kong...
Twitter @MaverickTse -
I had previously tried VirtualDub several days ago. I didn't appreciate the way it scaled the pixels.
I'm not even sure how to specify the color space in OBS. I recorded in MP4 because my only other record option was FLV.
Adobe Premiere Pro cannot import the recorded Flash Video files OBS outputs.
It's Lakeview Cabin.
All of my programs are legit. And I don't mind a slow and labored—even convoluted workflow, as long as I'm pleased with the end result.
Would you happen to know how to import a HuffYUV AVI into Premiere Pro?
I've spent a bit converting my PNGs with various codecs, and I've finally found one I really like. For a lossless codec, HuffYUV has a much smaller
file size than many, and it retains fine pixel clarity.
Here's an original video I recorded:
original video.mp4
Here is an Uncompressed AVI from the PNGs I exported:
edited video.avi
To my layman's eye I think this looks very nice. The edges are quite precise.
The main character blurs ever so slightly, but this was present on the original recording.
It's an unfortunate side affect of the conditions I was forced to record in.
My laptop is almost ten years old now, so some sacrifices had to be made in order to retain a high bit rate with no lag.
I had to record with a lower frame rate and and smaller frame size.
My strategy was to endure these limitations, and later use them to my benefit.
(1.) The crappy animations of a pixel game can make a lower frame rate unnoticeable.
(2.) Pixel games can be easily scaled up without detriment to overall picture quality.
(3.) I have a very basic knowledge of Photoshop, so if my efforts happened to meander into bitmap territory—good!
If anyone has an easier, sharper, better-looking method than the one I used to create the 'edited video', I'm open to it.
I am at this point pleased with my own results, however.
The single problem I'm facing now is, Premiere Pro doesn't recognize HuffYUV.
Premiere Pro does recognize V210, but it's garbage compared to Huffy. -
FWIW, I have no problem loading your original file in Premiere (CC 2014.) Why did you change the frame rate from 15 to 16?
-
The following was done in around 10min, including encode:
and the encoded MP4 (1280x720):
clipNresize.mp4Stopping development until someone save me from poverty or get me out of Hong Kong...
Twitter @MaverickTse -
That's not the one I need. To continue my work, I need to be able to import HuffYUV. That's the 'edited video' sample.
Or I need to find another codec that works for me.
I was trying to squeeze out the maximum frame rate possible without creating recorder lag.
I sincerely appreciate the effort put into this example. The problem here is, I'm trying to retain sharp pixelation.
I'll show a couple of examples.
Below is a comparison of the same frame from 'clipNresize' and 'edited video'.
In the clip you uploaded, the aspect ratio has been distorted from the original recording.
Also, your pixel edges are a little smudged. To clarify this, I've restored the frame-crop of 'clipNresize' to
the original proportions and then scaled and fit it over the top of my own frame-crop.
Here are all three original screenshots if you'd like to run your own comparisons.
-
You still don't get the point and insist your method is superior above all?
Does it worth 3 days just to fix a 1-pixel difference?
Why are you upscaling that much?
Do you aware that GIF has only 256 color per frame and there are extensive processing by the GIF encoder?
(search for "color quantization" and "GIF optimization" )
It is a poor idea to use animated GIF for "quality comparison"!
You want sharpness? apply a sharpening filter.
Wrong aspect ratio? Just set it what you want.
These are under human control.
This time in the same resolution as yours:
and with extra sharpening
The videos (Lagarith):
baka-lagarith.avi
Extra sharpening:
baka-lagarith-unsharp.avi
I sincerely hope that by these examples and arguments, you should not be proud of yourself by using such lengthy workflow.Stopping development until someone save me from poverty or get me out of Hong Kong...
Twitter @MaverickTse -
Sharpening filters are certainly not the desired tool for TheUninformed.
There is a difference between post-sharpened images already ruined by the YUV 4:2:0 chroma subsampling, which will have overshot edges due to Gibbs' phenomenon, and nearest-neighbor scaled RGB24 images with "rectangular" edges which can still be quantized to a smaller color palette without loss.
But the whole processing has to start with a different capturing tool in this case. A capturing tool which will record AVIs with RGB based video instead of YUV-based compressed formats. Plain screen capturing tools like FRAPS, DxTory, Bandicam, MSI Afterburner, ... you may use lossless image compression, but only in RGB color space, do not use conversion to YUV, because many usual YUV formats will reduce the chrominance subsampling and result in video with already softened color edges, right after capturing. And probably also reduced saturation. -
I didn't say that. I wouldn't be here if I insisted that.
I'd like to take the tiny video I recorded and make it look really, really nice. If it requires a few days of extra work, I don't mind.
I looked up the word 'baka'. If I've offended you, I apologize.
I used OBS because it's free. I would likely have to pay for a nice alternative, which I would like to avoid if possible. It would also force me to
re-record several hours of footage.
I'd like to save that disaster as a last resort.
Why can't Premiere Pro just recognize my Huffy file? -
Because producers of software for (semi) professionals don't care about the needs of average people using free components if they can instead make money with the problems of professionals paying well for support...
Ensure that the Huffyuv codec variant used for compression is also available for decompression. There is a difference between the original Huffyuv codec by BenRG and the enhanced implementation in ffdshow, e.g. YV12 support is new, and several bugs regarding higher resolutions have been fixed since. To use the ffdshow VfW codec for decompressing Huffyuv in AVIs, you have to activate it in ffdshows "VFW Codec Configuration" in the Decoder tab, it may not already be activated upon installation.Last edited by LigH.de; 16th Sep 2014 at 02:59.
-
I looked up the word 'baka'. If I've offended you, I apologize.
I just never have seen anyone exporting every frame of a lengthy video, edit every frame with a graphics editor, than re-construct a video out of it.
(I don't think anyone would do this except when restoring old movie or making time-lapse video)
When you eventually encoded it to MP4 and upload it to the web somewhere, you won't get that crisp image anyway.(most of the video hosting sites re-encode the uploaded video)
I tried to save you from doing stupid things and even claim it great, but it seems I failed.
So go ahead and do your video editing with Photoshop, god bless you.Stopping development until someone save me from poverty or get me out of Hong Kong...
Twitter @MaverickTse -
AFAIR FFV is supported on VfW by ffdshow.
for dumping video to png bellow syntax can be used:
Code:@ffmpeg -threads %NUMBER_OF_PROCESSORS%*1.5 -i %1 -vsync 0 %1_%%06d.png
-vf hqx=2 or -vf super2xsai