The Video from HELL



  • Okay, so I have a client that gives me a video that they made.  They want to put it on a webpage.  Simple enough, right??

    First I encode it as an FLV so I can play it in flash.  The client wasn't happy enough with the quality, though, so we opted for another route.

     If any of you have seen Apple's trailers or product videos you'll know that they're incredibly clean.  It turns out that they use the H.264 codec which before this project I'd heard of but knew little about (I'm a programmer and don't do much video work).

    Okay, so step 1...I export the video out of Final Cut Pro into an uncompressed AVI (because I don't want to encode it multiple times because it'd loose quality).  I then buy QuickTime Pro because it encodes into H.264.  Great, I encode it.  It looks good so I put it on the webpage and view it.  The video looks great to me, but for some reason the video jumps from widescreen to normal 4x3 at 4 random frames in the movie.  So I take a look at the uncompressed.avi file I made and it does the same thing.  I look at the video in Final Cut Pro, it doesn't do this.  I re-export the video, same thing.  Long story short on this part, if I export the video uncompressed it jumps to widescreen randomly.  If I export it compressed, it doesn't.  (WTF #1).  So I export it at the highest possible quality and move on.  I re-encode it with quicktime and post it to the site.  The end (or so I thought).

    The client calls and tells me that the video looks washed out when compared to the original.  Sure enough, I take a look at it does looked washed out.  I didn't notice this before.  So I try a couple of different settings and same thing every time.  I google it and find out that it's an incredibly common problem and noone has a solution for it other than to adjust the gamma in Final Cut.  Unfortunately it's only washed out on some computers so doing this will make it under-exposed on others.  In short, there's no solution (WTF #2).

    Okay, I'm a bit annoyed now.  So I look for another solution.  Voila, there's an alternative to using QuickTime to encode H.264.  It turns out that the best alternative is x264.  So I get x264, AVISynth and several other programs together.  I encode the video again, it looks great (quite a bit better than QuickTime's even) and I post it to the webpage.  I view it, it's pretty much perfect.  Sweet, I tell the client and they're happy.  The next day they call me and tell me that the page randomly crashes IE.

    So I take a look at it again and don't notice anything until I refresh the page and hit play again.  Voila, bye bye Internet Explorer.  Same thing in FireFox (WTF #3).  Okay, so I post this to a forum and get several possible answers.  I try them all, nothing works.

    I spend several days exploring alternatives, programs like FFMpeg, FFMpegX for the mac, mmencoder, etc.  Most of these work, but the quality isn't up to par with what I get from x264.exe.  During this time I also try a dozen different settings for x264 and each of them gives the exact same result: they crash the browser.

    In a moment of inspiration I get the idea that even though caching was supposed to be off (I had cache="false" on the HTML object) that the browsers were probably still caching.  Disabling caching might potentially fix the problem (although now the video wouldn't cache, but I don't care), so I added a ?x=[random number] to the page.  Problem solved, at long last!  But there's one more WTF to go...

    I realized shortly after that that if you navigated away from the page and then hit back that the [random number] would be the same and would probably still crash the web browser.  So I went to test this, ready to convert the code to javascript so that I could come up with a different random number every time...but I tried it and the browser didn't crash...

    My original link was to "filepath.mp4".  This would crash the browser.  If I add a question mark and make the link "filepath.mp4?", everything works (WTF #4, hopefully the final one).

    so yeah...this is my story...ARGGGGG

    I think the best part is that I still don't know the reason behind any of these WTFs.  I just now know work-arounds to all of them. 



  • I'm working on a video coding project myself. I'm rapidly learning that rule 1 of coding is:

     1) Never work with video.
     



  • Sometimes, the best WTFs are the WTFs you must construct to work around other people's WTFs :)



  • This is good. It would be front page material, except it's not coding related and not management related. But I can really feel your pain.



  • Especially the ones you're forced to do.

    Like being asked to provide a fail safe wrapper for previous WTFs.



  • As a multimedia apps programmer (altough not for the web, mostly set-top boxes) I share your pain. Ive seen (and done) horrors while dealing with video files from clients. As a tip, when you doing video conversions use Autodesk Cleaner. It beats Final Cut's ass every day of the week, if you dont need editing.



  • [quote user="pinguis"]As a multimedia apps programmer (altough not for the web, mostly set-top boxes) I share your pain. Ive seen (and done) horrors while dealing with video files from clients. As a tip, when you doing video conversions use Autodesk Cleaner. It beats Final Cut's ass every day of the week, if you dont need editing.
    [/quote]

    Well I got the video as a final cut pro project file (with all the related video/audio files) on a flash drive (yeah, this could be a WTF in itself), so I went from there.  Thanks for the tip though.
     



  • This is why I still use MPEG for video.



  • i've never really worked with video, but this makes me very reluctant to even try...



  • The real WTF was that you tried to put a h.264 video stream in a AVI container. It is not recommended. Only use fully MPEG-4 compliant containers, like MP4 or MKV for h/x264 encoded data, it will save you a boatload of trouble.

     The best place to ask questions abou this is the [url]www.doom9.org[/url] forum, though the people at [url]www.cccp-project.net[/url] are experts too and can probably help you.
     



  • [quote user="Mikademus"]

    The real WTF was that you tried to put a h.264 video stream in a AVI container. It is not recommended. Only use fully MPEG-4 compliant containers, like MP4 or MKV for h/x264 encoded data, it will save you a boatload of trouble.

    [/quote]

    Not really; no layperson just dabbling with video encoding is going to know that. Also, this did not occur; the AVI he used to get the FCP project rendered was uncompressed initially (then minimally compressed when that failed) and the final H.264 is stated to be in MP4.

    My own favorite WTF from the entire digital video field is how a resolution of 640x360 is not considered true 16:9. Read http://lipas.uwasa.fi/~f76998/video/conversion/ if you want your brain to hurt.



  • [quote user="Mikademus"]The real WTF was that you tried to put a h.264 video stream in a AVI container. It is not recommended. Only use fully MPEG-4 compliant containers, like MP4 or MKV for h/x264 encoded data, it will save you a boatload of trouble.

     The best place to ask questions abou this is the [url]www.doom9.org[/url] forum, though the people at [url]www.cccp-project.net[/url] are experts too and can probably help you.
    [/quote]

     

     I never put h264 in avi.  I used mp4.  As was pointed out, the avi was an uncompressed export so I could later get the data to mp4.  And I did ask about this on doom9's forums, no answers to any of it.



  • @dicey: thanks for the link, seems like quite a bit of opinionated stuff there. Probably a relatively young one with a good tech head but somewhat less well-endowed in reason.

     
    @Cwolves: Ah, yes, sometimes the doom9 dudes are less than forthcoming. They see so many 1337 n3wblar postings that they tend to glaze over anything that can be taken as such. Also, I haven't frequented it in a year, it might have gone south. But ask in the cccp-project's forum or IRC channel, or goto the #darkhold channel on, I think, irc.irchighway.net.



  • The real WTF is that you bought Quicktime Pro and went through all that trouble exporting when Final Cut Pro can export H.264 directly without Quicktime Pro.



  • [quote user="cwolves"]First I encode it as an FLV so I can play it in flash.  The client wasn't happy enough with the quality, though, so we opted for another route.[/quote]

    Won't FLV format let you adjust the quality?

    If I was offerring video on my site and wanted to 100% guarantee everyone could see it (well maybe 99%), I would use some sort of flash based video player (ala Google Video and YouTube) since almost everyone has flash. No need to mess around with the billions of video formats out there since you can't guarantee your users will all have a particular codec or player installed on their machines.



  • I can feel your pain.

    If you want to go the .flv way next time, try http://www.sorensonmedia.com/solutions/prod/mx_win.php. You get excellent quallity and it's very easy to use
     



  • [quote user="Avenger"]The real WTF is that you bought Quicktime Pro and went through all that trouble exporting when Final Cut Pro can export H.264 directly without Quicktime Pro.[/quote]

    How?  I havn't used Final Cut much but the one export to h264 I found (via the Adobe Media Encoder) said "Quicktime pro required" when I went to h264 export.

     

    As for the Flash Quality issues, exporting a 600x300 (roughly) video into flash at 600kbps gives fairly lousy results (compared to the original source or h264).  Yeah, I could up the bitrate and I tried up to 1mbps, but they weren't happy with the quality and I didn't want to go over 1mbps because it very quickly starts to cut your audience in terms of streaming capabilities. 


Log in to reply
 

Looks like your connection to What the Daily WTF? was lost, please wait while we try to reconnect.