Resynthesize Tutorial
Resynthesizing can lead to unwanted results sometimes, especially if you have uneven and complicated surfaces. This tutorial shows you step by step how to get the results you want!
Try Openshot for Video Editing!
I've had lots of problem to even convert the AVCHD files from the HD camera at all at first. But now that totally changed. Openshot is a really new and really great video editor that's based on ffmpeg and can read my .m2ts files without a problem. I can deinterlace them and cut them together for output in almost any format from FullHD to QCIF.
The problem is that at least version 1.1 had a slight issue with memory leaks. It grew to consume more and more RAM. So I recommend to close and reopen it before doing the encode. Or you just close it and do the encode with the command line program openshot-renderer! That also means you can easily edit the video on one computer and then encode it on some other computer, e.g. a headless server. And Openshot encodes pretty quickly as well. Even on my slow old notebook I can export from FullHD in a very short amount of time!
Video editing has never been this easy, fun and fast!
Amazingly Great Image Fixup from the coming Photoshop CS for free with GIMP
Photoshop will introduce a really cool, new feature in the coming CS version. But with Gimp, they're shipped at least with any debian based distribution now already! Check out resynthesize here and texturize.
Google Shuts down its China site
"Just over two months after threatening to leave China because of censorship and intrusions from hackers, Google on Monday closed its Internet search service there and began directing users in that country to its uncensored search engine in Hong Kong."
Read it all at NYTimes.com.
Read it all at NYTimes.com.
The Devil's in the Bitrate - A Crazy Detail about Recording FullHD Video with the Canon EOS 500D
Okay. So the Canon EOS 500D does create FullHD video. Well, alright, it's just with 20 fps. But that's actually not as bad as I had feared. Yes, there are no options whatsoever. That's kind of weird. And then there's this tiny details related to the options...
First I thought my computer was suddenly too slow for playing even 720p movies. Then I tried streaming them to my netbook with hardware accelerated video playback. And guess what: the excellent 18 Mbit/s I got on my wifi are not enough.
The photo camera uses a bitrate of over 20 Mbit/s (720p) and over 30 Mbit/s (1080p) for video recordings in AVCHD. That's significantly (at least +100%) more than e.g. the Panasonic HDC-SX1 uses for recording 50 interlaced fps with FullHD in the high quality setting. Either the encoding chip is not too good with compressing. Or they just locked the birate on freaking high to make it bothersome to record with the photo camera and keep out competition from their own video cameras.
Sometimes x264 gives spikes with e.g. 24 Mbit/s, so I think it's not just the bitrate being locked in. Maybe they could just not be bother to write a VBR video codec. And the sounds is uncompressed pcm. But of course with 30 Mbit/s, 0.7 Mbit/s sound doesn't matter much.
I recoded a 720p video (also over 20Mbit/s) with x264 and a CRF (quality) value of 23 (rather high):
It's kind of like the videos are recorded in a raw-like mode. The only thing is that you can't change it to normal compression. And yes, now I know why the camera records only 20 fps and not 25 or 30 in FullHD. Because otherwise it would probably use over 40 Mbit/s...
It actually sounds worse than it is. It just means you should probably have a nice script to recode your videos to a less crazy quality after getting them from the camera chip. The good thing is actually that the original quality is so high that the losses of transcoding should not be too high. And you should make sure your SD card can handle at least a steady 5 MByte/s writing per second if you want to record videos with your Canon SLR photo camera.
I'd love to hear about your experiences! Maybe it's only my camera that uses as much? But it definitely does.
First I thought my computer was suddenly too slow for playing even 720p movies. Then I tried streaming them to my netbook with hardware accelerated video playback. And guess what: the excellent 18 Mbit/s I got on my wifi are not enough.
The photo camera uses a bitrate of over 20 Mbit/s (720p) and over 30 Mbit/s (1080p) for video recordings in AVCHD. That's significantly (at least +100%) more than e.g. the Panasonic HDC-SX1 uses for recording 50 interlaced fps with FullHD in the high quality setting. Either the encoding chip is not too good with compressing. Or they just locked the birate on freaking high to make it bothersome to record with the photo camera and keep out competition from their own video cameras.
Sometimes x264 gives spikes with e.g. 24 Mbit/s, so I think it's not just the bitrate being locked in. Maybe they could just not be bother to write a VBR video codec. And the sounds is uncompressed pcm. But of course with 30 Mbit/s, 0.7 Mbit/s sound doesn't matter much.
I recoded a 720p video (also over 20Mbit/s) with x264 and a CRF (quality) value of 23 (rather high):
ffmpeg -i "$IN" -acodec libmp3lame -vcodec libx264 -vpre normal -crf 23 "$IN small.mov"The result: roughly 4 Mbit/s. 1/6th of the original data rate for as far as I can see the same quality. The file size usually goes down to 10-30% (!) of the original file.
It's kind of like the videos are recorded in a raw-like mode. The only thing is that you can't change it to normal compression. And yes, now I know why the camera records only 20 fps and not 25 or 30 in FullHD. Because otherwise it would probably use over 40 Mbit/s...
It actually sounds worse than it is. It just means you should probably have a nice script to recode your videos to a less crazy quality after getting them from the camera chip. The good thing is actually that the original quality is so high that the losses of transcoding should not be too high. And you should make sure your SD card can handle at least a steady 5 MByte/s writing per second if you want to record videos with your Canon SLR photo camera.
I'd love to hear about your experiences! Maybe it's only my camera that uses as much? But it definitely does.
Skype open sources the voice codec
writes heise. Let's see if other people adopt it. Of course this doesn't mean an open source skype will come, as skype still keeps secret the encryption and protocol used.
Edit: It turns out the license is not a proper open source license. It's a look, but don't touch kind of license. But if adopted on a broader scale, this codec might improve the quality of telephone conversations.
I still think it's crazy. We haven't had serious improvements in sound quality of telephones in the last at least 20 years. Just imagine your phone would run with 64 kbit/s vorbis. You could actually hear clearly what your friend is listening to on TV or radio.
Edit: It turns out the license is not a proper open source license. It's a look, but don't touch kind of license. But if adopted on a broader scale, this codec might improve the quality of telephone conversations.
I still think it's crazy. We haven't had serious improvements in sound quality of telephones in the last at least 20 years. Just imagine your phone would run with 64 kbit/s vorbis. You could actually hear clearly what your friend is listening to on TV or radio.
Command Line Output Redirection
Check out this nice article with all the major redirections explained, including the important stderr to stdout redirection.
"Good artists copy, great artists steal" - The CEO of Sun speaking
On his blog, (assuming he is who he claims to be - not confirmed!) he writes a nice to read story about how patents fit into the modern world IT corporation's strategy. You collect patents for defensive purposes so you can counter claims of a corporation with your own expensive claims. The only problem is that this doesn't work for patent trolls, because those corporations usually don't actually sell anything themselves.
Free Rebootless Kernel Updates for current Ubuntu
Unless you have Ubuntu 8.04 LTS, you can get your kernel updated with security fixes without the need for rebooting at all. Remember how Windows needs or used to need a reboot for almost every software installation? Now you'll never have to reboot your Linux! Get Ksplice for Ubuntu here.
Windows Emulator
Check out these great comics by Shane Collinge about a woman writing a windows emulator.
Moblin 2.1 IVI FC Release tested on the MSI Wind U110 (GMA 500/Poulsbo)
Phoronix hasn't gotten to it yet, but now I've done a quick test with the Moblin distribution IVI version with supposed GMA 500 support (moblin-2.1-preview-ivi-20091208.img) to see how well it's working on my netbook and what feature advantages its IEGD driver may have over the psb driver.
Well, it's not a lot:
Well, it's not a lot:
- The resolution was set to 800x600. No other resolutions were detected (xrandr -q)
- The colors were distorted. It looked like 256 colors but randomly exchanged.
- The touchpad was not working. The mouse moved in seemingly opposite or random directions and kept skipping back and forth. I had to use an external mouse to do anything at all.
- The sound wasn't working, thought that might possibly be fixed by disabling power saving, just like in Ubuntu
- Wifi wasn't working. I could not add networks or configure the wifi. " Join other Network" was greyed out. The iwconfig tools have to be started manually from /sbin. They found a network, but I didn't bother to try to set it up with wpa_supplicant manually. A path is not set. wpa_supplicant was already running with 99% cpu usage when I boot.
- Switching to the console and back is impossible. It completely and irreversibly crashes the graphics until a reboot.
- ACPI showed tons of errors in dmesg.
- Trying to suspend crashed the system.
- I wonder if there's an application in the distribution that can take advantage of VAAPI accelerated video decoding. There is a video player. But I had no easy access to the hard drive's partitions (ntfs).
The distribution as tested on my netbook is in two words:
utterly unusable.
The psb driver set up according to my howto works flawlessly compared to that! It interesting how difficult it seems to be for Intel to get its own chipset to work in its own distribution with its own driver.
But, yes. Moblin was very snappy. ;-) (I think that just shows just how cool XFCE is, though.)
utterly unusable.
The psb driver set up according to my howto works flawlessly compared to that! It interesting how difficult it seems to be for Intel to get its own chipset to work in its own distribution with its own driver.
But, yes. Moblin was very snappy. ;-) (I think that just shows just how cool XFCE is, though.)
Memory Cards for the Skypephone S2
After having a lot of insecurity with acquiring and inserting a memory card for the 3 Skypephone S2, let me give you some hints:
- a Sandisk 4 GB microSDHC card works perfectly for me.
- When you try to insert the card into your phone, you need to pull the card holder towards the SIM slot to unlock it. Then you can pull it up, insert the card and close and lock it again.
- You find the manual here: http://mymobile.three.co.uk:8080/mymobile/3/SkypephoneS2/img/S2UserGuide_UK.pdf
If you like this post, consider ordering a SIM via my three agent link.
More on Google, Censorship and China
The NYTimes has posted a great feature on the debate with many experts providing their intriguing views on the subject.
Help with Stopping Software Patents in Europe
I know this is quite political, but it's open source politics: A new initiative has been taken to propose a EU directive that prevents software patents. I have just signed the petition and invite you do to so as well. http://petition.stopsoftwarepatents.eu/
Remember to click the link in the email you will receive from them to confirm your signature.
Please don't start a flamewar of any kind here. But you are welcome to post any other comments.
Remember to click the link in the email you will receive from them to confirm your signature.
Please don't start a flamewar of any kind here. But you are welcome to post any other comments.
Large Scale Chinese Attack on Google to Hit Human Rights Activists
As a response to the incident of a sophisticated Chinese attack on Google's infrastructure, the Chinese Google search has now been de-censored.
We have decided we are no longer willing to continue censoring our results on Google.cn, and so over the next few weeks we will be discussing with the Chinese government the basis on which we could operate an unfiltered search engine within the law, if at all. We recognize that this may well mean having to shut down Google.cn, and potentially our offices in China.-- Google
Lessons not Learned - Continuing Latency Issues in Linux
We still have wonderful fsync offenders. Look at Kopete for example, or at Chrome. You don't want to be running that on battery or in a low latency environment:
Or Iron (a privacy-enhanced Chrome/Chromium browser)
If you use ext4, you can add some of these mount options to decrease the latency impact. But this decreases data security:
noatime,nodiratime,nobh,barrier=0,commit=100,data=writeback
Process kopete (1868) Total: 19098.1 msec
fsync() on a file 6008.6 msec 99.8 %
Scheduler: waiting for cpu 19.4 msec 0.2 %
Or Iron (a privacy-enhanced Chrome/Chromium browser)
Process iron (5822) Total: 13753.6 msec
fsync() on a file 5090.9 msec 70.3 %
Writing a page to disk 1412.8 msec 10.3 %
synchronous write 524.5 msec 3.8 %
If you use ext4, you can add some of these mount options to decrease the latency impact. But this decreases data security:
noatime,nodiratime,nobh,barrier=0,commit=100,data=writeback
Chrome for Linux without the Spyware
When you get Chrome for Linux beta from Google or Chromium from the Ubuntu repository, there is some tracking code in there. Some say that's why Chrome is spyware or adware. Iron fixes this by removing the code to identify your brother. The download link can be found here. You may still be interested in getting the stop Google Ad tracking cookie. This link can always be found conveniently in my links section in the right column.
For Chrome, Google tells us we can:
But for me it's really called "Accept Cookies only from Sites I Visit".
For Chrome, Google tells us we can:
From Chrome, click on the "Customize and Control Google Chrome" icon, and in the drop-down menu, select "Options"(http://www.google.com/ads/preferences/plugin/browsers.html#chrome)
Select the "Under the Hood" tab
Under "Cookie settings" select "Restrict how third-party cookies can be used
But for me it's really called "Accept Cookies only from Sites I Visit".
Running Untrusted Programs in a Sandbox in Linux
Isolate is the program to do it. It has quite a nice introduction on it's website but unfortunately has to be downloaded in source and compiled yourself. It can help running a media player or your browser more safely.
You can download it with subversion via:
svn checkout http://isolate.googlecode.com/svn/trunk/ isolate-read-only
You need to install at least the libelf headers to compile it, e.g. sudo aptitude install libelf-dev in Debian based systems like Ubuntu. There is absolutely no documentation inside the tree except a GPL 2.0 license.
Thanks to LWN. See the comments there for more suggestions about isolation technologies like Rainbow.
You can download it with subversion via:
svn checkout http://isolate.googlecode.com/svn/trunk/ isolate-read-only
You need to install at least the libelf headers to compile it, e.g. sudo aptitude install libelf-dev in Debian based systems like Ubuntu. There is absolutely no documentation inside the tree except a GPL 2.0 license.
Thanks to LWN. See the comments there for more suggestions about isolation technologies like Rainbow.
Transcoding 50 fps Interlaced AVCHD to 50 fps Progressive x264 with MEncoder - Getting Every Last Drop of Quality out of your Interlaced AVCHD Recordings
Have you ever wondered how much quality your HD camera can deliver? This script helps you to find it out if you have a camera that encodes interlaced video. It uses special filters to calculate 50 whole frames out of the half frames, which makes motions seem extremely fluent. You could play the file at half speed slow motion and still have a full 25 frames per second.
You need a more or less recent version of mplayer. It should be a version of mplayer after the release of ffmpeg 0.5. Current repositories of current distributions should be able to deliver this. But be aware that not all of them provide an mencoder compiled to work properly with x264. If that's the case you may have to compile it yourself.
After that it's as "easy" as this command, once you've put it all together. I'll explain further below and post a sample script for the entire conversion. The result is extremely smoothly playing video files that look great.
This is the main part:
The demuxer parameter works around mplayer's transport stream implementation, which does not work well with AVCHD files. It tells mplayer to trust ffmpeg's libavformat instead. This makes a huge difference for me. With this command I can play AVCHD files and transcode them in sync without problems and serious glitches.
The fps and yadif part was tricky. It creates 50 full progressive frames out of the 25 interlaced frames it gets from the camera. I had sync problems at first, but I found the solution somewhere in the mplayer mailing list I think. I'm not sure why you have to take twice the framerate of the AVCHD file, but only this way it works. Of course, if you camera is not PAL, you may have to change this to double your framerate. Otherwise I had the sound playing half as fast as the video with the consequence of constant frame skips and no sync at all.
Now let's put it all together into a little please-do-it-all-for-me script:
Let me know how it worked for you! Or if you have an idea how to improve the script. Try skipping frame for frame with the "." button in mplayer. Be aware that the file size of the resulting video may easily be bigger than the input. That's because you're creating full frames out of half ones, and storing them takes more space.
Check out a Squirrel in HD slow motion produced with this script and then "mencoder -speed 0.5 -af scaletempo -oac lavc -lavcopts acodec=ac3 -ovc copy" and uploaded in FullHD (but available only in 720p currently):
You need a more or less recent version of mplayer. It should be a version of mplayer after the release of ffmpeg 0.5. Current repositories of current distributions should be able to deliver this. But be aware that not all of them provide an mencoder compiled to work properly with x264. If that's the case you may have to compile it yourself.
After that it's as "easy" as this command, once you've put it all together. I'll explain further below and post a sample script for the entire conversion. The result is extremely smoothly playing video files that look great.
This is the main part:
mencoder -demuxer lavf -sws 9 -fps 100 -vf yadif=1,mcdeint,softskip -ofps 50
The demuxer parameter works around mplayer's transport stream implementation, which does not work well with AVCHD files. It tells mplayer to trust ffmpeg's libavformat instead. This makes a huge difference for me. With this command I can play AVCHD files and transcode them in sync without problems and serious glitches.
The fps and yadif part was tricky. It creates 50 full progressive frames out of the 25 interlaced frames it gets from the camera. I had sync problems at first, but I found the solution somewhere in the mplayer mailing list I think. I'm not sure why you have to take twice the framerate of the AVCHD file, but only this way it works. Of course, if you camera is not PAL, you may have to change this to double your framerate. Otherwise I had the sound playing half as fast as the video with the consequence of constant frame skips and no sync at all.
Now let's put it all together into a little please-do-it-all-for-me script:
#!/bin/sh
# High Quality Mencoder AVCHD Transcoding Script, (c) 2010 linux-tipps.blogspot.com, published under the GNU GPL v. 3.0
# Settings
CRF=26 # 18-26, the higher the smaller the resulting file, HD files can stand a higher than SD
FPS=50 # input fps of your file, "mplayer -demuxer lavf -identify" helps you with finding this
X264OPTS="" # add subq=6 frameref=6 for higher quality per bit but lower encoding rate.
# Preparation
INPUT="$1"; shift
OUT=$(basename "$INPUT"|sed 's/.m2ts//')"-x264.avi"
echo Mencoder Interlaced AVCHD to Progressive x264 Script, published under the GPL v. 3.0 \(http://www.gnu.org/licenses/gpl-3.0.txt\), check for the newest version of this script at http://linux-tipps.blogspot.com/2010/01/transcoding-50-fps-interlaced-avchd-to.html.
echo $0 Encoding $INPUT to $OUT using the following command line:
[ -f "$OUT" ] && echo File exists - aborting && exit 1;
# Encoding
mencoder="time nice mencoder -cache 8096 -demuxer lavf -sws 9 -fps $((FPS*2)) -vf yadif=1,mcdeint,softskip -ofps $FPS"
enc="$mencoder -ovc x264 -oac copy -x264encopts crf=$CRF:trellis=1:threads=0:ratetol=inf:frameref=2:bframes=2:8x8dct:ssim:psnr:$X264OPTS"
echo $enc -o "$OUT" "$INPUT" $*
$enc -o "$OUT" "$INPUT" $*
Just run the script and give a .m2ts file as parameter. E.g.
sh avchd-mencode 000001.m2ts # or for all m2ts file in the current directory:
for i in ./*.m2ts; do sh avchd-mencode "$i"; done;
Let me know how it worked for you! Or if you have an idea how to improve the script. Try skipping frame for frame with the "." button in mplayer. Be aware that the file size of the resulting video may easily be bigger than the input. That's because you're creating full frames out of half ones, and storing them takes more space.
Check out a Squirrel in HD slow motion produced with this script and then "mencoder -speed 0.5 -af scaletempo -oac lavc -lavcopts acodec=ac3 -ovc copy" and uploaded in FullHD (but available only in 720p currently):
Subscribe to:
Posts (Atom)