Page 1 of 1

Pixelated Distortion Rendered at Start of Clip

PostPosted: Mon Mar 06, 2017 10:42 pm
by John Montclair
Resolve 12.5.2.010
Source Media: MP4V, 59.94 fps, 1920x1080
Output: QuickTime H.264, 1920x1080, 29.97 fps, Quality: Best, Key Frames: Automatic, Frame reordering, Data Levels: Auto

Using ffmpeg, I converted and de-interlaced MTS files to MP4 using the highest available quality options. The footage edits quickly in Resolve.

However, I am picking up some pixelated distortion at whatever point I choose to cut in, in various clips. I see no distortion when viewing the entire clip in any media player, nor do I see it in Resolve's preview window (or whatever you call the left window).

I consistently get these distortions in the rendered product, and I also see them in the Inspector (right window) during editing. If I roll back and forth several times over the cut from the previous clip to the one exhibiting the problem, the distortion disappears during editing, however it always appears in the render.

I've tried turning on user caching and telling my render to use that (if that's what "Use optimized media" and / or "Use render cached images" means) and the problems persist.

Here they are at the top of the video at 2:30 and 2:38:
https://youtu.be/ZptcDzM5dKQ?t=2m30s

Any ideas on what's causing this and how to fix?

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Tue Mar 07, 2017 4:00 am
by Peter Chamberlain
can you provide links to the clips

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Tue Mar 07, 2017 1:25 pm
by John Montclair
The links are in the original post. The forum converted them to embedded video. Try these:
https://youtu.be/3p-m-ficIjc?t=2m30s
https://youtu.be/3p-m-ficIjc?t=2m49s


https://youtu.be/ZptcDzM5dKQ?t=2m30s

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Thu Mar 09, 2017 6:36 pm
by John Montclair
Whoops, I removed the videos accidentally. Here is a corrected link

https://youtu.be/ZptcDzM5dKQ?t=2m30s

Here are snapshots of the distortion first, and a few frames after:
Image
Image

Image
Image

Image
Image

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Fri Mar 17, 2017 3:52 pm
by John Montclair
Bump. Does anyone have any ideas on working around this or what's causing it?

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Fri Mar 17, 2017 4:09 pm
by Andrew Kolakowski
Does it show up on exported files?
It maybe only seeking issue (common with e.g. QT player and some h264 streams), so when you jump in the timeline it shows up, but when you play/export (or move cursor few frames) it won't.
Do it properly and export from ffmpeg ProRes/DNxHR which will work way better in Resolve.
Using h264 as working format (after processing some video) is a bad practice.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Fri Mar 17, 2017 4:43 pm
by Cary Knoop
John Montclair wrote:Bump. Does anyone have any ideas on working around this or what's causing it?

I get a 'this video has been removed' error.

Could you provide a few seconds of the original converted video as YouTube re-encodes it. I would guess it is a decoding error.

In the mean time you could try to encode the video with prores (use for instance -c:v prores_ks -profile:v 3) instead and see if that makes any difference.

Also I would strongly recommend you deinterlace using frame doubling to 60p.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Fri Mar 17, 2017 9:22 pm
by John Montclair
Andrew Kolakowski wrote:Does it show up on exported files?


Yes.

It maybe only seeking issue (common with e.g. QT player and some h264 streams), so when you jump in the timeline it shows up, but when you play/export (or move cursor few frames) it won't.


It's not the player. Happens in Resolve. See original post. I can roll over the cut several times and the problem will eventually disappear. If I move to another part of the project and work on that for a while, then go back, the problem reappears until I roll back and forth over the cut several times.

If I render the entire project, the glitches show up. If I render only the problematic sections after rolling back and forth over the cuts, I can get the render sections without glitches, but then I have to put them all back together again using FFMPEG to preserve the quality.

Do it properly and export from ffmpeg ProRes/DNxHR which will work way better in Resolve.
Using h264 as working format (after processing some video) is a bad practice.


I was trying to avoid that, but it looks like I may have to de-interlace the source video to a different format, as you suggest.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Fri Mar 17, 2017 9:26 pm
by John Montclair
Cary Knoop wrote:I get a 'this video has been removed' error.


It's here: https://youtu.be/ZptcDzM5dKQ?t=2m30s

Could you provide a few seconds of the original converted video as YouTube re-encodes it. I would guess it is a decoding error.


It's not that. It's a bug in Resolve. See above about rolling over the cuts repeatedly and the problem goes away for a while, but if I work on another part of the project it reappears. Always appears in rendered video, unless I render small sections at a time then paste them together with FFMPEG to preserve quality.

In the mean time you could try to encode the video with prores (use for instance -c:v prores_ks -profile:v 3) instead and see if that makes any difference.

Also I would strongly recommend you deinterlace using frame doubling to 60p.


I'm unfamiliar with how to do deinterlace using frame doubling. Could you elaborate? Thank you for the reply.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 6:57 am
by Cary Knoop
John Montclair wrote:I'm unfamiliar with how to do deinterlace using frame doubling. Could you elaborate? Thank you for the reply.

There are even better ways (vapour/avi synth with QTGMC) but ffmpeg can get you a long way with a yadif=1 filter.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 12:54 pm
by John Montclair
Cary Knoop wrote:
John Montclair wrote:There are even better ways (vapour/avi synth with QTGMC) but ffmpeg can get you a long way with a yadif=1 filter.

That's how this footage was de-interlaced (ffmpeg), so that's not the problem. :(

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 1:00 pm
by Andrew Kolakowski
John Montclair wrote:
Andrew Kolakowski wrote:Does it show up on exported files?


Yes.



That's strange, it shouldn't. Seeking issues with some x264 streams are known (depending on the decoder), but this is always just seeking. When you play or export file it shouldn't be there. This is why when you keep scrubbing/playing it will eventually disappear. If problem would be in the source file than it would not disappear, but show up every time in the problematic place (regardless of software).

Use ProRes or DNxHD or make h264 files more seeking friendly. Use less reference frame, shorter GOP (like 1sec), disable B frames etc. You can google for: x264 better seeking options.
Or use x264 with -g 1, which will make I frame only file. Just rise bitrate 2x to keep quality.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 3:30 pm
by Cary Knoop
John Montclair wrote:
Cary Knoop wrote:
John Montclair wrote:There are even better ways (vapour/avi synth with QTGMC) but ffmpeg can get you a long way with a yadif=1 filter.

That's how this footage was de-interlaced (ffmpeg), so that's not the problem. :(

You wrote the output format was:

Output: QuickTime H.264, 1920x1080, 29.97 fps, Quality: Best, Key Frames: Automatic, Frame reordering, Data Levels: Auto

29.97 is not frame doubled.

From the ffmpeg documentation:
Code: Select all
mode

    The interlacing mode to adopt. It accepts one of the following values:

    0, send_frame

        Output one frame for each frame.
    1, send_field

        Output one frame for each field.
    2, send_frame_nospatial

        Like send_frame, but it skips the spatial interlacing check.
    3, send_field_nospatial

        Like send_field, but it skips the spatial interlacing check.


Were you able to test something like: -c:v prores_ks -profile:v 3 to see if the problem goes away?

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 4:05 pm
by Andrew Kolakowski
Yep, yadif=1 will create 59.94p file out of 29.97i source.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 9:38 pm
by John Montclair
Cary Knoop wrote:29.97 is not frame doubled.

Those were my "Deliver" settings in Resolve, not the format for the source footage. I said this about the source footage: Source Media: MP4V, 59.94 fps, 1920x1080

Anyway, the source was de-interlaced with this ffmpeg command line:

ffmpeg -i whatever.mp4 -vf yadif=1 -c:a copy -vcodec copy C:\whatever_deinterlaced.mp4

Cary Knoop wrote:Were you able to test something like: -c:v prores_ks -profile:v 3 to see if the problem goes away?

Not yet. I just find it odd that Resolve can properly display the footage after I roll over it several times, then eventually when it's not cached by the OS and has to be physically read from the drive again later, it shows corruption, until the OS caches the file then disappears. I've also moved the source files to another drive to make sure the drive itself wasn't failing. In fact, Resolve will even show a frame or two of "Media Offline" until the file is cached by the OS again. It must be a bug in Resolve or the codec. IDK.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 10:07 pm
by Cary Knoop
John Montclair wrote:
Cary Knoop wrote:29.97 is not frame doubled.

Those were my "Deliver" settings in Resolve, not the format for the source footage. I said this about the source footage: Source Media: MP4V, 59.94 fps, 1920x1080

Anyway, the source was de-interlaced with this ffmpeg command line:

ffmpeg -i whatever.mp4 -vf yadif=1 -c:a copy -vcodec copy C:\whatever_deinterlaced.mp4

It's of course entirely up to you but why would you first deinterlace to 60p and then cut every other frame and deliver 30p?

John Montclair wrote:
Cary Knoop wrote:Were you able to test something like: -c:v prores_ks -profile:v 3 to see if the problem goes away?

Not yet. I just find it odd that Resolve can properly display the footage after I roll over it several times, then eventually when it's not cached by the OS and has to be physically read from the drive again later, it shows corruption, until the OS caches the file then disappears. I've also moved the source files to another drive to make sure the drive itself wasn't failing. In fact, Resolve will even show a frame or two of "Media Offline" until the file is cached by the OS again. It must be a bug in Resolve or the codec. IDK.

H.264 (unless all intra) is not an appropriate editing format, why not stick to a standard editing format?

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 10:46 pm
by John Montclair
The project is 30fps because I'm dealing with 60fps source mixed with 30fps source. I'm not converting it all to prores because I have limited disk space. I guess my point is that I've not had this problem with any other MTS video that I've converted this way previously.

I guess I'll just have to de-interlace the original source into something that resolve won't choke on for this particular project, but the programmers should be made aware that there is a problem with the software.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 11:04 pm
by John Montclair
To further illustrate the problem, here is a new edit based on client requests, which even shows "media offline" for several frames immediately following cut ins.

https://youtu.be/rYlsob0Gzws?t=45s
https://youtu.be/rYlsob0Gzws?t=2m21s

and the pixelated distortion starts here:
https://youtu.be/rYlsob0Gzws?t=1m56s

and here's even a freeze frame that is pixelated:
https://youtu.be/rYlsob0Gzws?t=2m25s

Very odd, indeed.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 18, 2017 11:50 pm
by Andrew Kolakowski
John Montclair wrote:The project is 30fps because I'm dealing with 60fps source mixed with 30fps source. I'm not converting it all to prores because I have limited disk space. I guess my point is that I've not had this problem with any other MTS video that I've converted this way previously.

I guess I'll just have to de-interlace the original source into something that resolve won't choke on for this particular project, but the programmers should be made aware that there is a problem with the software.


So far you are the only person to have such an issue?
There can be 100 reasons for this problem, including 99 unrelated to Resolve itself.

Can you post exact ffmpeg command?

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sun Mar 19, 2017 12:57 am
by Cary Knoop
John Montclair wrote:The project is 30fps because I'm dealing with 60fps source mixed with 30fps source.

I would double the 30fps instead of cutting the 60fps.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sun Mar 19, 2017 10:42 pm
by John Montclair
Andrew Kolakowski wrote:Can you post exact ffmpeg command?

I did, above.

At this point, I'm just going to convert the problematic sources to some other format as it seems whatever this is actually encoded in isn't Resolve friendly (the color panel clip thumbnails are showing them as MPEG4 video, and not H.264). Even the thumbnails show pixelation when it doesn't really exist.

Image
http://i.imgur.com/TaR3Lw0.png

Thanks for all the suggestions, guys. I appreciate it.

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sun Mar 19, 2017 11:23 pm
by Andrew Kolakowski
"ffmpeg -i whatever.mp4 -vf yadif=1 -c:a copy -vcodec copy C:\whatever_deinterlaced.mp4"

Such a command will throw an error as you can't use copy command for video with -vf, specially for thing like deinterlacing. You either process and encode or copy original video data. Both can't work together :)

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sun Mar 19, 2017 11:55 pm
by Cary Knoop
Also you would want to specify at least some encoding parameters to indicate what quality you need, for instance a -crf option and -g for all intra (recommended for editing).

Re: Pixelated Distortion Rendered at Start of Clip

PostPosted: Sat Mar 25, 2017 2:16 am
by John Montclair
Andrew Kolakowski wrote:"ffmpeg -i whatever.mp4 -vf yadif=1 -c:a copy -vcodec copy C:\whatever_deinterlaced.mp4"

Such a command will throw an error as you can't use copy command for video with -vf, specially for thing like deinterlacing. You either process and encode or copy original video data. Both can't work together :)


Hmmm... you are quite correct there. I copied the wrong command line. Here's what I used:

-vf yadif=1 -ca:copy -vcodec mpeg4 -f mp4 -y -q:v 0