Hein (fub) wrote,

  • Mood:

Recipe for YouTube with better sound

The new camera also takes movies -- we have already inflicted some of those to you.

The camera produces Quicktime clips, but YouTube prefers XviD video and MP3 sound. I use AviSynth to frame-serve the clips to VirtualDub, in order to make an AVI with the right compressions. But the sound quality when the clip appears on YouTube is quite dreadful. Through some tweaking, I found the ideal solution to that.

First, make an AviSynth script that merely serves the video:


Open this script in VirtualDub, and demux with File | Save WAV. The sound is converted into WAV, and saved seperately. However, the problem is that the sample rate of the Quicktime clip is quite low, giving the WAV an equally low sample rate. When you convert this into MP3, sound quality really degrades quite a lot.
The trick is to upsample the WAV. I use WaveWizard for that. Just add the file, and click 'Convert' -- this will upsample the WAV into a 14.400KHz WAV.

Next, change your script so that it will mix in the WAV-file as audio:

DirectShowSource("D:\Incoming\P4260009.MOV", audio=false)

Again, open this script with VirtualDub. Choose XviD as compression for the video, and choose an MP3 codec for the audio. Take the largest sampling rate, and highest bitrate. If you have more than one, check to see which one will go the highest -- take that one.
Save the file as an AVI, and convert. Now you have a clip that will be speedily converted by YouTube with acceptable audio quality.

If you took your clip while holding the camera in portrait mode, YouTube will stretch your video, making it quite ugly. Add the following lines at the end of your script to turn your video right-side-up and add black bands to the left and right to preserve the aspect ratio:

AddBorders(80, 0, 80, 0)

(You may need to adjust the values for AddBorders to fit the size of your video.)

Probably, no-one will use this recipe anyway, but I felt a need to just record this trick for posterity.
Tags: tools

  • Final RPG-a-Day: Thank

    The last prompt for RPG-a-Day this year is ‘Thank’. If you have read every entry of this year’s RPG-a-Day, then I certainly…

  • Next-to-last RPG-a-Day: Mention

    Today’s prompt is ‘Mention’. I guess this is where I mention people I look up to, or websites I frequent? Ok, here’s…

  • RPG-a-Day 29: System

    We’re in the home stretch for this year’s RPG-a-Day! Today’s prompt is ‘System’. Paulo, who has been doing…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded