More codec confusion -- video gurus please help?

I’ve been using the Xvid codec for just about forever. It’s a very capable video encoder that gives excellent visual results and high compression rates with lots of flexibility. Even before discovering Blender I was using it and Virtual Dub to assemble multiplexed .avi’s from image sequences and .wav audio.

After getting good with Blender and the inclusion of FFMPEG in its toolset, I’ve been able to output muxed movies direct from either renderings, the Compositor, or the VSE (or combinations of them all), again using the Xvid codec. That was on my 6-year-old-and-now-nearly-retired-to-the-render-farm WinXP machine.

I’ve recently moved up to a dual-core 32-bit Vista machine (very cool!), but something odd has happened to my usual workflow pipeline. I d/l’d and installed the latest and greatest of both the Xvid and VDub distributions, but for some reason, VDub will no longer play the Xvid-encoded movies I make with Blender/FFMPEG. It reports that it cannot find the codec “xvid” when I try to load them up.

What’s really odd is that if I make a muxed .avi using VDub and the Xvid codec, it plays back just fine!

So something about Blender’s .avi output using FFMEPG and Xvid is now considered screwy, but for the life of me I can’t imagine what it might be.

Any video magicians care to comment? It’s not a killer issue since I can use VDub for the same thing, but it’s something I’d like to figure out and fix if possible.

My brother is a professional video editor, and he still struggles with codecs when changing machines or dealing with new software, so don’t feel bad about not figuring it out.

I can’t solve your problem, but I can offer some advice: Get a real NLE! I stopped rendering anything but stills from blender long ago, and have never looked back. There is nothing like a professional video editing package (we use premiere pro at work, I have final cut at home). Everything becomes so much easier, rendering .pngs then combining and playing with them in a nice industry standard editing package. The open source world really needs competent video editing software.

ya…chapter 4 of my book. wasted a whole 30 pages on codecs. Seems like you have 2 xvid codecs on your system. ugh.

make sure your container is the same, and the file extension is the same. make sure you are using safe encoding values for bitrate and gop. e.g., my WMP will not play a .dvd file using the mpeg-2 encoder, but if i just rename the file to .mpg, it “recognizes” it and plays it. go figure.

also be sure you are using a safe resolution; e.g. avi’s only play certain 4:3 and 16:9, and not some oddball size.

to start, read in an xvid created with vdub into the VSE, and then render that same vid - in other words, get a feedback loop working.

@ 3dementia – actually I’ve been well-satisfied with the way Blender meets my modest needs in terms of video editing. For final output renderings I always go to PNG image sequences, and have used the VSE for editing those and audio clips very successfully a number of times. In this case I don’t think it’s Blender’s problem as much as Virtual Dub’s, since the same setup worked beautifully on my XP machine, although with older versions of both Xvid and VDub.

@PapaSmurf – Not sure how to check for absotively and posilutley, but I’m pretty sure I have only one Xvid on board. It wasn’t on the machine when I first got it (I checked that first), I’ve only installed the one version (the latest), and in the “remove programs” list it only shows the one I recently installed.

I assume the files I’m working with are all “safe” in the ways you mention, since they all worked fine on my XP machine for many, many runs. It’s only after putting the same data and workflow on the Vista machine that things got goofy. I’ll see what turns up when I try your “loop” suggestion.

Can you recommend reliable settings for bitrate, GOP etc. under FFMPEG? I’m pretty cluelss in that regard.

Another bit of info – .avi’s written by FFMPEG with Xvid on my old XP machine that played perfectly on that & other XP machines, on my DVD player, and even on my Xbox, fail using VDub on the Vista machine, but not on other players like VLC. This kind of narrows it down to something in VDub, I think.

Thanks for the comments and suggestions guys. If I figger anythin’ out, I’ll post back here.

More weirdness!

PapaSmurf, I did your suggested test, but instead of using FFMPEG/Xvid to do the output, I used the “AVI codec” option and specified Xvid as the codec. That let me confirm that the Xvid version being used is correct – 1.2.2 – since FFMPEG gives you no codec configuration/info options.

VDub plays the silent .avi made with this option just fine.

Made new output with same input, using FFMPEG/Xvid, also silent (no muxing) – VDub won’t play it, says it needs a VFW-compatible codec.

Tried other forms of input source in the VSE (image sequence, etc.), same results. Only the FFMPEG/Xvid combination fails in VDub. This is on the Vista machine. On my XP machine they worked fine.

I dug into the system files and found that the .dll’s for Xvid are the same for both machines, just different versions according to the file dates, as expected. And there are no other xvid files laying about to screw things up. (Hmm…“Xvid files”… sounds familiar… Scully? You there?) The two files are xvidcore.dll and xvidvfw.dll – the latter seems to the the VFW library that VDub says it needs, but maybe FFMPEG isn’t using it properly. With the “AVI codec” option that does work OK, the “About” box in Blender’s codec config dialog identifies xvidcore.dll, but how these libs are linked together when used is Geek to me.

Bottom line seems to be that FFMPEG with the Xvid codec in 2.49b acts differently under XP than under Vista, since all other ways of using Xvid seem to work OK.

Since I have DivX on the Vista machine (an MPEG-4 codec like Xvid), it could be taking over in other players (I know it does in WMP, not sure about VLC) to play the FFMPEG-generated .avi’s. VDub won’t do that because DivX isn’t a VFW codec afaik.

Could be that something in the newer Xvid version is not playing as well with FFMPEG as it used to, but I don’t really want to hassle with testing the old version on my Vista machine.

The biggest hit all this is delivering to my workflow is not great, mostly convenience. I used the FFMPEG muxed output to review all my editing of both playblast and final renderings, the WIP parts. For final-final output I’ll be outputting PNGs from the VSE and muxing in VDub because it invariably results in smaller files sizes. But doing that for every intermediate test of the editing cuts is a lot more time consuming.

Does this new info raise any new ideas among the videophiles?


EDIT: Yet another test with confusing results:

Back on my old XP machine I found I could burn FFMPEG/Xvid .avi movies to CD-RW and after d/l’ing a patch, play them on my Xbox.

My Xbox will NOT play a .avi movie muxed with VDub on my Vista machine – says it doesn’t have the proper codec. It WILL play a .avi file muxed using FFMPEG w/Xvid. Same source material for both versions.

Obviously, FFMPEG is NOT using the same Xvid version as VDub, nor even the same as used by the “AVI codec” option in Blender.

So where is FFMPEG getting its Xvid codec from? It can’t be the one I installed on my system. Does the FFMPEG code in Blender have its own set of codec libs, separate from what everything else uses? That seems to be the case.

I may have to revert to my older Xvid version for system use if I want VDub to be able to play FFMPEG output, since that setup seems compatible.

I still edit on XP, but I dual-boot and play media on Win 7 (and previously Vista). I know the experts usually say stay away from codec packs, but this one works for me:

DELETED

On my XP systems, I mainly use FFDShow for playback. It should cover you for Xvid, rather than using the actual Xvid decoder. In my experience, any form of the DivX branded codec or player has caused problems. (FFShow also plays DivX)

http://www.videohelp.com/tools/ffdshow

thanks for the reply & links, harveen. Right now I’m trying to recreate my old workflow since it worked well & I’m used to it, but I may have to take another approach since I’m getting some very odd results.

BTW, Xvid has nothing to do with DivX, other than both being MPEG-4 codecs and having the same letters in their name :D. DivX is a commercial product and I usually avoid it like the plague, but Xvid is Open Source and has been a major workhorse for me for years.

I’ve now also tried re-installing the older versions of both Xvid and VDub on my Vista machine, but I get the same results. In other words, the exact same setup on Vista does not work the way it did on XP. Conclusion – Vista’s at least part of the problem, though I can’t say for sure why.

I’ve even removed Xvid altogether from my Vista machine. VLC and VDub will both still play Xvid-encoded .avi’s made earlier with VDub – maybe they’re using the DivX libs? But I can no longer encode using Xvid with either VDub or Blender’s “AVI codec” option – that makes sense, the codec’s not on my system any more.

But I CAN encode with FFMPEG using its Xvid option. This confirms that FFMPEG is using its own Xvid libs for encoding, and they do not play well with VDub under Vista.

This is really too byzantine for me to untangle, so I guess I’ll check harveen’s links and see if I can come up with a new editing/post pipeline.

EDIT: harveen, that codec package you recommend comes with crapware attached. Sorry, but I don’t deal with crapware whores (not you, the people pimping the crapware).

A long shot. Have you tried installing and running virtualdub as an administrator.

Yes, I know. You mentioned you had in on your Vista system, so I mentioned that it has cause problems for me before, taking over xvid decoding when I didn’t want it to and causing other problems.

VLC uses all it’s own internal codecs, so it will usually play most anything without having to install extra codecs. For that reason, it’s not a very good test of codecs on your system.

I’m not sure about Vdub, but I thought it used the system codecs rather than it’s own.

For most playback I use Media Player Classic, it allows you to set codec priority for External Filters and move them up and down in order of preference and block the ones you don’t want to use.

I apologize and I removed the link. I hate crapware as much as you. It didn’t have that when I installed it (a while ago), but I haven’t checked the current installer. Sorry.

Ah, I think I misunderstood the Xvid/DivX comment, then. Yeah, I may just heave DivX, too, since the Media Player Classic link you provided looks very capable. I’ve never been fond of WMP or any of it’s clones, usually just ignore it.

I use VDub as a player because it has imo the best visual rendition of my PNG image sequence files of any player I’ve yet seen – I have an artist’s eye, and even taking into account compression issues, VDub playback looks very good even up against the original PNGs. Plus it’s a good toolbox app for muxing out final .avi’s, fast, pretty easy to understand, and with a number of very useful options and functions added in. Plus, I’m used to it, not a small factor!

But I’ll give the other player a tryout, see if it’s more useful for the WIP stage of my workflow now that VDub is not as easy a choice.


EDIT: OK, here’s the scoop, and my last rant on this subject, since it’s become a brick wall and my head hurts from trying to bash it down.

On my 32-bit Vista system, whatever version of Xvid that the FFMPEG option uses to encode video out of Blender, does not work with most players I have tried. I ditched DivX (good riddance). Now WMP & Media Player Classic both will play only the mp3 audio. At least MPC is polite enough to inform me of the problem and provides good info about the video stream it can’t play, kudos for that. VLC will play the FFMPEG-generated video, even without DivX – I suspect it has its own MPEG-4 codec, yet another flavor in this hobo’s soup – but VLC has little to offer except playback, and not the highest quality, either. Like every other player I’ve used except Virtual Dub, it adds an extra layer of “fuzziness,” like much-overstated AA, to the image output. VDub is always just as crisp as the original PNGs.

So, now I see if I can find another codec FFMPEG has to offer that VDub can play happily with, at least for the WIP stuff. For final output I’m sticking with VDub + Xvid, it’s a mean, clean and Open Source solution. So say we all!

Sorry about that last. BSG fever.

)))))))))))))))))))))))))))))))))))))))))))))))))
EDIT^2: Last wurdz. FFMPEG+MPEG-1 video codec +mp3 audio codec = OK with Virtual Dub. Back in business. Yay.

Glad to hear you finally got things working again.

I also use VDub for encoding image sequences, editing, filtering, re-muxing, etc. and have forever (well, a long time in software terms).

For playing WIP .png sequences I use the free open source DJV_VIew. I use it constantly (all day today, for example). It’s file browser automatically groups numbered images with the same prefix name and it even plays OpenEXR. However, it’s just an image sequence player, it doesn’t encode video or do anything else. Have a look:

http://djv.sourceforge.net/index.html

Cool, I’ll check that link, too.

My WIP pipeline starts in Blender, using the OpenGL rendering option (“playblasts”) to write silent Xvid .avi’s that I play back right in Blender with the PLAY button, to check animations from any an all viewpoints as I key them up.

Once I start to get the action(s) finalized I usually start working on camera views (I sometimes use as many as six or more) and lighting tests, doing adjustments for each view that look good but also preserve lighting continuity as much as possible.

I make a lot of playblasts as well, from each camera view, and start laying them in the VSE where (usually) my audio is already fully mixed into one track – generally just music or a voice track or both. Sometimes sound FX, in which case I’ll often do those cuts in the VSE as well, using pre-produced clips from Audacity.

Between trial edits in the VSE and tweaks to both the animations and the camera plotting, I end up eventually with a rough cut of any one action sequence. I make playblasts of the entire action from each camera and then get down in the editing room in earnest. This is before any hair or cloth physics is baked because that’s so sensitive to tweaks on the character model(s) – I often adjust my animations some after getting the editing polished. For me the editing isn’t a post-rendering process, it’s an essential part of developing the action as well, because timing to a music or other audio track is often extremely critical, and that can have a major effect on how the cameras are set up for interesting transitions between parts of the sequence. All very synergistic, to coin a ten dollar word.

It’s only after the action looks good in tightly-edited playblasts versions do I do the hair & cloth physics, which means a week or more of tweaking and cleanup before I can write out new (and often more tightly plotted) playblasts for a final pre-viz edit. Then I render only what’s actually needed for the “beauty” passes, with all the whistling bells, match those image sequences to the pre-viz in the VSE, and render out semi-finals with FFMPEG, checking the overall progress from frame 1 to the current “working edge.” Eventually I’ll write the fully-edited I.S. clips out to a final-cut I.S… and mux it with the fully-mixed .wav audio in VDub. It’s a wrap! :wink:

Took me a while to develop this pipeline but now it’s working very smoothly for me. I keep things in Blender as much as possible, but don’t hesitate to jump the fence for a better solution :smiley:

All you never wanted to know… :rolleyes:

Thanks for the insight into your workflow. It sounds like you’ve arrived at a good solution combining pre-viz with the final process. I also use Audacity all the time. For video I use the cheap, home video version of Vegas which works fine for me, but learning the Blender VSE is on my list of things to try.

There’s never enough time to learn everything Blender has to offer and before you know it there’s a new version and a ton of new features. Last time I started some physics experiments, I ended up getting sidetracked into trying some game engine scripting.

I also remember reading somewhere that the OS has no clue which codec to use, so it goes through the list of installed ones, asking “can you play this?” probably passing the 4-letter code. Some codecs say yes, even when they can’t, and then crash when they are fed the stream. Sounds like the order in which they ask is different between xp and vista, and that DivX was saying yes, when in fact it couldn’t.

I have yet to get an h.264 encoder for Vista…but there is x.264 to play with…

Here’s some info direct from the source (Xvid’s devs), and also based on some more digging into the various .avi files in question:

The FourCC code written into the header by any .avi authoring software should be ‘XVID’ (all u.c.) but Blender’s FFMPEG code is apparently writing it as ‘xvid’ (all l.c.). Since FourCC codes are case-sensitive, any app looking for the correct FourCC for the Xvid codec won’t see it in Blender’s FFMPEG output.

This doesn’t explain some other things, like why it wasn’t an issue on my old machine, and why VLC can play the files VDub can’t, but I suppose that’s not all that relevant. Xvid provides a utilty to change the FourCC of a .avi file, so with one small extra step I can get VDub back in my workflow using Xvid.

Since I doubt the devs will make any more revisions to Blender versions prior to 2.5, I’ll test that for FFMPEG output and see if it’s been fixed for the new version.

YAY! I suspect that vlc, when getting a no to xvid, does a case change and asks again, or in fact, ignores case alltogether…which is probably smart.

FFMPEG writing a l.c. FourCC may be due to a linux-bias on the part of the devs – it seems that FourCC codes are definitley case-sensitive for VFW (Video for Windows), but that may not be so under linux (and I guess FFMPEG comes from the linux world), in which case, case isn’t the case at all :smiley:

But the Xvid devs did confirm that the proper FourCC for Xvid is ‘XVID’, so it’s better to use that to avoid glitches.