Log in

View Full Version : Help me to encode from Mpeg2 to x264... how i can use and what ?


DjDiabolik
6th April 2014, 03:45
Hi boys....... i'm a noob of encoding, i know and i tested some programs on XP SP3 and on Windows 7x64 (i have two pc connected on my lan if it's needed) and i need to be learn some tips about x264 encoder and encoding.. 4 example:
- What's a good quality/speed programs to use ??
- What's a good setting to use ??
Or other similar question.......... but this is my recent story about convertion.

I have this full mpeg2 file copied from my Sony videocamera:

General
Complete name : E:\0504-Esordienti\full.MPG
Format : MPEG-PS
File size : 9.51 GiB
Duration : 2h 23mn
Overall bit rate mode : Variable
Overall bit rate : 9 460 Kbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : M=3, N=12
Duration : 2h 23mn
Bit rate mode : Variable
Bit rate : 9 100 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.878
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
Stream size : 9.07 GiB (95%)

Audio
ID : 189 (0xBD)-128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Muxing mode : DVD-Video
Duration : 2h 23mn
Bit rate mode : Constant
Bit rate : 256 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -16ms
Stream size : 264 MiB (3%)

Menu



From this file....... using Avidemux whit copy on audio&video i have extracted, for now, this little parts:

General
Complete name : E:\0504-Esordienti\karim.MPG
Format : MPEG-PS
File size : 575 MiB
Duration : 8mn 29s
Overall bit rate mode : Variable
Overall bit rate : 9 467 Kbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : M=3, N=12
Duration : 8mn 29s
Bit rate mode : Variable
Bit rate : 9 100 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.878
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
Stream size : 548 MiB (95%)

Audio
ID : 189 (0xBD)-128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Muxing mode : DVD-Video
Duration : 8mn 29s
Bit rate mode : Constant
Bit rate : 256 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -16ms
Stream size : 15.5 MiB (3%)

Menu



I have other five file similar to this all extracted from my full.mpg.... but i thinks if i can obtain a good encoded file whit this i can use the same setting to encode the other.. right ??

I have try to encode whit very POOR RESULT:
*** FIRST ATTEMPT ***
Fist time i have using XVID4PSP 5.10.330 on XP. I have installed it....... there is present so much variusly profile! I can't know how it's better to use in my case, i have try to found solution over google and i have found some information here:
http://www.anythingbutipod.com/forum/showthread.php?t=62635&page=2

Looking the image i have created a new encoding profile... and after about 30 minutes i have obtain this NUKED output file:

General
Complete name : E:\0504-Esordienti\karim.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 99.0 MiB
Duration : 8mn 29s
Overall bit rate mode : Variable
Overall bit rate : 1 630 Kbps
Encoded date : UTC 2014-04-06 00:50:36
Tagged date : UTC 2014-04-06 00:50:36

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.1
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 8mn 29s
Bit rate : 1 500 Kbps
Maximum bit rate : 2 307 Kbps
Width : 608 pixels
Height : 344 pixels
Display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.287
Stream size : 91.1 MiB (92%)
Writing library : x264 core 130 r2273 b3065e6
Encoding settings : cabac=0 / ref=1 / deblock=1:-2:-1 / analyse=0x1:0x131 / me=umh / subme=6 / psy=1 / psy_rd=1.00:0.20 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=1 / bitrate=1500 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2014-04-06 00:50:36
Tagged date : UTC 2014-04-06 00:50:40

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 8mn 25s
Bit rate mode : Variable
Bit rate : 128 Kbps
Maximum bit rate : 131 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 7.71 MiB (8%)
Encoded date : UTC 2014-04-06 00:50:39
Tagged date : UTC 2014-04-06 00:50:40



Yeah........ it's NUKED.... Look the AUDIO TRACK DURATION.... it's about 4 seconds less to video tracks, and the result it's completely OUT OF SYNC respect the source mpg file!!
Waste 30 minutes of my life :)

*** SECOND ATTEMPT ***
Every starting from posted above karim.mpg i have installed on Windows 7 x64 the latest VidCoder. Similar to upper i have setting all and, like fist attempt, after about 25 minutes i have obtain another NUKED file.... this:

General
Complete name : E:\0504-Esordienti\karim2.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 99.1 MiB
Duration : 8mn 29s
Overall bit rate mode : Variable
Overall bit rate : 1 633 Kbps
Encoded date : UTC 2014-04-06 01:49:38
Tagged date : UTC 2014-04-06 01:49:38

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 8mn 29s
Bit rate : 1 500 Kbps
Maximum bit rate : 2 502 Kbps
Width : 600 pixels
Height : 480 pixels
Display aspect ratio : 16:9
Original display aspect ratio : 16:9
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.208
Stream size : 91.1 MiB (92%)
Writing library : x264 core 142 r2389 956c8d8
Encoding settings : cabac=0 / ref=1 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=1 / bitrate=1500 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=17500 / vbv_bufsize=17500 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2014-04-06 01:49:38
Tagged date : UTC 2014-04-06 01:49:41
Color primaries : BT.601 PAL
Transfer characteristics : BT.709
Matrix coefficients : BT.601

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 8mn 29s
Bit rate mode : Variable
Bit rate : 132 Kbps
Maximum bit rate : 166 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 7.92 MiB (8%)
Encoded date : UTC 2014-04-06 01:49:41
Tagged date : UTC 2014-04-06 01:49:41



Yeah.... another 25 minutes of my life wasted useless :)
Now the audio and video tracks have same lenght........ but in this karim2.mp4 the audio every about 8 seconds present a micro muted parts of audio, yes... like a little mutes parts or like empty space very frustating and disturbing the entire reproduction!

*** HALF THIRD ATTEMPT ***
This time i don't have restart to re-encode the karim.mpg...... but i have try to load it on VirtualDub to extract only the ACE audio. I thinks i can extract its...... converts manually..... and after i can remux using mp4box to a unique mp4 file!!
But all my idea it's useless:
I have tryed to load the source mpg on different virtual dub.... and the audio tracks and i don't know because the audio tracks it's been reports whit 4 seconds less respect the video!!!
I don't know because from mediainfo i can see this difference and if it's virtualdub reports this wrong duration.......

Sorry for this LONG post...... but i need to explain to you all attempt i try and i thinks i have post all information about my media i need to encode.
Please give me a help..... thanks in advance.

DjDiabolik
6th April 2014, 04:30
I can edit my previous post.... i can add some information about my full.mpg.

Five minutes ago..... i also tryed to load full.mpg on VirtualDub.
After the indexing i obtain so many error says:
[!] MPEG: Anachronistic or discontinuous timestamp found in video stream xxx at
byte position xxxxxx, from xxxxxx to xxxxxxxx. This may indicate an
improper join.

And in other says timestamp in audio....... whit same improper join error at the end!

The full.mpg it's the result of joining 7 different mpeg file copied from my videocamera....... this is the fist mediainfo file:

General
Complete name : E:\0504-Esordienti\source\M2U00010.MPG
Format : MPEG-PS
File size : 1.97 GiB
Duration : 29mn 25s
Overall bit rate mode : Variable
Overall bit rate : 9 589 Kbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : M=3, N=12
Duration : 29mn 25s
Bit rate mode : Variable
Bit rate : 9 100 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.878
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
Stream size : 1.88 GiB (95%)

Audio
ID : 189 (0xBD)-128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Muxing mode : DVD-Video
Duration : 29mn 25s
Bit rate mode : Constant
Bit rate : 256 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -80ms
Stream size : 53.9 MiB (3%)


The other file it's named xxx11.mpg to xxxx16.mpg..... and to obtain this actually full.mpg i use Avidemux!!!
Now i'm deleted it.......... and stay to found another better programs to restart to join and reobtain a newest full.mpeg and, i hope, fixed file.

mariush
7th April 2014, 00:24
Download MeGUI from sourceforge. Run it once and accept to download all updates.
Download Avisynth if asked and install it (if it doesn't install it for you).

In its folder, you'll find a folder Tools and there you'll find DGIndex. Open your MPEG file with DGIndex and select Video > IDCT : Reference and Audio > Demux all tracks and if you want, select Audio>Decode AC3 to wav. Now hit File > Save and save the file as video.d2v (where video can be anything you want)

The software will analyze the video file and create a .d2v file (file holds information which helps to decode the video and seek to exact positions in the video if you edit it) and extract the audio. You can now create a small avisynth script which will load the video and audio and synchronize :


LoadPlugin("c:\path_to\MeGui\tools\DgIndex\DGDecode.dll")

video = MPEG2Source("C:\path_to\video.d2v")
audio = WAVSource("C:\path_to\audio.wav")

mix = AudioDub(video, audio)

mix


First line loads DGIndex into Avisynth.
second line loads the video, third line loads the audio, fourth line takes video and audio and mixes them into a virtual file called "mix" and last line tells avisynth to send to programs that virtual file "mix".

You need to save this as a text file with the file extension .avs - Open notepad, paste the code, change paths, go to file > save as , select all file types then enter name.avs

This avs file now appears as a video file to various applications - for example, you can drag it on Virtualdub and virtualdub will think it's a video that you can edit and compress with various codecs.

MeGUI also will open this AVS file and you can then choose one of those presets in the application to compress the video to H264 (MeGUI uses x264 to compress) and audio to AC3 or AAC.

You can join several segments easily with Avisynth, you just give them different names :


LoadPlugin("c:\path_to\MeGui\tools\DgIndex\DGDecode.dll")

video1 = MPEG2Source("C:\path_to\first_video.d2v")
audio1 = WAVSource("C:\path_to\first_audio.wav")

video2 = MPEG2Source("C:\path_to\second_video.d2v")
audio2 = WAVSource("C:\path_to\second_audio.wav")

mix1 = AudioDub(video1, audio1)
mix2 = AudioDub(video2, audio2)

mix = mix1+mix2
mix


^ this loads two segments into avisynth and joins them together.

Avisynth also has some other useful functions .. for example if your video has 1000 frames (at 25 frames per second that's 40 seconds) and you want to cut the last second you could just say mix = mix.Trim(0,975) and the last 25 frames and the audio is dropped.

DjDiabolik
7th April 2014, 02:11
DEFINITIVE EDIT and after goto sleep because it's italy it's 5AM :)

Now....... myself and helping from google i have found TSMuxer!

Whit TSMuxer i have the source videocamera Mpeg file to obtain a large .ts file about 9GB....... after this i have loaded in last stable AviDemux and whit copy function i have extracted some little parts.

I thinks the ways explained above using avysinth it's most "professional"............ but now go to encoding parts to mp4!

I thinks this time it's better or it's better choice to use Avisynth script and MeGUI...... at this point i want to encode this:

General
Complete name : E:\0504-Esordienti\karim.mpg
Format : MPEG-PS
File size : 577 MiB
Duration : 8mn 30s
Overall bit rate mode : Variable
Overall bit rate : 9 469 Kbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : M=3, N=12
Duration : 8mn 30s
Bit rate mode : Variable
Bit rate : 9 100 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.878
Time code of first frame : 00:00:00:00
Time code source : Group of pictures header
Stream size : 549 MiB (95%)

Audio
ID : 189 (0xBD)-128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Muxing mode : DVD-Video
Duration : 8mn 30s
Bit rate mode : Constant
Bit rate : 256 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : 432ms
Stream size : 15.6 MiB (3%)

Menu


I have added it and exctrated the .d2v and the _demuxed.m2v file and finally the .wav for audio tracks..... i have import the .d2v on MeGUI (i have found on internet how i can add the AAC support for audio track) and i have set some encoding for video and audio.
I thinks i have setted some value wrong in encoding video parts, because i have try to start the encoding and after about 12 minutes the first pass it's pass...... but i have aborted during second pass after i have looked the extimated remain times it's be setted to about 2 hours!

It's very long time... i thinks for only 9minutes of lenght of source mpeg file........ how i can learn how it's better to set the encode video parts of x264 ??

Another question about using MeGUI:
- Where it's it the parts about resolution i want to obtain on output files ??? I need to add this information in avs script ???

- How i need to start the encoding..... what's the exact sequence ??? I need to use "AutoEncode" ?? Or "One-Click" ??? Or i need to manually to click on "Queue" ??? If this using Queue button it's exact... there 2 different Queue... one in video and one in audio parts... it's the same button ?? or i need to add in a exact order ?

mariush
7th April 2014, 04:02
Avisynth works in the background and makes applications opening those .avs files think the .avs files are actually an AVI file without any compression for video or audio.

So you can write commands in that .avs file and open all segments in the file and join them together and then when you open the .avs file in Virtualdub, Virtualdub sees the full video, without any compression for audio and video. Then of course, you can apply deinterlacing if you want to,crop, whatever.. and you can compress to xvid if you want to, anything you want.

You can also open the .avs file with MeGUI and encode the video using one of the presets in MeGUI.

You can read the documentation for Avisynth here: http://avisynth.nl/index.php/Main_Page

MeGUI can encode AAC files but it uses an encoder that's not free (it's free download, but not open source, you have to agree to a license to download it and use it for free), you have to download it from Nero's website and put it in a folder, then go into Options > Settings > External Program Configuration and you can check there that you have the encoder and say where it is. You can download the encoder from here: http://www.nero.com/enu/company/about-nero/nero-aac-codec.php

If you still can't encode to AAC from MeGUI, you can always go in Virtualdub and extract the wav file from the video, then go to nero aac's folder and encode the file to .aac .

The encoder is very simple, you just open a command line in that folder and then enter something like:

neroaacenc.exe -br 128000 -if c:\path\input.wav -of c:\path\output.aac

-br 128000 tells the encoder to encode at an average of 128kbps (like vbr mp3, goes lower or higher a bit depending on how complex the sound) , you can use -q 0..1 to say a quality percentage, where 1 is the best quality possible, or -cbr 128000 to encode at a fixed 128kbps.

After you encode the audio you can combine it with the encoded video from MeGUI, or you can use MKVToolnix or MP4Gui or mp4box or other applications (they're included in the Megui \ Tools folder )

You can also give the .avs file directly to x264 to encode the video, but MeGUI has some nice presets for that, no need to do it in from command line unless you're really curious.

--------------

And if from mpeg i extract the AC3 and not the WAV what i need to put ? I thinks WAVSource it's wrong.....

WAVSource is a command in AVISynth that imports wav files, it won't work with ac3 files. In DGIndex you have an option to tell it to decompress the AC3 files into wav. It's better that way.

You can import the AC3 file directly using DirectShowSource or if you install some "plugins" for Avisynth, using the function names for those plugins. See http://avisynth.nl/index.php/Importing_media , that explains a few things.

on IDCT...... i can choose different value....... what's it's the best ?? How i can know what's the best choice for my pc ?

In the DGindex folder you'll find a manual, DGIndexManual.html Open the file and see. basically IEEE-1180 is the best quality, but it's slower. To the best of my knowledge, the quality difference between those is very small, and on modern computers the performance difference between those modes is also very very small.

As for your other questions. You shouldn't care where Avisynth is installed, as you don't have anything to do with it. Use the DGIndex included in the tools folder of MeGUI, you know that one works.

DjDiabolik
7th April 2014, 04:51
I have make a newest profile based on pics posted here:
http://www.anythingbutipod.com/forum/showpost.php?p=549705&postcount=3


After that i have encoded the video....... after that encoded the audio and muxing this mp4box from MeGUI.

Obtained this:

General
Complete name : E:\0504-Esordienti\test-muxed.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 99.3 MiB
Duration : 8mn 30s
Overall bit rate mode : Variable
Overall bit rate : 1 631 Kbps
Encoded date : UTC 2014-04-07 03:32:30
Tagged date : UTC 2014-04-07 03:32:30

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Main@L3.1
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 8mn 30s
Bit rate : 1 500 Kbps
Maximum bit rate : 2 301 Kbps
Width : 512 pixels
Height : 408 pixels
Display aspect ratio : 5:4
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.287
Stream size : 91.4 MiB (92%)
Writing library : x264 core 138 r2358 9e941d1
Encoding settings : cabac=0 / ref=1 / deblock=1:-2:-1 / analyse=0x1:0x130 / me=umh / subme=6 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=0 / me_range=16 / chroma_me=1 / trellis=0 / 8x8dct=0 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=2pass / mbtree=1 / bitrate=1500 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=17500 / vbv_bufsize=17500 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2014-04-07 03:28:12
Tagged date : UTC 2014-04-07 03:32:33

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 8mn 30s
Bit rate mode : Variable
Bit rate : 128 Kbps
Maximum bit rate : 131 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 7.79 MiB (8%)
Language : Italian
Encoded date : UTC 2014-04-07 03:30:10
Tagged date : UTC 2014-04-07 03:32:33



The Aspect Ratio it's wrong.... the source mpeg it's 720*576 in 16:9........ on avs i have put this:
video = MPEG2Source("E:\0504-Esordienti\karim.d2v").Lanczos4Resize(512, 408)
I thinks i'm wrong here..... for maintain 16:9 i need to put value like 512*288 !!

Whit the value on video encoding i have obtain another error:
On config of x264 i have selected High@L3.1 but the output file it's Main@L3.1.... i don't thinks it's the same ?? or not ?

Same problems on Audio tracks..... i have specifically to maintain a CBR to 128Kbps...... because the audio tracks in output file it's in VBR ?!??

Otherwise if you can help to found a better value option to set for obtain a good quality video... or you can suggest another simply tips&tricks for using/making avisinth script i'm here to study and learning it..

Damn... it's very late..... i need to REALLY go to sleep.

OTHERWISE THANKS IN ADVANCE FOR FUTURE HELP AND THANKS FOR ALL HELP ALREADY GIVE UNTIL NOW....

bxyhxyh
8th April 2014, 15:49
Don't resize interlaced video before you deinterlace it.
You can resize your video to 720x404 or to some 16:9 resolution after you deinterlace it. It doesn't have to be hard 16:9 numbers.
Or you can set SAR (Storage Aspect Ratio) to correct DAR (Display Aspect Ratio) without resize the video.
To do that, you can set Force SAR 64:45 from Misc tab of x264 config if you use megui, or you can add --sar 64:45 in x264 command line if you use x264 in CLI.

mariush
9th April 2014, 17:57
The pictures in that forum thread are from 2011 : since then the x264 encoder has improved a lot and there are much better quality settings. Use the presets built in into MeGUI until you're confident enough to use x264 directly from command line and you understand the parameters.

If you don't see any profiles or x264 in the "encoder settings" drop down list, select MKV or MP4 first at file format. then you should see at least x264: *scratchpad* that means it's a template you can customize. Hit config button , then click on "show advanced settings" and put the mouse over each option to see a quick help. Some options are explained here: http://mewiki.project357.com/wiki/X264_Settings


Your video is interlaced. If you resize before deinterlacing, the quality will suffer. Don't resize before deinterlacing.

Don't resize if you don't have to. Leave it 720x576 and tell the encoder to save the aspect ratio in the video and the player will automatically stretch the 720x576 image and make it 16:9 on your screen. The difference between 512x408 and 720x576 is super small, x264 won't care about that unless you set a really small bitrate, like trying to fit 2-3 hours on a 700MB CD.

Don't deinterlace if you don't have to. x264 has an option to encode the video interlaced. I believe the parameter is --tff (top field first) or --bff (bottom field first) - mediainfo tells you what kind of interlaced video you have. You can also set this parameter from the x264 profile you choose in MeGUI.

The interlacing decreases the encoding efficiency a bit (as in you need to raise the bitrate a bit to get same quality as if you the video was not interlaced). Most players and pretty much all tvs detect that x264 encoded the video as interlaced and will do deinterlacing if needed at playback. Some players will be stupid and not do it automatically but they're very few and usually you can simply go in a menu and enable deinterlacing for that film.

SAR can be calculated easily with this formula:

16/9 = X * Y * SAR

so SAR = 16/9 * Y/X

For example 720x576 16:9

16/9 * 576/720 = 16 * 576 / 9 * 720 = 64

576 / 9 = 64
720/16 = 45

So SAR = 64/45 ... hence --sar 64:45

DjDiabolik
10th April 2014, 22:46
ok ok.............. all this suggestion it's good for me for next encoding i need to do :)

About MeGUI ?? After i have loaded the .avs file and i have maked the config in encoder...... what's the button to start the encoding process ?? Auto-execute or i need to add to queue the all operation manually ?

I have looked i have avisynth 2.5 installed..... you suggest to install this ??
http://sourceforge.net/projects/avisynth2/files/AviSynth%202.5/AviSynth%202.5.8/Avisynth_258.exe/download

I don't know if i have correctly installed it.......

Guest
10th April 2014, 23:01
You can read the help and other online guides to learn about the various modes. I just queue it and then go to the Queue tab and start the job.

To test avisynth, make a text file called test.avs and put this in it:

Version()

Then open that file using VirtualDub File/Open video file.

DjDiabolik
11th April 2014, 01:16
yeah.... i have try it:
paste this on test.avs...... loaded on VirtualDubMod and i obtain "AviSynth 2.60 build Sep 18 2013 [17:36:36]"


Speaking about the quality ot output file... i have read the message above says:
"....x264 won't care about that unless you set a really small bitrate, like trying to fit 2-3 hours on a 700MB CD...."

Until now i'm ever using Xvid for encoders my files..... now i know the MP4 it's still better like than oldest xvid codec and i want to know and learn to use :)
When i use xvid...... i have ever choose to fit about 90minutes in 700MB, speaking about x264 i thinks i can choose to fit about 100 minutes in 700MB... right ? For example whit a video of about 10 minutes i can obtain a file about 70MB ??

Another value i know ever i use xvid codec....... if the output file maintain a bitrate like 1000kbs the output quality remain good, all file i have in mp4 have a bitrate about 1500kbs...... i can use a bitrate like this value to obtain a good quality i thinks.

Guest
11th April 2014, 03:30
You can answer these questions for yourself by doing test encodes. IIRC, AVC will give you about 25-50% better compression for the same source and target quality.

DjDiabolik
11th April 2014, 03:36
For another only my personal testing... from full.ts i have extracted this another parts:
General
Complete name : E:\0504-Esordienti\mariani.mpg
Format : MPEG-PS
File size : 1.03 GiB
Duration : 15mn 32s
Overall bit rate mode : Variable
Overall bit rate : 9 483 Kbps

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : M=3, N=12
Duration : 15mn 32s
Bit rate mode : Variable
Bit rate : 9 100 Kbps
Width : 720 pixels
Height : 576 pixels
Display aspect ratio : 16:9
Frame rate : 25.000 fps
Standard : PAL
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Interlaced
Scan order : Top Field First
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.878
Time code of first frame : 00:11:50:24
Time code source : Group of pictures header
Stream size : 1 004 MiB (95%)

Audio
ID : 189 (0xBD)-128 (0x80)
Format : AC-3
Format/Info : Audio Coding 3
Mode extension : CM (complete main)
Format settings, Endianness : Big
Muxing mode : DVD-Video
Duration : 15mn 32s
Bit rate mode : Constant
Bit rate : 256 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Bit depth : 16 bits
Compression mode : Lossy
Delay relative to video : -112ms
Stream size : 28.5 MiB (3%)

Menu



After that i have try to use only MeGUI to help me to convert to Mp4... i do this:
1) Launch MeGUI... choose Tools and use "FileIndexer" and i have load this mpeg. After this i obtain "mariani.d2v" and "mariani T80 2_0ch 256Kbps DELAY -112ms.ac3".

2) After that i have use the tools -> "AVS script creator". On Filter click on analyse and the Deintelace it's correctly setted automatically...... on resolution the programs suggest to me to set 720x and the aspect ration it's automatically setted. Click on Save

3) The AVS it's loaded automatically on MeGUI... i have used the tools "Bitrate calculator" for obtain a output file about 150MB.... those suggest to me a 1350KBs. this value it's automatically copied in encoder....

4) I have check some value on config for video.... i have RESET the x264 *scratchpad" clicking on "load default", Turn on "Advanced Setting" whitout touch nothing on all TAB value.... the only value i have change it's HIGH on AVC profile and 3.1 on AVC Level and "Automated 2 pass" whit bitrate alredy copied by Bitrate calculator.

5) I have set the AAC For audio. At this point i have click "Queue" on audio... the audio AC3 file it's been converted to obtain "mariani T80 2_0ch 256Kbps DELAY 0ms.mp4"

6) After that i have click "Queue" on Video section... after about 50 minutes i have obtain a file called "mariani.mp4" WHITOUT AUDIO TRACKS!! This file it's 150MB exact size and the bitrate it's exactly setted to 1350!!

At this point my last pass it's muxed (whit mp4box from tools) the "mariani.mp4" and the "mariani T80 2_0ch 256Kbps DELAY 0ms.mp4" but i have obtain a file about 164MB:
General
Complete name : E:\0504-Esordienti\mariani-muxed.mp4
Format : MPEG-4
Format profile : Base Media
Codec ID : isom
File size : 165 MiB
Duration : 15mn 32s
Overall bit rate mode : Variable
Overall bit rate : 1 482 Kbps
Encoded date : UTC 2014-04-11 01:49:52
Tagged date : UTC 2014-04-11 01:49:52

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.1
Format settings, CABAC : Yes
Format settings, ReFrames : 4 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 15mn 32s
Bit rate : 1 350 Kbps
Maximum bit rate : 2 204 Kbps
Width : 720 pixels
Height : 392 pixels
Display aspect ratio : 1.85:1
Frame rate mode : Constant
Frame rate : 25.000 fps
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.191
Stream size : 150 MiB (91%)
Writing library : x264 core 138 r2358 9e941d1
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=3 / lookahead_threads=1 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=1350 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / vbv_maxrate=17500 / vbv_bufsize=17500 / nal_hrd=none / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2014-04-11 01:46:47
Tagged date : UTC 2014-04-11 01:49:56

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 15mn 32s
Bit rate mode : Variable
Bit rate : 128 Kbps
Maximum bit rate : 131 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 48.0 KHz
Compression mode : Lossy
Stream size : 14.2 MiB (9%)
Language : Italian
Encoded date : UTC 2014-04-11 00:55:30
Tagged date : UTC 2014-04-11 01:49:56



I thinks i have again wrong the ORDER on encoder..... how i can encode the audio track and the video tracks in order to obtain directly the output mp4 whit audio ?!!?!?
Becuase upper i have obtain a file mp4 whitout audio tracks ?


Otherwise there is very good quality.. this is a screenshot from source mpeg file:
http://i.imgur.com/TcsZfNo.jpg

And this is the about same point in encoded mp4 file:
http://i.imgur.com/xgNGGWn.jpg

I'm totally noob..... but i thinks it's a good result...... At this point, if this possible, i want only to know how i can obtain the output mp4 whit encoded audio tracks directly whitout to muxed the two .mp4 file after all it's queue it's finished (and obtain i bigger file size i desidered).

Guest
11th April 2014, 03:51
I would encode the video and audio separately and then mux them. That's just me, though, a pedal to the metal kind of guy. Maybe someone that knows MEGUI better will come along and help you.

DjDiabolik
12th April 2014, 00:55
CUT CUT That's just me, though, a pedal to the metal kind of guy.CUT CUT

Hey... i can't understand.. it's this insult to me ? i'm italian and i have try to use google translator to understand this message.

If not thanks....... encode audio and video separately and after muxing the two output mp4 files i don't thinks it's not a bigger problems for now......

Guest
12th April 2014, 03:11
Not an insult! I just said I like to do things manually. Don't read too much into a Google translation.

Here is one way for you:

Configure and queue the video encode job. Make a raw stream!
Configure and queue the audio encode job. Make a raw stream!
Select Tools/Muxer and choose your container type, add the two streams you created the encode jobs for,
configure and queue the mux job
Go to the main page Queue and start the jobs

I hope it is useful.

DjDiabolik
12th April 2014, 19:22
Not an insult! I just said I like to do things manually. Don't read too much into a Google translation.

Here is one way for you:

Configure and queue the video encode job. Make a raw stream!
Configure and queue the audio encode job. Make a raw stream!
Select Tools/Muxer and choose your container type, add the two streams you created the encode jobs for,
configure and queue the mux job
Go to the main page Queue and start the jobs

I hope it is useful.

It's allmost clearly...... now it's only need to find better setting for x264 :)

Ah... i have noticed this my thread it's been moved to newbies forum! Thanks mod :)

Guest
12th April 2014, 23:36
i'm a noob of encoding

OK.

Ah... i have noticed this my thread it's been moved to newbies forum! Thanks mod :) Happy to help! Noob-like questions plus a low post count typically go to the Newbies forum (especially when the member states he is a newbie). And the discussion is mostly about MEGUI so it doesn't belong in MPEG4 AVC.

So, what would be better settings for you? What problems are you seeing with your encodes?

DjDiabolik
14th April 2014, 16:26
CUT CUT
So, what would be better settings for you? What problems are you seeing with your encodes?

For example:
- in encoding speed... the default value it's Medium right ?
I thinks if i set this to "Fast" or "Very Fast" i thinks i can obtain a more speed encoding but i can obtain less quality right ?



Otherwise i have choose to use MeGUI for converts this my Mpeg2 because it's been suggested to me :)
I thinks it's the best and easily solution to use Avisynth and x264 encoder............

Ok.. for convertion i have found the solution... but come back to join my MPEG-PS file.
I have re-read all thread for example....... in the first reply i can see using avisynth i can join the mpeg2 files:
Yeah... it's great solution using a manually created avs script.... but MeGUI doesn't not support the MPEG-PS in output but only MKV or Mp4, i thinks MeGUI doesn't not support the AVI output files or not if i want, for example, to use the xvid encoding instead of x264 right (but i thinks in this case i can load the avs directly on virtualdubmod and choose the encoding setting) ?

*EDIT*
But i otherwise thinks for all other my general question to use the italian resource :)
I don't know it's this is official forum.. but i thinks i can opened and i can ask all information here:
http://forum.doom9.it/

In my mother language :)

Guest
14th April 2014, 16:39
I thinks if i set this to "Fast" or "Very Fast" i thinks i can obtain a more speed encoding but i can obtain less quality right? Yes, there is a tradeoff between encoding speed and quality. Only you can decide how to make that tradeoff, based on your needs and goals.

but MeGUI doesn't not support the MPEG-PS in output but only MKV or Mp4, i thinks MeGUI doesn't not support the AVI output files or not if i want, for example, to use the xvid encoding instead of x264 right (but i thinks in this case i can load the avs directly on virtualdubmod and choose the encoding setting) ? MEGUI certainly does support XVID encoding! If you require PS output then you can encode the elementary streams and then mux them with an external PS muxer.

Good luck over at the Italian Doom9 site!

pennybarker
27th April 2014, 10:52
it's great solution using a manually created avs script

click through the followinginternet site (http://NaturalTestosteroneLevelBoosters.com/)