Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th January 2023, 23:03   #61  |  Link
MaximRecoil
Registered User
 
Join Date: Feb 2004
Posts: 192
Quote:
Originally Posted by Sharc View Post
Yeah, still blocked. Maybe if you password-protect the ZIP file so that MediaFire can't detect what's in it.
MaximRecoil is offline   Reply With Quote
Old 19th January 2023, 00:01   #62  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
Let's try again with this very short sample.
https://www.mediafire.com/file/lwgdw...ample.zip/file
Sharc is offline   Reply With Quote
Old 19th January 2023, 01:12   #63  |  Link
MaximRecoil
Registered User
 
Join Date: Feb 2004
Posts: 192
Quote:
Originally Posted by Sharc View Post
Let's try again with this very short sample.
https://www.mediafire.com/file/lwgdw...ample.zip/file
Still blocked. They apparently have some algorithms that detect content. I suspect that the only way around it is to encrypt (password-protect) the .ZIP file. It's easy to do in 7-Zip.

Last edited by MaximRecoil; 19th January 2023 at 01:17.
MaximRecoil is offline   Reply With Quote
Old 19th January 2023, 10:58   #64  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
Sent you a PM.
Sharc is offline   Reply With Quote
Old 19th January 2023, 12:18   #65  |  Link
MaximRecoil
Registered User
 
Join Date: Feb 2004
Posts: 192
Quote:
Originally Posted by Sharc View Post
Sent you a PM.
Password-protecting it worked, not that it makes sense for their content-matching algorithm to care about an 8-second clip in the first place.

I can't figure out what's going on with the aspect ratio of it. When I open it on my PC in MPC-HC, it's 4:3 (it's 4:3 in VDub too), which is clearly the wrong aspect ratio, but when I play it on my BD player, it's 16:9, which is the correct aspect ratio. I've never seen that happen before, i.e., MPC-HC and my BD player have always agreed on the aspect ratio of any given video file. MediaInfo says:

Display aspect ratio: 4:3
Original display aspect ratio: 16:9

So MPC-HC must be going by the DAR and my BD player is going by the original DAR. I actually ran into an issue like that with YouTube. I have a camcorder that, in its lower quality modes, records at 1440x1080 with a 16:9 DAR, and when I re-encoded it for YouTube I resized it to 1920x1080 and cropped it to 1440x1080 (because I wanted it to be 4:3), and MPC-HC displayed it correctly, but YouTube screwed up the aspect ratio. In order to get rid of that "original display aspect ratio" that somehow remained even after a re-encode, and that YouTube insisted on using, I had to explicitly set the SAR to 1/1 when re-encoding, like this:

Code:
-vf "scale=1920x1080:flags=lanczos,crop=1440:1080,setsar=sar=1/1"
In any case, there's a little bit of judder during the camera pan (i.e., a little more than the baseline inherent amount). It's about the same amount of judder that's in my 1080i source files when played on my BD player.

What sort of telecining did you do to it? Was it --pulldown 32 without --fake-interlaced? Stepping through it in VDub, it looks no different than progressive video; all progressive frames, 23.976 of them per second, but MediaInfo says it's interlaced, bottom field first.
MaximRecoil is offline   Reply With Quote
Old 19th January 2023, 13:19   #66  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
Yep, sorry. I missed to flag it correctly (was probably a copy/paste leftover from a former script). Also, possibly a discrepancy between container and stream. Anyway, I set the SAR for the x264 encoding correct, hence a player which reads the AVC stream SAR or forces 16:9 playback should display it with the intended Aspect Ratio. I would have to check.
Process:
Original hard-telecined HD source -> IVTC'd -> resized and applied --pulldown 32 including --fake-interlaced as proposed for the x264 piping commandline. Finally the soft-telecined elementary .264 remuxed to .mp4. As I said I didn't pay much attention to aspect ratios for this experiment
I was just curious to learn whether you would still get the excessive and random judder which you reported for your test with --pulldown 32 and --fake-interlaced, interlacing artifacts etc. with this sample.

I am not sure whether containers other than .m2ts are supposed to support soft-telecined AVC at all. So just an experiment.

Edit:
The Asect Ratio ambiguity (4:3 flag) was introduced by the tool which I used to shorten (trim) the duration of the original testclip.

Edit2:
Aspect Ratio mess fixed. See your PM.

Last edited by Sharc; 19th January 2023 at 18:33.
Sharc is offline   Reply With Quote
Old 20th January 2023, 15:29   #67  |  Link
MaximRecoil
Registered User
 
Join Date: Feb 2004
Posts: 192
The MediaFire link for the two .7z files inside a .zip file worked.

The .m2ts and the .mkv look exactly the same on my BD player and they both have significantly more judder than the .mp4.

All three files have a very smooth looking camera pan when played in MPC-HC on my PC, which is connected to a CRT monitor set to 1152x864 with a 75 Hz refresh rate; as judder-free as is possible on a setup in which the monitor's refresh rate isn't perfectly synced to the video's frame rate or an exact multiple thereof. My plain IVTC'd encodes on my BD player are also as judder-free as possible. The only issues I have with those are the sawtooth and moire interlacing artifacts in certain scenes. The same BD player plays DVDs with hardly any sawtooth or moire effects, and my other devices that output a 480i video signal also do so with hardly any sawtooth or moire effects, such as various VHS VCRs, my WD Live TV hardware media player (even when playing my plain IVTC'd AVC files), and a couple of ATSC TV tuner boxes.

MediaInfo identifies your .m2ts and .mkv file as progressive, and the .mp4 version as interlaced, bottom field first. All three of them are 23.976 FPS.
MaximRecoil is offline   Reply With Quote
Old 20th January 2023, 17:09   #68  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
ok, thanks.

All files are soft-telecined which can be verified by inspecting the top_field_first and repeat_pict flags of the stream, which show the expected cadence for 2:3 pulldown, like top_field_first = 001100110011..... and the repeat_pict flags = 01010101...... Hence the player can output the fields accordingly at 59.94 fields per second through its interface to an NTSC TV or similar device. On a progressive monitor or PC the frames are displayed at 23.97 fps as you noticed, as there is no need for "pulldown" of fields.
Basically this is the same for all 3 files (in 3 different containers), and when you get different results it's due to the player handling the containers/formats differently. I have seen this here as well. I am still of the opinion that hard-telecine is more "robust" for AVC on various playback scenarios and containers, but is less efficient (bigger files) as we know.

Quote:
MediaInfo identifies your .m2ts and .mkv file as progressive, and the .mp4 version as interlaced, bottom field first.
Yes, I have seen this. Inspecting the stream however indicates that only 2 of the first 4 frames are flagged as interlaced (probably an editing effect, orphaned field or something), all the rest is progressive frames. So MediaInfo might have been fooled. When I re-did this .mp4 for fixing the AR issue MediaInfo reported it as progressive (with interlace=fake) as well.

Last edited by Sharc; 20th January 2023 at 17:13.
Sharc is offline   Reply With Quote
Old 21st January 2023, 09:57   #69  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
Regarding moire artifacts see also here:
https://forum.videohelp.com/threads/...Handling-moire
In Avisynth changing the IVTC algorithm or doing it manually helped, but I don't know how to do similar with ffmpeg.
It is also possible that the moire in your case was introduced by the sharp picture downscaling rather than by the IVTC or re-telecining.

Last edited by Sharc; 21st January 2023 at 10:05.
Sharc is offline   Reply With Quote
Old 21st January 2023, 12:06   #70  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
Here a new set based on your sample in post#15. Sorry, I missed your post.
https://mega.nz/file/PIsA1IKI#A1Us3d...dsNrVU0g0GQVTM

I wonder if AVC soft-telecine has ever been used for Blu-Rays.

Last edited by Sharc; 21st January 2023 at 16:02.
Sharc is offline   Reply With Quote
Old 21st January 2023, 19:35   #71  |  Link
MaximRecoil
Registered User
 
Join Date: Feb 2004
Posts: 192
Quote:
Originally Posted by Sharc View Post
Here a new set based on your sample in post#15. Sorry, I missed your post.
https://mega.nz/file/PIsA1IKI#A1Us3d...dsNrVU0g0GQVTM

I wonder if AVC soft-telecine has ever been used for Blu-Rays.
Thanks, but that was just a clip I provided for someone who asked to see an example of telecined AVC content with some horizontal movement. It's hard to tell anything from that clip in terms of judder or sawtooth & moire interlacing artifacts, because the camera isn't panning and there are no angled straight edges in it.

Here are the two scenes I've been using for reference (they are both from the same episode so they are both in a single video clip):

https://app.box.com/s/sdozvl0v3lu0nkgeyit03bgmboh9sek9

The first scene has a camera pan which is good for watching for judder, because it's easy to see by watching the edges of the picture frame on the wall and the lamp shade. The second scene is the car pulling into a driveway scene that I mentioned before. On my BD player there are prominent sawtooth interlacing artifacts on the car's chrome trim on its hood and top of the door when the car or camera is moving (or in the case of the soft-telecined / fake-interlaced / piped through x264.exe encode I did, the prominent sawtooth effect remained even when both the car and camera were stationary).

I didn't include the scenes which show a lot of moire on one of the actor's shirt collar, because I didn't want the clip to be too long. It's already 50 seconds long as it is.

By the way, this episode, along with all of the newer episodes starting in the late '80s, is 16:9, which annoys to me to no end, because they were originally broadcast in 4:3. At least they left the 1970s episodes (like in my clip from post #15) in the correct 4:3 aspect ratio. In any case, I've been letter-boxing the 16:9 ones (scale=704x360:flags=lanczos,pad=720:480:8:60,setsar=sar=10/11) instead of doing anamorphic 16:9 encodes, because anamorphic 16:9 has no benefit whatsoever over letter-boxed 4:3 on my type of TV, but they end up having a significantly bigger file size because you're encoding 704x480 picture information rather than 704x360 picture information.

Last edited by MaximRecoil; 21st January 2023 at 19:39.
MaximRecoil is offline   Reply With Quote
Old 21st January 2023, 23:19   #72  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
Quote:
Originally Posted by MaximRecoil View Post
On my BD player there are prominent sawtooth interlacing artifacts on the car's chrome trim on its hood and top of the door when the car or camera is moving ...
Yes, I see these artifacts as well on the PC when playing the IVTC'd downscaled clip. Without downscaling it looks ok. So it seems to be the scaling which is the culprit. Don't know an easy fix, other than in postprocessing.
For DVD footage you won't have this scaling effect, or much less as the original source is 720x480 only.

Last edited by Sharc; 21st January 2023 at 23:26.
Sharc is offline   Reply With Quote
Old 21st January 2023, 23:56   #73  |  Link
MaximRecoil
Registered User
 
Join Date: Feb 2004
Posts: 192
Quote:
Originally Posted by Sharc View Post
Yes, I see these artifacts as well on the PC when playing the IVTC'd downscaled clip. Without downscaling it looks ok. So it seems to be the scaling which is the culprit. Don't know an easy fix, other than in postprocessing.
For DVD footage you won't have this scaling effect, or much less as the original source is 720x480 only.
In Avisynth it's slighly better, but it's also there.
I only see very minor sawtooth effects on the car's chrome trim on my PC with my SD IVTC'd encodes; not anywhere near as prominent as on my BD player. They are very minor when played on my WD Live TV hardware player too (which outputs an analog 480i video signal to my CRT TV, the same as my BD player does). Minor effects like that are normal / to be expected; the problem is that my BD player exaggerates them quite a bit, and even more so with that piped-to-x264 encode that I tried.

And yeah, with the source file there are pretty much no sawtooth effects when played on my PC, but it does have some judder in panning scenes, which my IVTC'd encodes don't have. The source file also has the same prominent sawtooth effect as my plain IVTC'd encodes have when played on my BD player.

Film-source DVDs are normally scaled down from a 2K or 4K master (not counting early ones that used D-1 masters, which are 720x486). I wonder what type of scaling filter they use. I've been using Lanczos.

Last edited by MaximRecoil; 22nd January 2023 at 01:32.
MaximRecoil is offline   Reply With Quote
Old 22nd January 2023, 11:43   #74  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
Quote:
Originally Posted by MaximRecoil View Post
And yeah, with the source file there are pretty much no sawtooth effects when played on my PC, but it does have some judder in panning scenes, which my IVTC'd encodes don't have.
This is as expected and depends how your PC player decodes the video. With MPC-HC you have the choice:
For your hard-telecined source you will either see the 2:3 progressive sequence with the well known judder, or you see a sequence of 2 combed (interlaced) and 3 progressive frames.
The IVTC'd source is all progressive and basically judder-free with little remaining judder from the framerate (usually 23.976fps) and monitor refresh rate ratio not being an integer multiple.
For soft-telecined stuff it depends how the player handles the pulldown flags and outputs the fields on the 480i interface to your TV. The pulldown flags should be correct IMO for the samples which I provided.
As has been argued AVC soft-pulldown played via a BD player may only work for strict blu-ray compliant files, even burnt to a disc with the standard blu-ray structure rather than played from the USB stick in some container. I don't really know.

Quote:
Film-source DVDs are normally scaled down from a 2K or 4K master (not counting early ones that used D-1 masters, which are 720x486). I wonder what type of scaling filter they use. I've been using Lanczos.
I don't know how studios do it, but as I understand, downscaling will always have to be preceeded by low-pass filtering (softening the picture) in order to prevent aliases.

Last edited by Sharc; 22nd January 2023 at 11:51.
Sharc is offline   Reply With Quote
Old 22nd January 2023, 17:12   #75  |  Link
MaximRecoil
Registered User
 
Join Date: Feb 2004
Posts: 192
Quote:
Originally Posted by Sharc View Post
The IVTC'd source is all progressive and basically judder-free with little remaining judder from the framerate (usually 23.976fps) and monitor refresh rate ratio not being an integer multiple.
Yeah, that applies to playing it on a PC, but on my BD player when outputting 480i, the output isn't progressive, it's 59.94 fields per second (the only progressive video that my CRT TV is even capable syncing to is 240p, but I don't have a video player that can output 240p, only old video game consoles), but it's still as judder-free as playing them on my PC. I don't know the exact process it uses to convert 23.976 frames per second progressive video to 59.94 fields per second interlaced video on the fly, I just know that it has to do it, because NTSC video is inherently 59.94 fields per second (originally 60 fields per second before they revised the standard in 1953 to accommodate color).

Quote:
I don't know how studios do it, but as I understand, downscaling will always have to be preceeded by low-pass filtering (softening the picture) in order to prevent aliases.
That's interesting.

The down-scaling from HD to SD definitely has something to do with the sawtooth effect, but there's more to it than just that. Like I said, for some reason my BD player exaggerates it while my WD Live TV player doesn't. Also, on my BD player, the piped-to-x264 encode I did showed even worse sawtooth than my plain IVTC'd encodes, and that was down-scaled in exactly the same way, i.e., the down-scaling was done in FFmpeg using the same script as with my plain IVTC'd encodes.

If there were a method to down-scale without introducing any aliasing (or less aliasing at least), I wonder if that would eliminate the issue; the idea being that there would be nothing for the BD player to exaggerate in the first place. If I remember right, Lanczos, which I always use, has a bit of a sharpening effect, which would also increase its aliasing effect. I could try just plain bilinear scaling to see if that makes a difference.

Last edited by MaximRecoil; 22nd January 2023 at 17:56.
MaximRecoil is offline   Reply With Quote
Old 22nd January 2023, 18:00   #76  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
Quote:
Originally Posted by MaximRecoil View Post
I don't know the exact process it uses to convert 23.976 frames per second progressive video to 59.94 fields per second interlaced video on the fly, I just know that it has to do it, because NTSC video is inherently 59.94 fields per second ....
Manual page 22 "Cinema Conversion Mode" and "Output Video Format". It telecines the progressive film source, obviously. It just doesn't tell whether it telecines as 2:3 or 2:3:3:2 (which would have little more judder).
Attachments Pending Approval
File Type: png Screenshot 2023-01-22 175627.png

Last edited by Sharc; 22nd January 2023 at 18:28.
Sharc is offline   Reply With Quote
Old 22nd January 2023, 18:33   #77  |  Link
MaximRecoil
Registered User
 
Join Date: Feb 2004
Posts: 192
Quote:
Originally Posted by Sharc View Post
It telecines the progressive film source, obviously.
Yeah, I meant that I don't know what pulldown pattern it uses (e.g., 2:3 or 2:3:3:2), and I also don't know what it does differently with 23.976 FPS progressive video when set to "auto" (which it should detect as film-source) vs. set to "video," which the manual says will make it treat everything like video-source. I've tried both settings on my plain IVTC'd encodes, car/driveway scene, and I didn't see any difference at all.

By the way, I tried an encode with bilinear scaling instead of Lanczos and I didn't see a difference on my BD player.
MaximRecoil is offline   Reply With Quote
Old 22nd January 2023, 20:35   #78  |  Link
Sharc
Registered User
 
Join Date: May 2006
Posts: 3,952
Take a look here, e.g. the paragraphs 1080i Disc Playback and SD playback. It mentions jaggedness as well.
https://www.avforums.com/reviews/son...yer-review.54/
If it's true it detects pattern cadences, means it does not even (or not only) rely on flag reading. No idea what happens when there is a conflict between the flags and the player's cadence detection.
Or ask SONY what magic they applied ;-)

Quote:
By the way, I tried an encode with bilinear scaling instead of Lanczos and I didn't see a difference on my BD player.
About scaling artefacts and moiré:
http://www.glennchan.info/broadcast-...-artifacts.htm

In your example the jaggies become gradually annoying (viewed on PC) when I downscale (and upscale on the fly for viewing on PC monitor) the 1080 IVTC'd source to lower than about 640 vertically. In your case the downscaled active picture is 360 vertical only (1080->360).

Last edited by Sharc; 23rd January 2023 at 10:30.
Sharc is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 16:11.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.