VSE Questions

Does anyone know where there is documentation about the pipeline of the VSE? For instance, I am having a few serious issues.

  1. sound falls out of sync in VSE after export. It appears in sync in Blender, but after exporting it is not. I have tried different sample rates, different frame rates, I have set the sequence frame rate in Blender, I have clicked the “sync audio” button, I have tried different codecs and compression. Just not staying in sync.

The thing I cannot find is what the native sample rate and playback rate within Blender is, or what it prefers to use.

  1. Picture quality of imported video. I’ve imported some footage (xvid) into the VSE and I’ve found the quality is horrible in Blender. At first I was hoping this was a preview rendering thing that wouldn’t actually get exported, but a full quality DV export actually degrades the quality. Is some kind of conversion taking place within Blender? do I need to use a specific codec? Is there a way to make Blender VSE a passthrough mechanism rather than something that is converting my video?

Thanks in advance!

The most authoritative source IMO is the wiki:
http://wiki.blender.org/index.php/Doc:Manual/Sequencer.
Btw, which version are you referring to and what is your OS?

#1. You don’t need to mess around with frame rates and sample rates. You should examine the source video and determine what the frame rate is. Use that information for Blender settings and override any defaults.

#2. Image quality. I trust that you are using the same resolution in your blender project as the source
material. Otherwise pixelation and other artifacts might emerge. Note that if the source codec is xvid, then recompressing the material will result in more information loss. The lossless route would be convert the source material to image sequences (e.g png) and import these into the VSE for further editing.

Blender can support pretty much any codec you throw at it because it uses ffmpeg.

try to refresh the squencer, then listen again before export and check if it is in sync

The thing I cannot find is what the native sample rate and playback rate within Blender is, or what it prefers to use.

there is no native sr or pbr, you just modify it in the render setting and that’s all.

  1. Picture quality of imported video. I’ve imported some footage (xvid) into the VSE and I’ve found the quality is horrible in Blender. At first I was hoping this was a preview rendering thing that wouldn’t actually get exported, but a full quality DV export actually degrades the quality. Is some kind of conversion taking place within Blender? do I need to use a specific codec? Is there a way to make Blender VSE a passthrough mechanism rather than something that is converting my video?

already answered above

Thanks in advance!

you welcome :smiley:

blender 2.49b is what i’m running on any variety of 64bit linuxes (fedora, slack, ubuntu so far)

  1. that’s what i’ve been doing up to this point; i know the source fps and set it in a few places in blender (in the playback menu item in the video sequencer, as well as an output parameter when rendering out via ffmpeg). The audio is still falling out of sync. I am curious, then, what Blender expects as a sample rate? 44100 or 48000 or does it not care? It must use something to play back in realtime, and whatever that number is, it is working. it’s the exporting via ffmpeg that is not. I have added ffmpeg flags to try to force the samplerate, but it is simply not working.

  2. I’ll check the resolution being used in the project but everywhere i can find to set resolution, I have set to be the same as the source material. The loss is not occuring during export; the loss appears within Blender itself. I have tried exporting out as targa image sequences, png, ffmpeg dv, quicktime, mpeg2, pretty much everything I could think of. The loss is in the export, yes, but it begins from the moment i bring the footage into blender itself.

  1. OK I did find audio settings in the BUTTONS WINDOW > Scene (F10) > Sound Block Buttons. It looks like one has a choice between 44100 and 48000 so I will check what I had the project set to for that issue. i have a feeling this is waht i was looking for.

  2. I can’t find any place to set the project resolution. I import my video and that’s that. The 3d elements are resolution independent, so I’m not clear on where to set the “project resolution”. Any clues?

art999, once you’re on linux things are relatively easy. Use ffmpeg from the cl to convert the source to image sequences (png), maintaining the actual video frame rate. That will guarantee zero quality loss upon importing the img seq into the VSE. I wouldn’t worry too much if the quality of the VSE preview is low and the actual rendered video quality is ok.

As for the sync problem, I find it strange. What’s the original sampling rate of the audio stream? Try using that info to set the audio variables. I’d import the img seq first, import only the audio stream and render out a few seconds to see if it is in sync.

Can you post a screenshot or a sample blend file?

Oh I see. OK, I will try the image sequence trick, I hadn’t thought of that. Sounds like a great idea.

And yes, I don’t care so much about the VSE preview quality; I’m fine with proxy and offline previews, but the rendered video (thus far) has been really bad.

I’ll try your suggestions later and let you know how it goes. Thanks for the info.

cool, exporting to still targa frames works flawlessly.

although i am a bit puzzled as to why blender requires this. is editing video strips in blender actually not supported?

the sound is syncing properly.

quality is steady.

basically, problem solved. thanks everyone for the help!

It isn’t always necessary, depending on what you want to do and the version of Blender & FFMPEG you are using. It can avoid issues like you are having with certain codecs or maybe problems with 2.49b and FFMPEG.

  1. Picture quality of imported video. I’ve imported some footage (xvid) into the VSE and I’ve found the quality is horrible in Blender.

How horrible, like this:

http://blenderartists.org/forum/showthread.php?t=190939

Or other, can you post an image to explain?

At first I was hoping this was a preview rendering thing that wouldn’t actually get exported, but a full quality DV export actually degrades the quality. Is some kind of conversion taking place within Blender? do I need to use a specific codec? Is there a way to make Blender VSE a passthrough mechanism rather than something that is converting my video?

Any ‘YUV’ (using the term incorrectly but…) based video formats are converted to RGB on import. FFMPEG does the conversion I believe. You can’t input ‘YUV’ video into blender and export it as ‘YUV’ without two colourspace conversions YUV -> RGB -> YUV

The way the colour space conversion is done will determine how good your RGB representation of your video is after. You can either convert and maintain full range of data and luma levels with something like AVISynth using PC.709 or scale you luma in the conversion using FFMPEG on the CLI or direct import into Blender.

Unless things have changed drastically FFMPEG does a ‘standard’ YUV -> RGB conversion so your luma level 16 gets pulled down to RGB 0 and your luma level 235 gets pushed up to RGB 255. Easy to see if this has been done using the luma waveform monitor and histogram in the sequencer, on your newly converted Targa’s. If you can see regular horizontal gaps in the waveform monitor FFMPEG has scaled the luma as described above. If it has you have immediately degraded the quality of your video sources.

Further if your video was full range, say off a DSLR or reasonably new HD vid cam you will have captured values below YUV 16 and above YUV 235, all those values will have been crushed into the blacks and clipped off or pushed up to RGB 255 further degrading your original video sources.

I’d suggest if you want ‘passthrough’ that you perhaps avoid using FFMPEG on the CLI, even a very recent svn build and instead use AVISynth, it runs on Linux via Wine and is OSS.

You can recompile Blender 2.49b to use latest svn FFMPEG so that progressive video sources can be imported into 2.49b and maintain correct luma levels without scaling although I feel AVISynth is better conversion maintaining more colour data. Interlaced sources will still scale with latest svn FFMPEG so best to route those through AVISynth.

I’ve a bit on it here, more soon. Some images missing at the moment.

http://blendervse.wordpress.com/2009/09/10/video-import-into-blender/

interesting yellow thanks

i’ll have a look at avisynth.

ffmpeg version im using is the latest .6 release… but svn is still the way to go you think? i’m a frequent user of ffmpeg so the idea of unstable ffmpeg makes me a little nervous but if you vouch for it then I may as well try it.

the video distortion in the other post you linked to is exactly what I’m seeing. it sounds like blender is not necessarily the best video editing solution for linux unless you have a reason to bring your footage into blender (like compositing work). is this correct or is blender in fact attempting to become a video editor? I’m asking because I don’t want to try to force video editing onto it if that’s just never what it is intended for. The only reason I’m using it is because I know of no other tool for the job without getting into silly hobbyist applications.

art999, I think Blender makes a decent basic NLE, I prefer it to Openshot and Kdenlive. Many users successfully edit video / work with image sequences in blender.

The issue you are seeing is solved in the 2.5 branch by using a recent FFMPEG version, I say svn because it seems ‘stable’ version is quite old you can also solve it compiling 2.49b from the branch, edit the scons config to point to system FFMPEG.

But I think AVISynth is the tool to use rather than FFMPEG for the initial grunt work, even more so for Windows Blender uses, it’s painfully easy to use .avs scripts with Windows Blender builds, I’ll post how on the blog but as you’re on Linux like me then image sequences / uncompressed RGB avi’s and proxies with Blender works well once you get past the initial issues.

I mentioned the ‘Cutting Edge Multimedia’ PPA in the other thread, yes it’s probably more unstable but also more upto date. :slight_smile:

I think Blender has a lot going for it for basic NLE and looking forward to further developments.

yeah, i compile blender from source but am on 2.49b and my sys ffmpeg is 0.6.

As everything is working at the moment, i’ll stick with this combo as I am quite happy with current results. But in the future yes i might try out 2.5 branch and go ahead and give the svn version of ffmpeg a shot. I have a test system I will try that on very soon.

Thanks for the info, all.

I also use 2.49b from source, but uncomment the two lines in the linux-config file to use system FFMPEG rather than the libraries that 2.49b bundles, it builds ok. Are you having problems?

There’s also a nice waveform monitor patch available in the 2.4 patch tracker to add too maybe. The graticule with IRE values is incorrect but far better than existing waveform monitor in 2.49b. :slight_smile:

if video falls out of sync with audio, your frame rate is off. Use the divider. The way to tell is if when you import the audio and video, if the strips are not the same length. See my book ch 13 and 14.

If audio is permanently out of sync with the video, move the audio back a few frames, like 5. Some codecs have a delay.