View Full Version : Resizing video's, but saving the audio
NekoNova
29th June 2012, 10:56
Hello,
I've been searching high and low on the net to find a good script example, but I can't seem to find anything that actually does what I want...
The story is the following: I'm recording ingame movies from World of Warcraft. They are full screen recordings, lossless, including the audio stream of what I hear, so ingame and ventrillo.
The goal is to resize these movies and encode them with the H.264 codec, so I can upload them on youtube for the guild.
I can get this working with the meGUI one-click encoder, but I've been trying to get the same thing done by using an .avs script file.
What I succeed in is getting the video resized and encoded into a mp4 container. But this video has no sound in it, and the the filesize is still huge. So from my understanding I'm missing 2 steps:
- H.264 encodig
- muxing the audio stream.
I tried looking into the wiki for a guide that explains how to extract the audio stream first from the original avi, and then encode the avi to have it muxed into an mp4 with the extraced stream.
Would someone be able to help me out on this?
StainlessS
29th June 2012, 17:11
If you dont want to use one-click then assuming you have both video & audio present in your AVS file,
you can try load the avisynth script into the Video Encode section 'Avisynth Script' ('...' button) which should
fill in the entry for the audio as well (with the same script name). then just click on AutoEncode and
start the encode, it will auto mux the result. You will of course have to config the video and audio settings
before clicking AutoEncode.
NekoNova
29th June 2012, 18:59
Thanks for the feedback.
I originally started with the following script:
video = AviSource("mymovie.avi",audio=true).ConvertToYUV().LanczosResize(1280,970)
audio = GetChannel(video,1,2)
AudioDub(video,audio)
Assuming that I understand the script correctly, this would convert and resize the video, extract the audio to a seperate sound, and then mux it together, but I still end up with an MP4 that only contains the movie.
I got further by enqueing the video and audio job and then mux them manually, but still not the desired approach...
StainlessS
29th June 2012, 21:26
The "audio=true" is usually not necessary, more often used with false to NOT get the audio.
"ConvertToYUV()", no such command, presume mean "ConvertToYV12()" that MeGUI would require.
If you at any point in the script insert a "return Info()" line, it will show that it does indeed have
audio present. You could also play it in eg VirtualDub just to be sure, if it does not encode audio
in megui then it looks like a MeGUI problem/audio config not set properly.
Oh, as an afterthought, you may need to obtain the Nero AAC encoder, as MeGUI cannot supply it.
A few weeks ago, DrPhill had a similar problem, I think he took it to one of the MeGUI threads
in MPeg-4 Encoder GUI's forum.
EDIT: You could try to encode below just to ascertain that it is a MeGUI config prob.
return colorbars(pixel_type="YV12").Trim(0,999).Info()
Download and copy somewhere into MeGUI folders.
http://www.nero.com/eng/downloads-nerodigital-nero-aac-codec.php
Options Menu/Settings/External Program Settings/NeroAACEnc Location
Options Menu/Settings/extra Config/Configure AutoEncode Defaults: set container=MP4 and No Target Size(use profile settings).
Video
File Format=MP4 (presumably)
Video Encoding (main form)/Encoder Settings=x264: *scratchPad* (or some other x264, dont know which best for web)
In Video Config, Encode mode=Const Quality, Quality = 21.0 (lower bigger file/higher quality)
Tuning : Perhaps Animation for the game, else default.
Audio:
Audio Encoder Settings: = Nero AAC *scratchpad*
Config: Select your desired bitrate.
Try with AutoEncode
NekoNova
29th June 2012, 22:25
You're right about the commands, just typed the script by heart as I don't have it around here at the moment.
I have done the things you said about the Nero codec, because megui indead complains about when you install it and also tells you where to get it. But this is not the problem.
The script I used does indeed provide me with an AVI that contains the audio. The problem is when I run the batch to Megui, it encodes the video into an MP4 container, but does not mux in the audio stream. I always need to this manually afterwards.
The question now, is this a script issue, or simply the way megui works?
StainlessS
29th June 2012, 22:53
See the edits in prev post. Try to encode the 1 line script. It has to be a MeGUI problem rather than Avisynth (I think).
EDIT: Only One-Click and AutoEncode automatically mux the results.
NekoNova
29th June 2012, 22:55
will give it a spin on the next movie I record.
Thanks for the feedback so far.
StainlessS
29th June 2012, 23:04
And dont forget to click on any SAVE/UPDATE buttons when changing settings,
or you may have to do it every time.
In case you did not see previous edit, Only One-Click and AutoEncode automatically mux the results.
EDIT: The video elementary stream would normally have the MP4 suffix as it is not a raw h264 stream,
ie is full MP4 stream containing extra data that would be lost in a raw stream but contains only video,
this still has to be muxed with the audio stream into another mp4 containing both audio and video,
perhaps thats the confusion.
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.