View Full Version : Anamorphic encoding with Tsunami MPEG
Katie Boundary
14th April 2016, 21:28
I'm currently backing up some very large chunks of my DVD library to an external hard drive in the form of VCD-compliant MPEG-1. TMPEGEnc is my tool of choice for this task, but it's giving me a little snag. The problem is not that it can't handle anamorphic encoding; both my 352x240 NTSC shows and my 352x288 PAL shows are playing back at a 4:3 aspect ratio just as the gods intended. The problem instead is that everything plays back at 4:3, no matter what I flag it as. Even if I set the AR at 1:1 or 2.21:1, it plays back at 4:3.
As you might imagine, this is a big problem for all of my widescreen stuff.
I was wondering if anyone knew how to correct this problem.
manono
14th April 2016, 21:53
I was wondering if anyone knew how to correct this problem.
Add the right amount of black bars above and below.
You said you're making 'VCD-compliant MPEG-1' which, by definition, is 4:3. If you want to make MPGs, then you can set one of the other allowed DARs.
StainlessS
14th April 2016, 22:12
I tried with TmpGenc and results (although MediaInfo said they were 16:9) were more like slightly taller than 16:10.
I used to make pretty much all of my SVCD encodes out of spec and they always worked Ok, at least on desktop/laptop
computers using PowerDVD, (maybe not in SVCD hardware).
You could try HCEnc (Mpeg2), at 480x480 (352x576 in PAL land) and 16:9, then mux to SVCD using TmpGenc (TmpGenc Audio or other audio encoder).
I just encoded a 480x480 HCEnc, not problem at all to VLC or MPC-HC, both 16:9 playing.
Sharc
15th April 2016, 10:22
VCD / mpeg-1 compliant settings for anamorphic DVD sources with Tsunami TmpgEnc:
Settings => Advanced => Source Aspect Ration 16:9 (PAL or NTSC respectively)
Video Arrange Method: Full Screen (keep aspect ratio)
DAR will be 4:3, but resized to 1:1 PAR (undistorted) for VCD compliance.
I don't think that anything else (anamorphic, 16:9) would be VCD compliant (?).
Edit:
When you however accept mpeg-2, you could do 16:9 anamorphic encoding with TMPGEnc:
Load => unlock.mcf from the Template\Extra folder
Setting => Tab Video: Stream type: MPEG-2 video (you could even select MPEG-1, but then the DAR becomes something like 1.738 which shouldn't really matter, as it is in the order of the "2% ITU vs Generic" debate)
Aspect Ratio: 16:9 Display
Setting => Tab Advanced: Source Aspect Ratio: 16:9 (PAL ..... NTSC)
Video Arrange Method: Full screen (Keep Aspect Ratio)
You will get an anamorph 16:9 encode which you can play with a DVD player. It is however not VCD/mpeg-1 compliant.
Katie Boundary
15th April 2016, 20:49
You said you're making 'VCD-compliant MPEG-1' which, by definition, is 4:3. If you want to make MPGs, then you can set one of the other allowed DARs.
Well then why does Tsunami allow ALL aspect ratios in its VCD wizard? What is this option even supposed to affect?
Sharc
15th April 2016, 21:47
Picture (movie) aspect ratio and Display Aspect Ratio (4:3 or 16:9) have different meanings, which manifests in black borders to accommodate the picture in either 4:3 (VCD) or 16:9.
Sharc
16th April 2016, 09:05
I'm currently backing up some very large chunks of my DVD library to an external hard drive in the form of VCD-compliant MPEG-1.
...
May I ask why backing up to the ancient VCD/mpeg-1 format? You'll be loosing a lot of quality (sharpness, resolution). You could back up your DVD's to AVC or HEVC at about similar bitrate (file size) but much better quality.
Just wondering .....
TheSkiller
16th April 2016, 11:12
While you can encode MPEG1 for VCD with a DAR flag of 16:9 instead of 4:3, this isn't going to be honored by many players because they blindly assume 4:3 for CIF resolutions (that's the standard) when playing a physical VCD.
1:1 or 2.21:1 DARs are likely not going to work in any player.
Simply playing a VCD compliant MPG file off a hard drive is a different story however.
But since you are backing up to a hard drive rather than a physical VCD, why stick with VCD standards?!
Now I would call myself rather old-fashioned when it comes to these things but even I don't understand why anyone would be eager to backup their DVD collection to VCD (be it on a hard drive or a CD). It's not 2003.
In my opinion anything but a 1:1 copy to DVD DL or DVD5 is a waste of time, unless you absolutely do not want to backup to a disc but a hard drive and are willing to invest some time in re-encoding to a more efficient codec.
Katie Boundary
17th April 2016, 17:20
Picture (movie) aspect ratio and Display Aspect Ratio (4:3 or 16:9) have different meanings, which manifests in black borders to accommodate the picture in either 4:3 (VCD) or 16:9.
That doesn't answer the question.
May I ask why backing up to the ancient VCD/mpeg-1 format?
But since you are backing up to a hard drive rather than a physical VCD, why stick with VCD standards?!
Why do you f***ing care? Maybe all my friends are inferior Mac peasants who can't be bothered to download new players and codecs. Maybe conforming to totally arbitrary and ancient standards gives me a girl-boner. Maybe the voices in my head are threatening to resurrect Hitler unless I sacrifice my DVD collection to the MPEG-1 gods. What matters is can VCD-compliant MPEG-1 be flagged to play back at anamorphic 16:9, and if not, what the hell does the "source aspect ratio" option in Tsunami actually do?
The people on these forums have such a hard time staying on point...
Sharc
17th April 2016, 18:47
Why do you f***ing care? ......[/I]?
Because I concluded that you were probably incapable to follow the step-by-step instructions which I gave you in response of your question about Tsunami. So I thought I would mention an alternative option. Never mind.
manono
17th April 2016, 21:03
Well then why does Tsunami allow ALL aspect ratios in its VCD wizard? What is this option even supposed to affect?
Don't know, don't use it. Maybe they're accommodating out-of-spec VCDs. They have good tech support. Why not ask them?
However, since it's an easy matter to find out that only a single 4:3 DAR is allowed for VCD, I don't know why you're pushing your luck if you're really making 'VCD-compliant MPEG-1' videos.
Katie Boundary
17th April 2016, 21:05
Because I concluded that you were probably incapable to follow the step-by-step instructions which I gave you in response of your question about Tsunami.
Oh, I forgot to mention: those instructions didn't have the intended effect. They just scrunched the video down to 352x180 and then added black borders at the top and bottom.
EDIT: I was able to wipe out "Wizard" mode by selecting "New Project". This unlocked the ability to set the video aspect ratio AND source aspect ratio, not just the latter. After this, I was able to get the results that I wanted. YAY! This thread can now be closed.
manono
17th April 2016, 21:10
Oh, I forgot to mention: those instructions didn't have the intended effect. They just scrunched the video down to 352x180 and then added black borders at the top and bottom.
If the intended effect was to be able to put a widescreen film on a 4:3 VCD with the correct aspect ratio, then I think it did have the intended effect.
Katie Boundary
17th April 2016, 21:31
If the intended effect was to be able to put a widescreen film on a 4:3 VCD with the correct aspect ratio, then I think it did have the intended effect.
The intended effect was to create a VCD-compliant MPEG-1 file that would play back at a 16:9 aspect ratio, not a 4:3 AR with letterboxing. But it doesn't matter anymore. I figured out how to get the results that I wanted.
EDIT: I spoke too soon. It looks like I'm actually getting almost-but-not-quite 16:9 playback. If I had to guess, I'd say it's about 1.73827:1 (or 16/9 * 352/360). Screwing with the SAR and "positionning method" isn't helping much. I'll take manono's advice and ask Pegasys directly about the issue.
hello_hello
18th April 2016, 04:42
Maybe all my friends are inferior Mac peasants who can't be bothered to download new players and codecs. Maybe conforming to totally arbitrary and ancient standards gives me a girl-boner. Maybe the voices in my head are threatening to resurrect Hitler unless I sacrifice my DVD collection to the MPEG-1 gods.
Well that would at least explain it. Obviously there's hardly likely to be a rational reason.
The intended effect was to create a VCD-compliant MPEG-1 file that would play back at a 16:9 aspect ratio, not a 4:3 AR with letterboxing. But it doesn't matter anymore. I figured out how to get the results that I wanted.
You've already been told 16:9 isn't VCD compliant.
https://en.wikipedia.org/wiki/Video_CD#Video
Sharc
18th April 2016, 13:04
..... I spoke too soon. It looks like I'm actually getting almost-but-not-quite 16:9 playback. If I had to guess, I'd say it's about 1.73827:1 (or 16/9 * 352/360). Screwing with the SAR and "positionning method" isn't helping much. I'll take manono's advice and ask Pegasys directly about the issue.
In Tsunami set the "Source aspect ratio" to "16:9 Display" (rather than any of the 16:9 xxx.line PAL or NTSC) and you should never get more than 2.3% error, whether your DVD is 16:9 ITU or 16:9 Generic.
(You would likely get the same error if you play ITU DVDs via digital (HDMI) infrastructure anyway).
For ITU sources you could still try to force the player to 16:9 which should compensate the error. For Generic sources this shouldn't be necessary as they will play undistorted (circle test). Players may react differently on the non-standard VCD/mpeg-1 stream though. Hence no warranty for the above. As DVD's won't tell whether they are ITU or Generic PAR conformant, the small 2.3% error is imminent and it's recognition and elimination left to "educated guesses".
Katie Boundary
18th April 2016, 19:34
You've already been told 16:9 isn't VCD compliant.
https://en.wikipedia.org/wiki/Video_CD#Video
I've decided to allow this one deviation from the specifications.
ITU
https://www.google.com/search?client=opera&q=itu&sourceid=opera&ie=UTF-8&oe=UTF-8
?
Sharc
18th April 2016, 21:30
ITU: International Telecom Union, a body developing standards on Telecom, IT, Broadcast, Video (e.g. h.xxx series), etc.
They defined Pixel-and-other AspectRatios for digital video. Their PixelAspectRatios differ slightly from those developed by other bodies (all well justified, of course). Doom9 is full of discussions about it. The small differences are normally not annoying, but may be the reason why you don't get exactly 16:9 with Tsunami but 2.3% less, that's why I thought to mention it. 352 VCD width is half of 704 rather than 720, so the downsize to VCD inevitably changes the PixelAspectRatio (PAR) of 720 footage slightly, as the vertical resizing is exactly half of the original DVD source.
EDIT:
Let's make an example:
Assuming your NTSC DVD is 720x480 and has no left and right black borders.
=> It's PAR is most probably "Generic" (best guess!), means 32/27 = 1.185185.....
Tsunami resizes it to VCD = 352x240 => the PAR of the VCD encoded stream becomes now 1.185185x720x240/480/352=1.212121.....
Because this new PAR is not getting signaled to the player via the VCD stream, the player is not aware of it and plays the video back "generic", means it stretches the width to 1.185185x352=417.185
=> The displayed picture width/hight ratio therefore becomes 417.185/240 = 1.73827 which is exactly what you got (2.3% error).
Not much Tsunami can do about it. But you could possibly force the player (via setting) to play it exactly as 16:9, otherwise just leave it with this small 2.3% error. No one will complain, I guess.
Katie Boundary
18th April 2016, 23:47
So it's VLC's fault for not correctly recognizing a certain flag in the MPG file? Playing it back with a different player will fix the problem?
(for the record, resizing to 352x240 is done in AVIsynth to give me maximum control over which filter is used)
Sharc
19th April 2016, 08:27
So it's VLC's fault for not correctly recognizing a certain flag in the MPG file? Playing it back with a different player will fix the problem?
(for the record, resizing to 352x240 is done in AVIsynth to give me maximum control over which filter is used)
No, the player is ok and works as it is supposed to.
In your scenario there are various issues:
1. The DVD does not contain any information about which PAR has been used. PAR info would be essential for proper resizing and playback.
(But why should it? The DVDs are not made for postprocessing, but just to put the disc into a DVD player and play it, 4:3 or 16:9. Full stop.).
The question about the DVD PAR is however a general issue and not specific to your application. Tons of posts about it in Doom9.
2. If you resize (e.g. for VCD), you should either do it in such a way that the original PAR is not changed, or signal the new PAR to the player (and preferably stick to standards for the new PAR). VCD has no such option for signalling the PAR. It does not even support anamorph pictures. You are therefore lucky when it somehow works.
3. You wrote that you do the anamorph resizing external to Tsunami. You should then preserve the PAR of the original, means resize and add borders accordingly.
In my NTSC example (previous post) you would have to resize to 352x235 and add top+bottom borders of total 5 pixels. Technically you would probably resize to 352x236 and add 2 pixels on top & bottom each, or 4 pixels at either top or bottom, so your frame becomes 352x240 NTSC VCD compliant. A lot of pain to avoid the 2.3% error.
(Btw., Tsunami is smart enough to add the top/bottom borders automatically when you select "16:9 Display" as Source aspect ratio)
4. Finally, keep in mind that anamporph 16:9 is beyond the VCD standard, and how it plays exactly depends on playback infrastructure.
The .mpg file should play correctly on any SW player (VLC, MPC-HC) from your HDD, as the stream is flagged correctly as 16:9. I wouldn't care about any residual aspect ratio error as long as it plays "almost perfect". I am however not sure what's going to happen when you author a real VCD disc (using VCDgear for example + Burner).
Stereodude
19th April 2016, 17:55
http://i.imgur.com/q9uxuOF.jpg
Katie Boundary
19th April 2016, 20:19
The question about the DVD PAR is however a general issue and not specific to your application.
Specific? I'm not sure that it's even relevant. Such information would have most likely been stripped out at some point in the frameserving process; even DGIndex doesn't seem to GAF about any aspect ratios other than the SAR.
2. If you resize (e.g. for VCD), you should either do it in such a way that the original PAR is not changed, or signal the new PAR to the player (and preferably stick to standards for the new PAR). VCD has no such option for signalling the PAR. It does not even support anamorph pictures. You are therefore lucky when it somehow works.
For the record, I'm not actually burning any VCDs. I'm just backing stuff up in 29.97 (or 23.976) FPS, 352x240 pixel, 1150 kbps video, 224 kbps audio, blahblahblah anamorphic MPEG-1.
Also for the record, VCD DOES support anamorphic encoding... it stores 4:3 pictures anamorphically at 22:15 :)
3. You wrote that you do the anamorph resizing external to Tsunami. You should then preserve the PAR of the original, means resize and add borders accordingly. In my NTSC example (previous post) you would have to resize to 352x235 and add top+bottom borders of total 5 pixels. Technically you would probably resize to 352x236 and add 2 pixels on top & bottom each, or 4 pixels at either top or bottom, so your frame becomes 352x240 NTSC VCD compliant. A lot of pain to avoid the 2.3% error.
It doesn't really avoid the error, though... it just expands the error from the left and right to all four sides (if you're watching on a 16:9 display, anyway). This is little better in my opinion than cropping 8 pixels from the left and right sides each before resizing to 352x240. I admit, however, that it's a better solution than resizing to 352x180 and adding 30 pixels to the top and bottom.
The .mpg file should play correctly on any SW player (VLC, MPC-HC) from your HDD, as the stream is flagged correctly as 16:9. I wouldn't care about any residual aspect ratio error as long as it plays "almost perfect".
I do not consider "correct" to be synonymous with "almost perfect". However, it doesn't matter at this point. Either Pegasys will tell me how to get 352x240 MPEG-1 to force players to play it back at exactly 16:9, or I will accept the incorrect DAR of 1.73827:1
I am however not sure what's going to happen when you author a real VCD
"When"? LOL.
Sharc
19th April 2016, 22:52
It doesn't really avoid the error, though... it just expands the error from the left and right to all four sides (if you're watching on a 16:9 display, anyway). This is little better in my opinion than cropping 8 pixels from the left and right sides each before resizing to 352x240.
I prefer not to crop into the picture (but that's a matter of preference).
Playback is perfect here: Active picture = 16:9 exact (measured with ruler). A circle in the original is an exact circle at playback. But including the top+bottom borders it becomes 1.738 overall of course.
(Same result b.t.w. as setting Source Aspect Ratio "16:9 Display" in TMPGEnc).
I wonder what Pegasys is going to advise you......
Katie Boundary
19th April 2016, 23:15
I prefer not to crop into the picture (but that's a matter of preference).
When choosing the lesser of two or more evils, almost everything becomes a matter of preference. :)
Playback is perfect here: Active picture = 16:9 exact (measured with ruler). A circle in the original is an exact circle at playback.
Yes. You get the same effect from cropping the left and right edges prior to resizing, which is why I drew the comparison.
But including the top+bottom borders it becomes 1.738 overall of course.
Well, I didn't see that coming :rolleyes:
Sharc
19th April 2016, 23:21
So what's the problem after all? All set, I think.
Katie Boundary
20th April 2016, 00:11
So what's the problem after all?
The problem is that i'm still forced to choose between:
(a) Perfect VCD-compliance and perfect passage of the circle test, but a lot of wasted resolution and HUGE black borders on all 4 sides when played back on a 16:9 screen;
(b) perfect passage of the circle test, but imperfect VCD compliance, a little bit of wasted resolution, and modest black borders on all 4 sides when played back on a 16:9 screen;
and
(c) NO wasted resolution, but imperfect VCD compliance, slight failure of the circle test, and modest black borders only at the sides when played back on a 16:9 screen, with the latter 2 problems correctable by manually adjusting VLC's settings.
So far, (c) seems to be the least bad of the options, but we'll see what Pegasys has to say.
Sharc
20th April 2016, 05:16
Welcome to the world of converting between different standards:D
Katie Boundary
20th April 2016, 05:26
Welcome to the world of converting between different standards:D
You say that as if I hadn't already been introduced to the wonderful world of "why the hell is this file skipping one frame per second after I applied standard IVTC protocol to War Planets?" a decade ago... :D
Sharc
21st April 2016, 20:05
I found some time to check the mpeg-1 standard. It explains your "problem" perfectly:
Mpeg-1 Sequence header:
1. mpeg-1 does NOT define a DAR (DisplayAspectRatio) flag. It supports PAR (PixelAspectRatio) flags instead. The PAR in the mpeg-1 standard is defined as height/width of an mpeg-1 pixel.
2. The Code for "NTSC 16:9" is "6", which defines the PAR value as 0.8437. Means pixel width/hight = 1/0.8437 = 1.1853.
3. There exist no other PAR for "16:9 NTSC" in mpeg-1. This means that irrespective of the source PAR (PixelAspectRatio) and irrespective of your resizing or zooming, Tsunami TMPGEnc has no other choice than selecting code "6". Means it will always write code "6" into the Sequence Header whenever you specify "16:9 NTSC" as source. It also means that TMPGEnc behaves correctly. It follows the standard.
Playback:
4. At playback, the player (VLC, MPC-HC) reads code "6" in the header and therefore stretches the width by 1.1853. Means the DAR will become 1.1853x352/240 = 1.7384.
Mpeg-1 has no provision to signal a 16:9 DAR. Therefore it cannot force a player to 16:9 DAR.
5. This will leave you with the AR distortion of 2.3% (as discussed before) for an NTSC 16:9 source with a generic pixel aspect ratio of 1.185.... (the majority of DVDs)
6. To correct this, you have the 3 choices as discussed before (nothing new here, just to confirm):
6.1 Force the player manually to 16:9, (a HW-player+TV might even do this per default or setting).
6.2 Crop into the 720 picture 8 pixels left and right. It will change the movie (picture) aspect ratio but preserve the PAR, and you loose what you cropped off.
6.3 Resize to 352x236 and add 4 pixel border(s) total on top+bottom. You preserve the PAR and the Picture (movie) Aspect Ratio, you don't loose anything from the original picture, but get small borders on a 16:9 monitor on all 4 sides.
So nothing wrong with Tsunami TMPGenc or the player, after all. They all do what they are supposed to, according to the mpeg-1 standard. Mpeg-1 doesn't support DAR signalling. That's the main point. On the positive you have 3 options how to solve the issue. 3 is better than none :D
I don't think that Pegasys would tell you something different (?).
(Note: mpeg-2 has introduced the DAR signalling 3:4 or 16:9, hence you wouldn't get the same "problem" as with mpeg-1, but I understood you don't want mpeg-2).
Katie Boundary
22nd April 2016, 06:01
I found some time to check the mpeg-1 standard. It explains your "problem" perfectly:
Mpeg-1 Sequence header:
1. mpeg-1 does NOT define a DAR (DisplayAspectRatio) flag. It supports PAR (PixelAspectRatio) flags instead.
Wow, thanks!
The rest of your post was kind of unnecessary, but it's good to know that you're thorough :)
Sharc
22nd April 2016, 10:48
...The rest of your post was kind of unnecessary, but it's good to know that you're thorough :)
Oh, not quite. I forgot to add:
For a 16:9 NTSC DVD with ITU PAR (typically those with 704 active picture width and 8 pixel borders left and right each), you could:
a) crop the 2x8 borders off, encode to mpeg-1 and force the player to 16:9 at playback => fullscreen, undistorted circles
b) crop the 2x8 borders off, resize to 352*234 and add 6 pixel borders total top+bottom, encode to mpeg-1 => undistorted playback (without forcing 16:9) but with small borders on all 4 sides.
.... and so on for PAL DVDs ....... :)
EDIT:
I added this to recall that mpeg-1 defines only one PAR (the "generic" PAR), while DVDs can use either the "generic" PAR or the "ITU-R BT601" PAR. Hence cropping/resizing/adding borders to achieve the desired playback format precisely when converting from DVD to e.g. VCD resolution depends on the PAR of the DVD source, which, unfortunately, is a matter of educated guess and a source for confusion.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.