Announcement: Our new CyberLink Feedback Forum has arrived! Please transfer to our new forum to provide your feedback or to start a new discussion. The content on this CyberLink Community forum is now read only, but will continue to be available as a user resource. Thanks!
CyberLink Community Forum
where the experts meet
| Advanced Search >
Any way to lossless encode YUV420?
mleise [Avatar]
Member Joined: Jan 31, 2014 05:43 Messages: 63 Offline
[Post New]
Why I am not using SVRT
I stopped using it, when I found that some Sony 50p material contains GOP structures that are unexpected to MkvMerge, a tool I use to merge chapters and styled subtitles into .mkv files. The result was that the frame times got messed up in SVRT regions of the output and the video stuttered badly.
In addition SVRT is disable for many reasons. It requires a clean section of the original video and audio, starts at the first key frame, and doesn't mix with material of different quality (bit rate, FPS). So the gain diminishes as we add white balance, clips from other cameras with a different FPS, cross-fades or even just music.

What I need to do
My graphics card and many TVs only accelerate H.264 up to level 4.1. That means my 50p production wont play at all, or have frame drops or a/v synchronization issues. So I decided to go with 25i (e.g. 25 FPS, but 50 fields per second), which is available at level 4.1.
Using adaptive interlacing technology like MBAFF, interlacing will only occur in frames or parts of frames with motion while e.g. titles will be encoded progressively. Now with PD12's encoder even at high bit rates, I got some flickering issues and I like to have more control over my encoding. So I plan to use PD12 to create lossless YUV420 video (50p) (in whatever codec) and then then free ffmpeg and x264 codec to reinterlace and encode, which results in a stable picture.

You should not encode interlaced
If I want to view it on most hardware decoders, I need to have level 4.1 at most. That means either downscale to 1280x720 or reduce the frame rate to 25. Since all video clips used in the video is 1080p and many TV screens are 1080p, I think that's a bad option quality wise. 25p on the other hand feels less fluid and it is even hard to visually track small objects. (I already complain about action movies in 24p! )
I do have bad memories of interlaced material looking really bad, but now we have hardware decoders with deinterlacers and to my surprise low motion Kent-Burns effects over photos looked the same in 25i and 50p. On the other hand 25p gave a slight stop-motion feel to them. (The video was interlaced with ffmpeg and x264.)

Lossless encodes in PD12?
So I found one lossless encoder in PD12. That is QuickTime, in "raw" mode. But that one outputs RGB and I would prefer to stay in the correct color space to avoid banding artifacts. Also the file size would be prohibitive compared to e.g. Lagarith. Next I tried hacking my profile.ini, where custom encoding profiles are stored, but I couldn't find a way to write lossless H.264 with PD12's encoder. So is it at all possible to output lossless YUV4:2:0 in PD to so the final encode with an external encoder?
BarryTheCrab
Senior Contributor Location: USA Joined: Nov 06, 2008 22:18 Messages: 6240 Offline
[Post New]
There are quite a few smarties here, I'm surprised this thread didn't get more attention.
I was going to suggest Quicktime, but you found it.
PowerDirector, as a 32-bit install, can access internal computer codecs and possibly make more AVI codecs accessible, such as DivX, but the 64-bit won't.
That is not an issue with PD, it's lack of 64-bit codecs.
I really hope I got that all correct, please inform me, oh Great Community members, if I erred. HP Envy Phoenix/4thGen i7-4770(4@3.4GHz~turbo>3.9)
Nvidia GTX 960(4GB)/16GB DDR3/
Canon Vixia HV30/HF-M40/HF-M41/HF-G20/Olympus E-PL5.
Tape capture using 6 VCR, TBC-1000, Elite BVP4+, Sony D8 camcorder with TBC.
https://www.facebook.com/BarryAFTT
mleise [Avatar]
Member Joined: Jan 31, 2014 05:43 Messages: 63 Offline
[Post New]
And indeed I'm using the 32-bit variant and it shows me ffdshow for AVI which in turn supports a lossless YUV codec! Excellent. Except... PD12 only allows 4:3 videos to be saved as Windows AVI and mine is 16:9. Too bad.
BarryTheCrab
Senior Contributor Location: USA Joined: Nov 06, 2008 22:18 Messages: 6240 Offline
[Post New]
I know the DivX encoder allowed full HD widescreen export from the timeline. I just don't really know about others, or how it interfaces. HP Envy Phoenix/4thGen i7-4770(4@3.4GHz~turbo>3.9)
Nvidia GTX 960(4GB)/16GB DDR3/
Canon Vixia HV30/HF-M40/HF-M41/HF-G20/Olympus E-PL5.
Tape capture using 6 VCR, TBC-1000, Elite BVP4+, Sony D8 camcorder with TBC.
https://www.facebook.com/BarryAFTT
jmone
Senior Contributor Location: Australia Joined: Nov 26, 2010 00:05 Messages: 706 Offline
[Post New]
I find the PDs AVC encoder has come a long way and are now very good for 50p material (and as you have found the GPU ones not so "reliable"). Couple of posts that may be of interest
- http://forum.cyberlink.com/forum/posts/list/30195.page (includes some info on modifying GOP structures in custom profiles and a remuxer if the container is the issue with compatibility rather than the encoded video stream itself)
- http://forum.cyberlink.com/forum/posts/list/29762.page (some test projects so you can see the impact of changes to your custom profiles)

Thanks
Nathan PD 64 Bit-Win10 64 Bit-32GB RAM-80TB HDD
Sony FX6 - 500Mbps 4k/50p AVC-I HLG
Canon XF400 - 150Mbps 4k/50p AVC
GoPro Hero6 Black
Pana HS700-28Mbps 1080/50p AVC (High@L4.2)
Canon HV20-HDV 25Mbps 16:9 1440x1080/25p MPEG
mleise [Avatar]
Member Joined: Jan 31, 2014 05:43 Messages: 63 Offline
[Post New]
Thanks for your input. I didn't use the GPU encoder, it was just the GPU playback that requires level 4.1 and cannot handle 50p material reliably. The original clips from the camera play fine. Those encoders don't exercise much of the H.264 standard and produce pretty light weight files. The regular 50p output from PD12 though is already encoded "too well" and causes stuttering during playback. But it is also about 45 GiB in size, which is fine for a double-layer BluRay, but I did get a confused look so I'd prefer to shrink it rather than replace B-frames with P-frames and shorter GOPs.
Also, since my gfx card driver clearly says "level 4.1", I think I should stick to that and not go over those limits and cross fingers.
As a bonus, it will likely be played by most HD TV sets as well, except for the .ASS subtitles.
In any case PD's (software) encoder produces high quality output for 50p as far as I can tell. I have never seen any encoding related errors. Only with GPU encoding or through SVRT copying unkosher GOPs from Sony's camera.
jmone
Senior Contributor Location: Australia Joined: Nov 26, 2010 00:05 Messages: 706 Offline
[Post New]
Must be an oldish/lowend GPU/CPU combo if it is dropping frames on with L4.2 material (even my mobile CPU/iGPUs are fine but they are all only a couple of years old). Normally it is interlaced material that is tougher as you have to first deinterlace then render at 50fps. The other option is, you could remove the P frames and reduce the bitrate to keep the file size down or replicate the settings you use in ffmpeg in the profile.ini

I am also not a fan of SVRT as from what I've seen it does not end up saving much time and the various parts of the output file could have different GOP/Bitrates etc.

What are the original clips encoded as? I would recommend creating a profile that matches those (presuming they play well).

This message was edited 1 time. Last update was at Jun 15. 2014 01:39

PD 64 Bit-Win10 64 Bit-32GB RAM-80TB HDD
Sony FX6 - 500Mbps 4k/50p AVC-I HLG
Canon XF400 - 150Mbps 4k/50p AVC
GoPro Hero6 Black
Pana HS700-28Mbps 1080/50p AVC (High@L4.2)
Canon HV20-HDV 25Mbps 16:9 1440x1080/25p MPEG
mleise [Avatar]
Member Joined: Jan 31, 2014 05:43 Messages: 63 Offline
[Post New]
It is a 6 year old notebook and the hardware handles interlaced material just fine, including reduction of stair case effects on edges and doubling the frame rate. That's all a piece of cake as long as it is level 4.1. The double amount of macro blocks per second in 50p is what eventually goes over the top.

The original clips were from a small Sony digital camera (50p), a small Canon digital camera (23.97p) and a Canon 5D Mark II (25p). I also added tons of photos and route animations. Enough said?

Anyways I hacked around in the profile.ini a little more and now I use a GOP of IPPPPPPPPPPPPPPPPPPPPPPPPPPPPP and 4x the maximum allowed bit rate. With these crazy settings, the H.264 encoder keeps almost all the texture and grain from the original clips where before I had strong blocking artifacts especially visible on asphalt and some loss of detail in slightly blurry parts.
Powered by JForum 2.1.8 © JForum Team