Convertin videos to H264 mp4 in MeGUI ?

Discuss technical and geeky things here.
Post Reply
furransu
Posts: 2289
Joined: Mar 12th, '04, 15:51

Convertin videos to H264 mp4 in MeGUI ?

Post by furransu » Jan 29th, '11, 10:47

Anyone know how to convert videos to H264 in MeGUI?

I'm trying to convert a 720p DivX video to h264 so the size is smaller.. but dont know the best settings for it :)

User avatar
XrayMind
Global Moderator
Global Moderator
Posts: 524
Joined: May 2nd, '04, 20:33
Location: Land of the Sub-Prime

Post by XrayMind » Jan 30th, '11, 00:48

I am using the development version of MeGUI and one of the profiles that it has is DixV HD Plus. The problem with that profile is that it's a single pass encoding, so the more action, daytime, and scene changes, the bigger the encoded file gets. The reverse is also true, the more talking head, night time(dark), and less scene changes, the smaller the video file.

But from mucking around MeGUI for a while, I found the best is to use any of higher level, 2 pass profiles. For 1280x720p video, the 2 pass profile that use level 3.1 to 4.1 are the best. The 2 pass for AVCHD/PS3/Xbox360 are good profiles to use. I have tried using bitrates from 1,500k to 3,000kbps with ~2,000kbps for most of my 1280x720p video. But I have gotten away with 1,00kbps or less, because I select the wrong filesize in MeGUI.

BTW, I have try to unrestricted DXVA(different from DivX) 2 pass encoding in couple of my BEGIN Japanology x264 encodes and with resolving video files tag as level 5.1 and someone with a slower computer or a media player that doesn't support level 5.1 having problem watching the video.

http://en.wikipedia.org/wiki/H.264/MPEG-4_AVC#Levels

Here's the chart from h.264 levels. Please note, as I mention early level 3.1 to 4.1 are the one supporting 1280x720p. The MeGUI 2 pass profiles for AVCDH/PS/Xbox360 default to level 4.1. That's why you then to see lot of MP4 raw encode in level 4.1.

I personally had modify those profiles and drop the level to 3.1 and the resulting file quality is about the same to me, but this allow more lower spec media players to play the video files.
Please do not PM me about seeding any of my old torrents, as most of files that had uploaded are no longer on my computer.

furransu
Posts: 2289
Joined: Mar 12th, '04, 15:51

Post by furransu » Jan 30th, '11, 01:39

xraymind, i tried encoding a video last night, the encoded video looks and plays fine, except that seeking is VERY slow!

when I seek to, say the 2nd minute, the video would stop, then move few frames by few frames from the start to the seeked frame... do you know what's wrong with this?

my settings are: x264 Unrestricted, Const quality at 22. that's all.

User avatar
XrayMind
Global Moderator
Global Moderator
Posts: 524
Joined: May 2nd, '04, 20:33
Location: Land of the Sub-Prime

Post by XrayMind » Jan 30th, '11, 03:30

That's problem being unrestricted, meaning it will use whatever the data rate it needs to encode the section of video it encoding. So while some section will be low data rate, like I mention in the previous post, the black, talking head, and non-action scenes. The lot of action, daytime, and lot of scene changes will use "unrestricted" data rate to encode that section of the video.

I just did a test encode for a 10 sec video using that profile, never use it before as I don't normally use any single pass encoding profile, and the resulting video file is reported to be level 3.1 by MediaInfo. But I think the actual data rate is way higher than level 3.1. Which is why it causing to my media player(MPC) to having a hard time seek the video when I select different section of it. The video is being render through my Nvidia graphic card, which doesn't have any issue with level 5.1 video.

You should do what I do, create a custom profile based on the Unrestricted(DXVA) 2 pass. I change the AVC level from Unrestricted to 3.1 or if you like to 4.1. Set the data rate to be 1500, if you want the file size to come out small. You can always overwrite the date rate when you encode the individual file later on.
Please do not PM me about seeding any of my old torrents, as most of files that had uploaded are no longer on my computer.

furransu
Posts: 2289
Joined: Mar 12th, '04, 15:51

Post by furransu » Jan 30th, '11, 05:10

actually I dont see Unrestricited (DXVA) 2 Pass profile.

all i see is x264: Unrestricted.. im using the latest version of MeGUI and Tx264

is it fine if i select Const Quality instead of 2 Pass as the encode mode?

User avatar
XrayMind
Global Moderator
Global Moderator
Posts: 524
Joined: May 2nd, '04, 20:33
Location: Land of the Sub-Prime

Post by XrayMind » Jan 31st, '11, 00:59

As I posted earlier, I am using the development version of MeGUI and not the stable version, so I guess dev version has more profiles. It's a choose of speed, file size, and quality when you want to encode in Const Quality(single/1 pass) or 2 pass.

Here are the pros and cons of Target/Const Quality or single pass encoding.
+speed Most raw files were encode in 1 pass. Because the capper in Japan release multiple programs at the same time. Same reason they choose Divx over XviD, because the single pass encoding in DivX is better.
-file size Mention early, unpredictable file size. Depend on the scene in the video
~quality While I posted neutral here, my personal feeling give a minus. The higher the Const Quality give better quality but it will raise birtrate(file size).

Here is th pros and cons of 2 pass.
-speed Take up twice long as single pass. Actually 1st pass is run bit faster, known as turbo in XviD. The 1st pass log all of the scene complexities and changes. So the adjust the bit rate for each section of the video for the actual encode on the 2nd pass.
+file size A predictable file size. Whether you choose fixed file size or bit rate, MeGUI will tell you the other resulting bit rate or file size(the one you didn't choose). Remember this bit rate is the over all bit rate for the whole video file.
~quality Again posted neutral, personally give plus. Because of the 1st pass log, the 2nd pass will use lower bit rate for scenes that are dark, low complexity, and/or with no/slow changes.

Again, I see that raw files for Anime and Jdramas are all encoded in single pass and fansub release later on in 2 pass fix file size(bit rate). The same thing happens in broadcast video, most pre-recorded HD programs are encode 2 pass, while live HD(mainly sports) has to be encoded and broadcast out. Can't really wait for the 2nd pass. DVD/Bluray are all encode in 2 pass, since you fixed file size of the disc space.

So if you have to use a single pass encoding. I would modify either AVCHD/PS3/Xbox 2 pass profiles, switch the 'Auto 2pass' to 'Const. Quality', and if you want, drop the AVC Level to 3.1. Since 3.1 suppose to use a lower bit rate than 4.1.
Please do not PM me about seeding any of my old torrents, as most of files that had uploaded are no longer on my computer.

furransu
Posts: 2289
Joined: Mar 12th, '04, 15:51

Post by furransu » Mar 10th, '11, 23:23

XrayMind, I need your help :)

I downloaded Misaki Number 1 ep9 raw and it's 31.38 fps which is unusual... when i downconverted it with megui it converted the fps to 25.. which caused audio sync issues.. what can I do to fix this? :)

User avatar
XrayMind
Global Moderator
Global Moderator
Posts: 524
Joined: May 2nd, '04, 20:33
Location: Land of the Sub-Prime

Post by XrayMind » Mar 11th, '11, 03:22

1st, do you use the AVS Script Creator(Ctlr-r) under to the Tools menu in MeGUI? Or do you just drag and drop your video file into the "AviSynth Script" source box?

Anyway, I assume you use the script creator, because you are using the resize and maybe crop feature in the creator. After you drag/drop a video file(mp4/mkv/avi, but not mpeg2) in to "Video Input" box, click on the "Filters" tab, the frame rate of the video is display in the AVI Source / DSSource tab. My sample file said it's 59.94, so just adjust the FPS to 29.97.

BTW, for down resizing, I find the Spline36 filter to be the best. Most people like Spline64, because it gives a sharper image. Just google how Spline compares to the other filters.
Please do not PM me about seeding any of my old torrents, as most of files that had uploaded are no longer on my computer.

furransu
Posts: 2289
Joined: Mar 12th, '04, 15:51

Post by furransu » Mar 11th, '11, 05:16

Hi xraymind

I have an avs file that i use for every encodes i do, this is the script i use:
Directshowsource("file.mp4", audio=false)
Spline64resize(704,396)
Converttoyv12()

So for video inputs, i just select this avs file with filename changed.

What do i need to change in the script? Since the source is 31.38 fps if the fps is brought down to 29.97, wont that cause audio out of sync issues?

User avatar
XrayMind
Global Moderator
Global Moderator
Posts: 524
Joined: May 2nd, '04, 20:33
Location: Land of the Sub-Prime

Post by XrayMind » Mar 11th, '11, 07:51

You can use the 'convertfps' to change the frame rate. Either by add new line at the end like this:
convertfps=29.970
or
Directshowsource("file.mp4", fps=29.970, audio=false, convertfps=true)

The above command should not change the total running time of the video.

I think what happen is it assumed your video was 25fps with let say it had 3000 frames. The running time 3000/25 = 120 seconds. But it was really 31.38fps, so the real running time is 95.6 seconds. So audio was made for 95.6 sec, but play back on 120 sec.

Note: the "convertfps" will change the total frame count, but should keep the same running time.
Please do not PM me about seeding any of my old torrents, as most of files that had uploaded are no longer on my computer.

furransu
Posts: 2289
Joined: Mar 12th, '04, 15:51

Post by furransu » Mar 11th, '11, 10:18

Ok, i shall try that. thanks!

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest