weekend multimedia notes, part two

Well, I had fun last weekend writing up just general notes about multimedia stuff I was playing with, so I think I’ll have a go at it again.

For some reason, this weekend, I got it in my head that it would be a great idea to look at the MP4 format again, to maybe put a few video files in, for portability. Which of course makes no sense, because I’m not streaming or sending my files anywhere at all except from one linux server to one linux client. But, vague issues of necessity never stop me when there’s something exciting and new to learn, so away I went. After playing around for a few hours, I came to the conclusion that things really aren’t quite up to par (for me, that is, the perfectionist), and that there’s no chance of me switching from Matroska any time in the near future.

The first snag I hit was that MPlayer wouldn’t report the aspect ratio or the bitrate on the files. At first I thought it was just happening on .mov files I had downloaded from Apple, but even with MP4s I created myself it was happening. Poop. Bitrate I can do without knowing, I was just curious, but ignoring the aspect when the original source is non-standard causes issues.  Edit: I should have known this, using the lavf demuxer works fine.  midentify -demuxver lavf movie.mp4

I started making a DVD of Star Wars trailers for my little brother (yay, trailers!), and I was reencoding them using ffmpeg. Lemme go off on a bit of a tangent here and say that as much as I love MEncoder, sometimes ffmpeg is just a wee bit simpler to throw out some quick changes. “ffmpeg -i foo.mov -target dvd -aspect 16:9 foo.mpg” is just too easy to remember. Obviously I could create a profile for mencoder, but I do that all the time, and then forget which ones I have. Not too helpful. Anyway, the trailers were actually already cropped so it was more like 2.3259 or something like that instead of 16/9. FFmpeg couldn’t read the aspect ratio, so I had to figure it out myself. I’m sure there’s a simpler way, but I just dumped the Apple trailer into Matroska first, got the ratio from there and then reencoded it. A bit of a run around, but it was fast, simple, and got the job done. Of course it might be a problem if your source material was longer than 90 seconds. Good luck with that.

Oh yes, I think one reason I wanted to play with MP4 was to see if I could get something to play back on my PSP. I have this wild-eyed dream of using my PSP to remotely stream video content from home. Unfortunately, it’s a royal pain in the pooty to even get something to encode for them. I really didn’t throw much effort into it, but quickly tried the first example I found online to encode it using ffmpeg, and it didn’t work. Meh. I tweaked the settings a bit to see if that helped, but nothing worked. Can I just throw in, again, even though it didn’t work for me, that ffmpeg is cool like that — it has a PSP format that it’s preset to encode to, along with a bunch of other ones … see “ffmpeg -formats”.

Actually, ffmpeg’s output was annoyingly confusing, now that I think about it. I couldn’t figure out for the life of me what the actual command line option was for the vcodec and acodec option. Anyone else run into that problem? I seriously couldn’t figure out which one was the AAC option. Aargh! “ffmpeg -formats” would just say aac, so of course I tried that, but it didn’t work. The option was actually libfaac. I have no idea in the freaking world how people are supposed to figure that one out. I read the entire man, and it didn’t really give much help there, either. Bleh.

One nice thing about the older releases of ffmpeg was that you could just say “ffmpeg -i foo.avi foo.mp4” and it would automatically select mpeg4 video and aac audio for you. I switched over to using just SVN, and it wouldn’t do that for me, sadly.

Oh yes, one more thing I remember about MP4 (I am *really* bouncing around in this post), was that when I first read up about it, I discovered that the format supports MPEG2 video, which got me really excited. What surprised me was that Dolby Digital and DTS are not supported. AAC is the multi-channel choice, it seems. Still, I could live with just having to re-encode my audio. I hate waiting on video. Just a preemptive defense here, but say what you will about my MPEG2 choice of codec, but there’s something to be said about using a video codec that has been around for a long, long time and is extremely well supported in all kinds of software.

Playing with MP4, I found three ways to make one: using mp4creator (part of mpeg4ip package), ffmpeg, and mencoder. mp4creator was nice, but somewhat lacking in features — that is, comparing to mkvmerge (for Matroska). I’m not trying to bash it, since it did exactly what I needed it to do in every case, but it could be a bit more polished. I’m sure that’ll come with time, though. Once I had a movie file with MPEG2 and AAC, it wrapped it just fine, assuming it was named with a suffix it understood (complained on .vob, took .mpg fine). I’ve read that MP4 supports VobSub, and I wonder how someone would about putting that in there. Interesting stuff. I’ll have to play with it later.

FFmpeg I already mentioned. My biggest headache was just trying to figure out how to what the options were. In reencoding an MPEG2 video and AC3 audio to same video and AAC audio, for some reason, the resulting .mp4 file had blocking artifacts on playback. I have no idea how that happened, since I just copied the video stream directly. So, I couldn’t really use that to just quickly create one.

MEncoder worked best of all, even though it screeches at you (using SVN) that the LAVF muxer is broken, everything worked perfectly fine. I used something like “mencoder movie.vob -of lavf -ovc copy -oac faac -o movie.mp4”. No blocking issues, sound worked fine, everything was great.

So, that was my short lived trial with MP4 for the weekend. I’m actually really surprised that it isn’t as well developed / supported as I thought it would be. I thought that this was the hawt new thing in codecs. Like everything else, I’m sure support for it will improve in time. I figured there was a lot more options right now, though. I wish Matroska was supported on more commercial platforms, because I still think it blows everything out of the water.

Anyway, going all the way back to my custom DVD. I’ve been ripping my Star Wars trailers off the DVDs to make a new one of just all the trailers. I have the original theatrical release DVDs for the original trilogy, and unfortunately they don’t come with any trailers *at all*. Super bummer. Episodes one through three, though, have a ton. Episode III has 18 trailers total on it. Sheesh! It was a bit of a pain trying to find them all, too.

One thing that surprised me was that with all the trailers on the Episode I disc (seven), I noticed that one of them was missing. I can’t believe I even know that. I guess I am a nerd. But there’s this one really memorable trailer which starts off with Anakin pod racing, and it’s incredible. I’ll have to find it somewhere else, I guess.

As much as I’ve written, believe it or not, I did all of this within about four hours time. It was a fun weekend. In fact, I wasn’t even on the computer until Sunday afternoon. Good times.

Leave a Reply