MediaReader icon indicating copy to clipboard operation
MediaReader copied to clipboard

Image Quality

Open MJTSoftware opened this issue 9 years ago • 6 comments

Thanks for this! In my app I am pulling the frames and saving them using your MediaReader and then I am rearranging them and then creating a new video with the frames. One thing I've noticed is that the image quality for the extracted frames isn't as good as the original video. Any chance you can add in a few options for jpg quality and/or an option to use png instead?

What I would really like to do is stitch together video, along with frames extracted (after they've been rearranged), and some more video, and not even be able to see any change in quality.

Thanks!

MJTSoftware avatar May 26 '15 15:05 MJTSoftware

That should be easy to add. Would you be able to share an input video and an extracted frame with artifacts so I can verify that the issue is actually addressed?

mmaitre314 avatar May 26 '15 19:05 mmaitre314

I guess it isn't so much that there are artifacts, it's that the coloring is different. Here is a video showing what I'm talking about. I suppose it could be possible that it isn't actually on your end and it is in "MediaClip.CreateFromImageFileAsync" that I'm using,

Example clip: http://1drv.ms/1RlsrlQ

When I just use all frames extracted using your solution it looks pretty great, and that is what I'm currently doing, but it uses more processing time that way.

MJTSoftware avatar May 26 '15 19:05 MJTSoftware

At least part of the issue lies in MediaReader as it ignores the extended color info carried by MF_MT_VIDEO_NOMINAL_RANGE / MF_MT_VIDEO_PRIMARIES / MF_MT_TRANSFER_FUNCTION / MF_MT_YUV_MATRIX / MF_MT_VIDEO_CHROMA_SITING. I can look into that (a bit more tricky to fix than just adding support for PNG). I'll also ask around if there are known issues around that in MediaComposition.

Just to paraphrase what you are trying to do:

  • open a video using MediaReader and extract frames to disk as Jpeg/Png/etc.
  • modify images
  • load images into MediaComposition and generate a new video.

mmaitre314 avatar May 27 '15 07:05 mmaitre314

Thanks. Yes that is basically it.

Right now when I'm generating the video at the end I'm using all extracted frames so you can't really tell the colors were adjusted. For the project I'm working right now that is OK, but I have an idea for another project and I'd really like to be able to combine parts of the original video with extracted frames without having to create the entire video from individual frames and not be able to tell the difference in color.

Thanks again!

MJTSoftware avatar May 27 '15 11:05 MJTSoftware

The other option that could work for what I'm trying to do would to create/find some MediaClip effect that reverses the video to make it play backwards and that also allows me to add the slow motion effect at the same time. I don't know anything about how to create MediaClip effects so I don't know if that is possible or not.

MJTSoftware avatar May 27 '15 12:05 MJTSoftware

Sorry, missed your last post. A couple of pointers about video effects:

It's not a great match for you play backward scenario though. The best I can think of on the top of my head would be to buffer the whole video in memory in the effect and then play it backward, which most likely will require more RAM than the device can provide. Unless maybe the effect saves all frames to disk and when done reads everything from disk.

mmaitre314 avatar Jun 08 '15 03:06 mmaitre314