View Full Version : How to encode h264 national geo 50fps 720p into xvid 25fps in gk, x264 25fps in megui
hajj_3
1st September 2008, 13:36
Attached is a 26mb sample of .ts: http://www.sendspace.com/file/n3fira
When i use dgavcdec to create the .dga, then i create the following .avs script gk cannot read the fps, dont know how i can get it to make it 25fps:
AVCSource("C:\sample.dga")
General
ID : 49C
Complete name : C:\sample.ts
Format : MPEG-TS
File size : 26.9 MiB
Duration : 17s 677ms
Overall bit rate : 12.8 Mbps
Video
ID : 3400 (0xD48)
Menu ID : 3400 (0xD48)
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L4.0
Format settings, CABAC : Yes
Format settings, ReFrames : 2 frames
Duration : 17s 677ms
Bit rate : 11.9 Mbps
Width : 1 280 pixels
Height : 720 pixels
Display aspect ratio : 16/9
Frame rate : 50.000 fps
Resolution : 24 bits
Colorimetry : 4:2:0
Scan type : Progressive
Audio
ID : 3406 (0xD4E)
Menu ID : 3400 (0xD48)
Format : AC-3
Format/Info : Audio Coding 3
Bit rate mode : Constant
Bit rate : 384 Kbps
Channel(s) : 6 channels
Channel positions : Front: L C R, Rear: L R, LFE
Sampling rate : 48.0 KHz
Video delay : 5ms
Language : Danish
Menu #1
ID : 3109 (0xC25)
Menu ID : 3100 (0xC1C)
Menu #2
ID : 3309 (0xCED)
Menu ID : 3300 (0xCE4)
Menu #3
ID : 1710 (0x6AE)
Menu ID : 3400 (0xD48)
Format : AVC / AC-3
List : 3400 (0xD48) (AVC) / 3406 (0xD4E) (AC-3, dan)
when i tried encoding the whole show i get loads of frames missing which makes it 40mins 50secs instead of 46mins 55secs long:
00:02:12: Started Xvid - First Pass: C:\full.avs
00:33:16: Finished Xvid - First Pass: Duration: 31 minutes, 4 seconds.
00:33:16: Trying to open Log-file.
00:33:16: Success: Log-file open.
00:33:16: Encoded: 122061 Frames.
00:33:16: Speed: 65.471 Frames per Second.
00:33:16: WARNING: Number of counted frames differs from settings!
00:33:16: WARNING: Settings: 140860
00:33:16: WARNING: Counted: 122061
00:33:16: WARNING: Difference: 18799
00:33:16: Correcting Bitrate...
00:33:16: Original Bitrate = 895 k(=1000)Bits/s
00:33:16: Now encoding at 1035 k(=1000)Bits/s
00:33:16: New target size = 308544 Kb
Hope someone can help.
hajj_3
1st September 2008, 17:46
tried doing an x264 encode in megui, the audio is completely out of sync, not sure if its the wrong framerate or something. I selected 25fps in the avisynth script creator. Hope someone can help me.
neuron2
1st September 2008, 17:50
If it's 50 fps why are you choosing 25 fps?
If you want 25 fps, add this at the end of your script:
SelectEven()
hajj_3
1st September 2008, 18:44
this is what my .avs looks like for megui for 720p x264, i manually selected 25fps in avisynth script creator btw:
DirectShowSource("C:\full.avs",fps=25,audio=false)
#deinterlace
crop( 2, 2, -2, -2)
Lanczos4Resize(1280,720) # Lanczos4 (Sharp)
#denoise
should i remove the "fps=25" and where in the script should i put: "SelectEven()".
should my .avs look this for gk for xvid?:
AVCSource("C:\sample.dga")
SelectEven()
Do you know why i got the error about counted frames thats in bold in my 1st post, im not sure.
Sorry for being dumb neuron and many thanks for your time.
neuron2
1st September 2008, 18:50
should i remove the 25fps bit No. Change it to 50 fps because the source is 50 fps! But wait...! You're opening a script full.avs with DirectShowSource(). What is that?
and where in the script should i put: "SelectEven()" Right after the DirectShowSource() line.
so my .avs should look this for gk xvid?:
AVCSource("C:\sample.dga")
SelectEven()
Yes.
Do you know why i got the error about counted frames thats in bold in my 1st post, im not sure. I don't know AutoGK so I can't help with it. Try again with the SelectEven() and post your results.
hajj_3
1st September 2008, 19:10
this was the .avs i created for megui x264:
AVCSource("C:\sample.dga")
then once i had set the things in avisynth script creator in megui the .avs file ends up as:
DirectShowSource("C:\full.avs",fps=25,audio=false)
#deinterlace
crop( 2, 2, -2, -2)
Lanczos4Resize(1280,720) # Lanczos4 (Sharp)
#denoise
so i should put this instead?:
DirectShowSource("C:\full.avs",fps=50,audio=false)
SelectEven()
#deinterlace
crop( 2, 2, -2, -2)
Lanczos4Resize(1280,720) # Lanczos4 (Sharp)
#denoise
should i have field operations as none, i presume so as this is progressive 720p footage. I'm normally used to dealing with 1080i mpeg2 rather than 720p h264.
http://i37.tinypic.com/nl73ub.jpg
gk detects the framerate as 25fps instead of being blank when i use the SelectEven() line, fingers crossed the encode goes well.
neuron2
1st September 2008, 19:19
Don't use the script creator! It's getting confused.
Just make your own script like this:
AVCSource("c:\sample.dga")
SelectEven()
Then open that in MEGUI and set 25 fps when you encode. You don't need the crop or resize. It'll slow things down for no good reason.
hajj_3
1st September 2008, 19:28
can i do it this way, not to use the script creator and just have these 2 .avs files:
this avs is called "full.avs":
AVCSource("C:\full.dga")
SelectEven()
this avs is called "full2.avs":
DirectShowSource("C:\full.avs",fps=50,audio=false)
SelectEven()
#deinterlace
crop( 2, 2, -2, -2)
Lanczos4Resize(1280,720) # Lanczos4 (Sharp)
#denoise
I need to be able to open the script creator so i can see how much cropping it needs each time, much easier to see in there, i can manually enter the info like in the 2 above .avs files though.
when you said "You don't need the crop or resize. It'll slow things down for no good reason." do you mean i dont need to use lanczos (sharp) in gk and i dont have to use lanczos4 in megui?
thankyou.
neuron2
1st September 2008, 20:07
Why can't you understand my simple statements? :)
I said you don't need the crop or resize, period. The sample has no borders. If you crop and resize back to the original size, you're throwing away valid video, reducing quality, and slowing things down a lot. Why do you want to crop that sample?
I don't advise opening one script using AVCSource() with another script using DirectShowSource(). All I'll say is that it is perverse and probably negates random access in AVCSource(). You say you want to do it to determine automatically some unnecessary cropping? You can just open the simple script with AVCSource() in VirtualDub and use its cropping function to determine crop values.
hajj_3
1st September 2008, 20:16
sorry the sample may seem that it doesnt need cropping but the whole show does by 2px on each side, i should have chosen a better clip to be the sample.
i can manually find out for each show i record how much cropping each needs eg 2px bottom, 4px right etc, thats no problem. Do i just need to make 1 script instead of 2 like i did in my previous post, if so please could you paste what it should be, assuming cropping of 2px does need to happen on each side which most of my shows do making sure that the resulting .mkv would be 25fps.
I've attached my .log of my xvid encode, i've renamed it to .txt btw. This is with the SelectEven() it makes virtualdub crash and loses loads of frames.
neuron2
1st September 2008, 20:38
sorry the sample may seem that it doesnt need cropping but the whole show does by 2px on each side, i should have chosen a better clip to be the sample. I see. It still may be better just to accept the original frames, but that's your decision.
Do i just need to make 1 script instead of 2 like i did in my previous post Yes, it's what I've been telling you!
if so please could you paste what it should be, assuming cropping of 2px does need to happen on each side which most of my shows do making sure that the resulting .mkv would be 25fps. OK.
AVCSource("sample.dga")
SelectEven()
Crop(2,2,-2,-2)
Lanczos4Resize(1280,720) Pretty simple, huh?
I've attached my .log of my xvid encode, i've renamed it to .txt btw. This is with the SelectEven() it makes virtualdub crash and loses loads of frames. If you did it with the nested scripts, just toss it and try again with the single script as above.
Atak_Snajpera
2nd September 2008, 01:46
tried doing an x264 encode in megui, the audio is completely out of sync,
use Ripbot264
add this
video=AVCSource("D:\temp\RipBot264temp\job1\job1.dga").selecteven()
Audio is well synchronized
cbsjanten
10th September 2008, 01:08
wouldent the selecteven() remove alot of the good frames?
It takes out the nr. 2 4 6 8 frame and so on, if i understand it right
and it will play rather jerkey when things are moving fast on the screen.
I cant get the sample
but if it does contain dupe frames mabye ther is a way to remove those
Its called IVTC i think but i dont know how to do that or if its any help
pandy
10th September 2008, 09:31
btw also this problem can be solved by reinterlace content (25fps and not loosing frames)
hajj_3
10th September 2008, 21:34
i tried what neuron said but x264 encoding stops after 1st pass in megui and ripbot264, says unknown exception caused the stop. same error happens when i try to encode as xvid in gk.
neuron2
10th September 2008, 22:55
Probably your TS is corrupted. I don't have a solution for that at this time.
cbsjanten
10th September 2008, 23:01
btw also this problem can be solved by reinterlace content (25fps and not loosing frames)
Will you explain how to do that?
im not here to hijack the tread
let me know ill start a new if its a problem
neuron2
10th September 2008, 23:33
AVCSource("c:\sample.dga") # 50 fps progressive
separatefields()
selectevery(4,0,3)
weave()
Now you have 25 fps interlaced video (TFF).
cbsjanten
11th September 2008, 01:58
Thanks
hajj_3
11th September 2008, 18:15
neuron, think it was the removing the ads from the .ts that messed the new.ts up. The original .ts encodes perfectly in gk (xvid) and megui (x264), but when i use h264ts_cutter_v111 to remove ads it wont encode. If i can cap 20secs of footage and leave it intact will you be able to tell me what settings i need to change in h264ts_cutter_v111 so that it creates a working .ts file that will encode or is there another program that will let me remove ads properly?
neuron2
11th September 2008, 20:58
I've never been able to get h264 TS cutter to work, so I can't help you with it. I don't know any other application at this time. I am doing my edits in the uncompressed domain.
hajj_3
11th September 2008, 23:55
doh:(
Hope to see your cutter app soon, maybe you might beat videoredo to the punch.
pandy
17th September 2008, 16:05
AVCSource("c:\sample.dga") # 50 fps progressive
separatefields()
selectevery(4,0,3)
weave()
Now you have 25 fps interlaced video (TFF).
Hmmmm not BFF ? - i'm always think that:
Separatefields().SelectEvery(4,0,3).Weave().AssumeBFF()
Separatefields().SelectEvery(4,1,2).Weave().AssumeTFF()
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.