Archive for July 24th, 2007

I hate software, Part 4

* I am sorry for the language below, but I am very frustrated right now *

I f*cking hate software. It never, ever, ever, EVER works as it should be. After 7 hours trying to find an acceptable solution to this, I am so frustrated right now that I could smash whatever is in front of me.

So, as you remember from my yesterday’s blog post, I am trying to export 1080p for use with the Xbox360 and the PS3, from interlaced HDV videos. The only utility that came close but not quite, is SUPER. SUPER is just not as flexible as it should be, because it only allows for 29.97 fps encoding, while my camera also supports 24 fps too. Everything else seems to be ok with that app.

My previous efforts included using the freeware XViD4PSP and the very popular MediaCoder which failed miserably in many levels: from encoding errors, to wrong aspect ratios., to crashes (they all use ffmpeg, mencoder, x264 btw). So, I went the commercial route. I tried ArcSoft’s MediaConverter 2.0 which came with my hardware h.264 encoder stick, but it failed miserably with HD resolutions. I downloaded the new version of MediaConverter, 2.5 but this doesn’t get the aspect ratios correctly either (it doesn’t “stretch”, even if the “stretch” option is checked), neither it de-interlaces. Another commercial utility I tried which was possibly riddled with spyware but I had no choice but to try it, MP4Converter, wouldn’t encode at all, plus it wouldn’t go more than 3 Mbps which is too low for 1080p.

Want to go with QuickTime Pro? Slow-ass h.264 encoder (worse of all in terms of encoding speed so don’t ask me to buy FinalCutPro and a new Mac either), with no de-interlacing support and with keyframe problems (visible “ticks” every second or so in the video no matter what keyframe settings you set), as of with versions from since 6 months ago onwards. Apple stills sleeps over the issue.

PS3Video9 you said? Terrible interface aside, it won’t de-interlace, no matter if you add (as suggested) the -deinterlace ffmpeg option in the CLI. It’s like ffmpeg, to which PS3Video9 is a front-end, doesn’t take it into account at all. FFmpeg “writes your request in its balls”, as we say in Greece very accurately. Either that, or its de-interlacing sucks balls.

Overall, from my experience with at least 7 shitty utilities which for some reason are very popular, their main problem seems to be flexibility and open mind when they develop their software. They just don’t think too much about the problem they are trying to solve. If your video is already 4:3, good luck trying to stretch it. If it is widescreen, non-interlaced (which that would mean that this would possibly be a pirated movie/show), you will be in better luck. But if you have your OWN footage from your own HD camcorder (in other words, if you want to convert legal home videos), you are f*cked. It seems that people are creating encoding front-ends for pirated DivX movies rather than interlaced home footage (that is usually anamorphic too).

So, mediocre software, all over the place. I have not seen a SINGLE application that is able to “understand” a 1440×1080 HDV interlaced file (with the anamorphic flag set *or* not), and be able to transform it to 1920x1080p widescreen at the requested industry standard fps settings or 10 Mbps bitrate. There is ALWAYS something missing from each app, or something not working right. ALWAYS.

God damn it, I f*cking hate software. If this problem is not solved within 1-2 months, I will sell my camcorder. There is no f*cking point getting sunburns while shooting under the f*cking sun if I can’t enjoy my f*cking footage as I should be in a f*cking 1080p TV. SUPER does most of what I need except providing an option for 24fps, but thing is that I want to shoot 24fps with my camcorder and it’s shit like that that keep me from doing it. I am extremely frustrated right now. Things just don’t work properly. I have tried everything and this ordeal makes me have ZERO tolerance for software. > : (

Update: Finally, some half-assed progress on PS3Video9. Add this to your C:\Program Files\Red Kawa\Video Converter\Profiles\Video\PS3.xml .

<profile name="PS3-Eugenia" encoder="PS3 1-Pass - FFmpeg MI" position="0" duration="0" vcodec="MPEG-4 AVC" vprofile="Main Profile" vlevel="Level 4.1" vmode="ABR" vbitrate="8192" vquality="0" vquantizer="0" vwidth="1920" vheight="1080" vaspect="Original" vframerate="29.97" varenabled="true" varmaxres="1920x1080" varmod16="false" vartotal="false" vafenabled="true" vcroptop="0" vcropbottom="0" vcropleft="0" vcropright="0" vpadtop="0" vpadbottom="0" vpadleft="0" vpadright="0" vcli=" -deinterlace " vavsenabled="true" vavsautofps="false" vavsmanualfps="0" vavsconvertfps="false" vbufsize="20000" vminrate="0" vmaxrate="25000" vkeyint="300" vthreads="1" vcabac="true" acodec="AAC-LC" amode="ABR" abitrate="128" achannels="2" asamplerate="0" avol="100" acli="" />

Now, in order for ffmpeg to de-interlace, your source video file MUST be in the YUY2 colorspace. So, as per the tutorial yesterday, install the Huffyuv lossless codec, change its settings as described on one of the last paragraphs to use the YUY2 colorspace, and then use that exported .avi file to re-encode to 1080p using my profile above. Apparently, FFmpeg is extremely picky about YUY2 (which is not of the highest-quality btw) and it won’t even support that in some other lossless codecs that use that same colorspace (e.g. Lagarith). Not sure if the resulted file will playback on XBox360 (I will need testing), but it should play ok on the PS3. Anyways, at last, something that kinda works, I can definitely live with the YUY2 restriction as long as everything else works ok. It wasn’t easy to figure this out btw. It took 8 hours of trial and error.

Update 2: I talked too early. Apparently ffmpeg’s deinterlacer SUCKS. This leaves me with NO application that can create good 1080p h.264 videos out of an HDV interlaced/anamorphic source with reasonable fps/bitrate/aspect-ratio-resize flexibility. I talked to JBQ about it and he agrees that the features I need to work flawlessly are pretty basic and he said that what’s wrong is the lack of process that all these developers have. There were no product requirements ever specified when they had the “cool idea” to start developing an encoder front-end.

It’s official: Software sucks.

Update 3: Apparently, in order to de-interlace correctly with FFmpeg, the -deinterlace CLI option must be the FIRST argument in the ffmpeg command line! After I did that, I got a correct de-interlaced output! I hope the PS3Video9 developer fixes this.

I also downloaded and checked Adobe Premiere Pro CS3, only to find out that the trial version has no HD support (stupid Adobe, how can I test my hardware and my exporting options now?). However, by simulating the resolutions it seems that Premiere is able to create a correct HD h.264 output.

Update 4: So, to get it right, use ffmpeg from the command line. Install PS3Video9, just don’t use its UI (at least until the deinterlace bug is fixed). Copy your Huffyuv YUY2 interlaced .avi file on C:\Program Files\Red Kawa\Video Converter\Tools\FFmpeg\ and navigate there with a DOS command prompt. I use the follow commands for my projects, which should be relevant to all people with HDV and DV *NTSC widescreen* camcorder footage who want their videos to play nice on their EDTV/HDTV via the PS3 or the XBox360.

1080/30p (for 24 fps use “8192″ bitrate instead of “9216″ below):
ffmpeg.exe -deinterlace -i "C:\Program Files\Red Kawa\Video Converter\Tools\FFmpeg\XXXX.avi" -y -f mp4 -title "XXXXX" -vcodec h264 -level 41 -s 1920x1080 -r 30000/1001 -b 9216k -bt 9216k -bufsize 20000k -maxrate 25000k -g 300 -coder 1 -acodec aac -ac 2 -ab 128k "C:\Program Files\Red Kawa\Video Converter\Tools\FFmpeg\XXXX.mp4"

720/30p:
ffmpeg.exe -deinterlace -i "C:\Program Files\Red Kawa\Video Converter\Tools\FFmpeg\XXXX.avi" -y -f mp4 -title "XXXXX" -vcodec h264 -level 41 -s 1280x720 -r 30000/1001 -b 4096k -bt 4096k -bufsize 15000k -maxrate 16000k -g 300 -coder 1 -acodec aac -ac 2 -ab 128k "C:\Program Files\Red Kawa\Video Converter\Tools\FFmpeg\XXXX.mp4"

480p/30p:
ffmpeg.exe -deinterlace -i "C:\Program Files\Red Kawa\Video Converter\Tools\FFmpeg\XXXX.avi" -y -f mp4 -title "XXXXX" -vcodec h264 -level 41 -s 852x480 -r 30000/1001 -b 2048k -bt 2048k -bufsize 10000k -maxrate 11000k -g 300 -coder 1 -acodec aac -ac 2 -ab 128k "C:\Program Files\Red Kawa\Video Converter\Tools\FFmpeg\XXXX.mp4"

For 23.976 fps instead of 29.97 fps, change the “-r 30000/1001″ to “-r 24000/1001″.