Saturday, July 20, 2013

Non-linear video editing with FFmpeg

... like AviSynth, but less shit, and more Linux support.
I call it...
FFeditor
(that's not a trademark violation or anything, is it?)

More information when I've finished squashing bugs and making it usable.

Labels: , , , , , ,

Wednesday, July 17, 2013

GUIDE: Restoring Windows Vista/7 backup files under Linux

If you've recently upgraded from Windows to Linux but now need to restore the backup files you made with Windows Backup (or need to restore someone else's), you've come to the right place!

The Windows Backup Format

Unlike the Windows NT BKF backup format, the Windows Vista/7 Backup utility uses regular ol' zip files to store data. Well, almost. Windows Backup (for some reason) splits the backups it makes into many parts, making restoring the files a pain. On my system, I got over 1000 zip files.

Microsoft's webpage suggests opening these (over 1000) zip files one by one to try and find my file. Yeah, right.

Luckily for us, the awesome power of BASH automation makes the job surprisingly simple.

What to do

Let's say that I want to recover the file Mr Bean at the Olympics.mp4 from my backups (true story!).
  1. Open up a terminal window.
  2. cd to the directory where the many, many zip files are stored.
    cd "/media/Seagate Expansion Drive/MY-LAPTOP/Backup Set 2013-06-10 103426"
  3. Run the following command, replacing the file name with the one you are looking for:
    for f in *.zip; do echo $f; unzip -l "$f" | grep 'Mr Bean at the Olympics.mp4'; done;
  4. A whole bunch of zip file names will flash by. Look for the line(s) that look something like
    Backup files 647.zip
     19129617  2013-06-10 15:48   C\Users\User\Desktop\Mr Bean at the Olympics.mp4
  5. This tells us that the file is located inside Backup files 647.zip.
  6. If you have too many zip files, you can use the alternative command:
    for f in *.zip; do echo $f>>/tmp/a.txt; unzip -l "$f" | grep 'Mr Bean at the Olympics.mp4'>>/tmp/a.txt; done;
    This will save the results of the search in /tmp/a.txt. Open this file up and use the search feature to find the relevant lines.

File listed in one zip file

If the output you got from the above command looks something like
Backup files 647.zip
 19129617  2013-06-10 15:48   C\Users\User\Desktop\Mr Bean at the Olympics.mp4
then congratulations! You get the easy way out. All you need to do is open up the relevant zip file and extract your file.

File listed in more than one zip file

If the output you got from the above command looks something like
Backup files 647.zip
 19129617  2013-06-10 15:48   C\Users\User\Desktop\Mr Bean at the Olympics.mp4
Backup files 648.zip
 19129617  2013-06-10 15:48   C\Users\User\Desktop\Mr Bean at the Olympics.mp4
Backup files 649.zip
 19129617  2013-06-10 15:48   C\Users\User\Desktop\Mr Bean at the Olympics.mp4
then unfortunately, there's a bit more work involved.
  1. Open up the first zip file (in this case, Backup files 647.zip).
  2. Extract the file.
  3. Rename the file, giving it a sensible name, putting -1 at the end (in this case, it would be Mr Bean at the Olympics.mp4-1).
  4. Go through the rest of the zip files, repeating steps 1 to 3, but using -2 and -3 and so on.
  5. You should now have several files:
    Mr Bean at the Olympics.mp4-1
    Mr Bean at the Olympics.mp4-2
    Mr Bean at the Olympics.mp4-3
    ...
  6. Go to the terminal and type:
    cat "Mr Bean at the Olympics.mp4-1">>"Mr Bean at the Olympics.mp4"
    cat "Mr Bean at the Olympics.mp4-2">>"Mr Bean at the Olympics.mp4"

    and so on.
  7. Finished! You can now delete all the -1 and -2... files.

Labels: , , ,

Sunday, July 14, 2013

GUIDE: Downloading MMS/RTSP/HTTP/etc streams with VLC

We all know that if you use YouTube, you can download the video from Keepvid or something. But what if your content provider uses some crazy streaming system? For example, one website (which shall remain nameless) that I use uses MMS to serve videos.

Disclaimer

Doing this may be a violation of the Terms of Service of your content provider. Check first, or risk the consequences!

The Steps

  1. Download and install VLC media player from the VideoLAN webpage, or through your distribution's software channels.
  2. Open VLC media player.
  3. From the Media menu, select Open Network Stream.
  4. Enter the URL of the stream you want to download and click the arrow next to the Play button. From the menu that appears, select Convert.
  5. Press the Browse button.
  6. Choose where you want to save the video and click Save.
  7. Unless you have a good reason not to, click the Dump raw input button.
  8. Click Start.
That's it! Hopefully, VLC will return you to the player window and the play button should turn into a pause button. This means that VLC has started saving the stream. When the pause button turns back into a play button, that means that VLC has finished.

Note: The player window will remain black while VLC is downloading the video. Don't panic! So long as the play button has turned into a pause button, the video is downloading.
If you want to watch the video while it downloads, open the video file in a separate window of VLC.

Labels: , , , , , ,

Thursday, July 11, 2013

Uplink Linux: libjpeg.so.62

If, after updating Uplink, you get the following error message:
error while loading shared libraries: libjpeg.so.62: cannot open shared object file: No such file or directory

The solution is to install the package libjpeg62. If you are on a 64-bit system, make sure to install the 32-bit version!

On a 32-bit Ubuntu system:
sudo apt-get install libjpeg62

On a 64-bit Ubuntu system:
sudo apt-get install libjpeg62:i386

Labels: , , ,