Linux:software:video
From Linux How-To Repository
Video Playing
Playing Flash Video in Firefox on 64 bit Machine
UPDATE: Adobe have pulled their finger out and supplied a working libflashplayer.so
Everything below here is old news
This is for 64 bit systems only. I don't think it's a problem for 32 bit systems.
There are two ways. The first way is described here:
http://ubuntuforums.org/showthread.php?t=476924&highlight=flash
The second way, which involves installing Firefox 32bit, is described here:
https://help.ubuntu.com/community/AMD64/FirefoxAndPlugins?action=show&redirect=FirefoxAMD64FlashJava
The first way is very simple. Just download either of these tar.gz files:
Flash Version 48 (Older)> http://ubantu.homelinux.com/ktree/action.php?kt_path_info=ktcore.actions.document.view&fDocumentId=48
Flash Version 115 (Buggy) > http://ubantu.homelinux.com/ktree/action.php?kt_path_info=ktcore.actions.document.view&fDocumentId=47
Shut down Firefox, extract the tar.gz file you downloaded and double click on the "Get Flash" file. That's it.
I've found the the 115 version leaves you with blank patches on pages that have Flash visuals.
Also, with the older version I've found that on rare occasions, Firefox looses the ability to play flash.
All I have done to fix this was rerun the "Get Flash" file and everything worked again.
Playing DIVX Video in Firefox
This method may not work with mPlayer, however, you will be able to see web video, for example, on the Stage6 website.
First of all, you need to get the Media Player Connectivity add-on for Firefox. The last I checked, it was here: https://addons.mozilla.org/en-US/firefox/addon/446
This allows Firefox to use an external media player for whatever video you're playing.
Next, use Synaptics Package Manager to install some plugins:
gstreamer0.8-plugins gstreamer0.8-xvid totem-gstreamer (totem-mozilla) (apparently you install this if you want to skip using media player connectivity)
Once the installation is complete, restart Firefox. Go to Tools > Add-ons and the preferences for the Media Player Connectivity add-on. Check the box next to DIVX and in the text box next to it type /usr/bin/totem (or the path to the player you want to use) and save the setting.
This method can be used for other video formats. I haven't yet tried it for those yet, but it could be an all in one solution.
If a video doesn't start playing automatically, click the little "x" on the top right of the black video placeholder.
Video Conversion
*** All in One Update! ***
This link has a Nautilus script that does a lot of conversions:
http://www.gtk-apps.org/content/show.php/Audio%2BVideo%2BImage%2BText%2BISO+Convert?content=92533
- Convert multimedia files from one format to another, change size if desired
- Convert multimedia to audio-only files
- Convert audio files from one format to another. Both multimedia and audio can choose output bitrate
- Convert images from one format to another, and/or change image resolution (and jpg compression)
- Convert documents from one format to another
- Convert text to a .jpg file (an image of your text) or a .wav file (a voice reading your text)
- Convert multi-image files, like pdf or animated gif, into a series of frames
- Convert various "CD Image" files into standard .iso files
- Batch processing to apply conversion choices to all selected files in a single operation
- Originals are not overwritten. Generated files are named based on the source and conversion choices
NOTE: I haven't tested this thoroughly, but one conversion of wmv to flv didn't work.
WinFF is another option.
Convert WMV to FLV
ffmpeg -i input.wmv -s 640x480 -ar 44100 -b 96 output.flv
Convert WMV to AVI
ffmpeg -i input.wmv -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -an output.avi
Convert AVI to FLV
Lower quality, smaller file:
ffmpeg -i input.avi -b 1024k -s 320x240 -r 25 -acodec copy output.flv
Better quality, larger file:
ffmpeg -i input.avi -b 2028k -s 640x480 -r 30 -acodec copy output.flv
Convert DV to FLV
ffmpeg -i infile.dv -b 325k -ar 22050 -ab 24k -s 320x240 -aspect 4:3 outfile.flv
Convert FLV to MPG
ffmpeg -i jokes.flv -ab 56 -ar 22050 -b 500 -s 320×240 jokes.mpg
Concatenate and Convert FLVs to AVI
Simply navigate to where your FLVs are located via the terminal. Then run this routine:
for i in *.flv;do prefix=${i%.*}; mencoder "$i" -ovc xvid -oac copy -xvidencopts
fixed_quant=2:me_quality=6:trellis:chroma_opt:vhq=4:lumi_mask:profile=dxnhtntsc -o "$prefix".avi; done
Concatenate AVI into One File
Avimerge has worked well for me:
avimerge -o big.avi -i my_file1.avi my_file2.avi my_file3.avi
Here is another suggestion I have come across:
mencoder -oac copy -ovc copy -o all.avi 1.avi 2.avi 3.avi
Convert AVI to DVD in Six Command Line Steps
From: http://movabletripe.com/archive/merging-avis-into-a-single-dvd-on-linux/
This is for joining avi files---they might be on 2 CDs, for example---converting them into one file and then burning them onto a disc as a DVD video.
It can be done with 6 commands. Software needed:
* mencoder * ffmpeg * dvdauthor
1. First we concatenate the two or three or four AVI files:
cat first_avi_file.avi second_avi_file.avi > full_avi_movie.avi
Note that this worked for me but it hasn't at other times with other AVIs. Avimerge can be used.
2. Then use Mencoder:
mencoder -o full_avi_movie.avi -noidx -oac copy -ovc copy movie.avi
3. Now convert it into an MPEG. (Change ntsc-dvd to pal-dvd if you need to.)
ffmpeg -i movie.avi -y -target ntsc-dvd -sameq -aspect 16:9 my_mpg_movie.mpg
4. Now convert that MPEG into a directory with proper VIDEO.TS and IFO files.
dvdauthor --title -o movie_name -f my_mpg_movie.mpg
5. Next do the following:
dvdauthor -o movie_name -T
6. Now make the DVD structure into a burnable image:
mkisofs -dvd-video -o movie_name.iso movie_name/
Next you simply put in a disc and burn the ISO file.
To burn the file, this supposedly works:
growisofs -dvd-compat -Z /dev/dvd=dvd.iso
You can also skip the mkisofs step above and burn the files straight to disc something like this (change the -speed variable to suit your burner):
growisofs -dvd-compat -dvd-video -speed=4 -Z /dev/dvd ./dvd/*
Problems
I tried this with two halves of a movie, each around 700MB. What I ended up with was a 5.5G movie! If you run Wine, you can install DVD Shrink to reduce the ISO to an appropriate size for burning to DVD.
However, despite a number of tries, I also got sound missing for some 15 seconds or so at one place and a reduced frame rate at another. This did not happen if I used other conversion software, which I outline below.
Convert AVI to DVD With Less Problems
For the first part of this I followed the concatenation method using the command line, as outlined steps 1 and 2 above.
After that I used the following programs:
* Avidemux * DeVeDe * Kb3
Avidemux has plenty of configuration and filter options. That's why it's my choice for converting an AVI to MPEG. It seems to keep the size down as well.
Once that is done, DeVeDe does a good job of creating an ISO for you (actually, I think DeVeDe can do the AVI to MPEG step as well). Then use Kb3 to burn a disc, or simply right click on the ISO and select "Write to Disc".
Convert VOB to AVI in Two Command Line Steps
From: http://ubuntuos.com/?p=349
Combine VOB files if you need to into 1 file. Obviously, this will take up a bit of space depending on the size of each VOB, so take that into account.
cat *.vob > combined.vob
To compress the file, you have a choice of levels of compression.
vcd svcd dvd dv dv50
That is going from smallest to largest. In the example below, “svcd” is used because “vcd” is really bad quality, and “dvd” may be a tad large. You can also add “pal-” or “ntsc-” before one of the options in the list (eg, “pal-vcd”). Thus:
ffmpeg -i combined.vob -target svcd mymovie.avi
However, I found a problem in one instance where the size defaulted to a strange vertically elongated format. To prevent this, nominate the size you want as well.
ffmpeg -i combined.vob -target svcd -s 720x576 mymovie.avi
Apple iPod / Touch / iPhone Conversions
How Deeply Apple Sucks
After my wife purchased an iPod Touch she was disappointed to find how restrictive it's video formats were. It annoyed me, too. Apple's arrogant and moronic policy on this has no doubt annoyed a lot of people. It really is pathetic.
I've never had a smooth relationship with Apple, for one reason or another, going way back. I'm certainly not a fan of Apple employees, at least not those I used to encounter in Australia, with their arrogance and impatience at having to converse with peasantry like customers (it's good to see things are different in Korea). Some Apple users' attitudes have rubbed me up the wrong way, too. And added to all that, things like video format and iTunes restrictions really take the edge off what are otherwise good products.
But enough of my Apple rant . . . pretentious pricks. OK, now that's enough. Down to the business of overcoming the issues. And we don't want to be paying for a program by some company riding on the back of Apple's own money grabbing intransigence, do we? This is all going to be the free way.
Quick & Easy MP4 Video Conversion
What we need to do is convert video files from, say, AVI, to MP4, which will play on iPods or iPhones. After some investigation, here's the quick solution for me, using ffmpeg:
ffmpeg -i inputfile.avi -b 576k -s 480x320 -vcodec mpeg4 -ab 220k -ar 44100 -acodec libfaac outputfile.mp4
Replace inputfile and outputfile with the actual source and destination files. If ffmpeg tells you that "libfaac" is an "unknown encoder", try just "faac" or "aac" instead. Using "aac" works beautifully for me on Ubuntu 7.04.
The resolution is set for iPod Touch's screen, and I guess it could be 320x213 if you want to create a smaller file. But I wouldn't bother.
iPod Conversion Programs (Windows)
Most people recommend Videora for doing conversions in Windows. It can be found at http://www.videora.com/en-us/Converter/iPod/ This program seems to work OK, but for all the time it takes to convert files, you could actually watch them and still have time to spare to go for a jog with your old music iPod.
Another free program that works well is Any Video Converter, found at http://www.any-video-converter.com/products/for_video_free/ It's pretty good, but it's video resolution setting doesn't go up to the 480x320 setting I wanted, so I tend not to use it.
Also for free is Cheetach iPod Video converter at http://www.download.com/Cheetah-IPod-Video-Converter/3000-2194_4-10761057.html I haven't tested this one yet.
Another program I tried was Winff, for Windows or Linux, found at http://biggmatt.com/winff/ It is basically a GUI frontend for ffmpeg, a famous video encoder. It seems to work quite well, and also seems to be quicker than using Videora. However, I think you need to convert again once your video file has been copied into iTunes. As sometimes happens with converted files that will not load into iPod Touch, you have to right-click on the file and select the conversion you want iTunes to do for you. This can take a while and adds to the total conversion time.
The free Windows program I like to use at the moment is Free Video to iPod Converter, which is a no-nonsense converter and gets the job done pretty quickly. It can be found at http://www.dvdvideosoft.com/products/dvd/Free-Video-to-iPod-Converter.htm The quality seems fine.
Some programs I have yet to check out are MeGUI at http://mewiki.project357.com/wiki/MeGUI:Main_Page, XviD4PSP at http://www.winnydows.com/xvid4psp.html and StaxRip at http://www.planetdvb.net/staxrip. As far as I know, they all require .NET framework to be installed, and you have to download and install other things to get them to work. It may or may not be worth the effort.
Have a look here for more: http://www.videohelp.com/tools.
I've also heard VisualHub is good for Mac. It's not free, but if interested it's at http://www.techspansion.com/visualhub/
Few of these worked for me in Wine, except Winff. I couldn't use the Linux version of it because it wasn't for 64 bit Linux. Winff worked fine in Wine. But while it would work in iTunes, it would not work in iPod Touch. So, I had to use iTunes to convert it.
HandBrake, the Excellent DVD Ripper
From what I've read, the consensus is that the best program to use for converting DVD to the appropriate iPod/iPhone format is the multi-platform program Handbrake. It can be found at http://handbrake.m0k.org/ In Linux, you run it from the command line. I investigated this and tried it with good results on my 32 bit Linux laptop. However, a distribution for 64 bit Linux was not available and I wanted to use HandBrake on my faster 64 bit Linux box. So, I downloaded the source from the HandBrake site and compiled it yourself. Here's how it was done.
First, download the source to your desktop and extracted the HandBrake directory. Next, open a command line terminal and navigate to that directory and simply run these compile commands:
./configure jam
Of course, you will need to have Jam installed, and that's easy enough to do with Synaptic Package Manager or by using apt-get. Jam just takes the place of the traditional make.
It will attempt to compile HandBrake but you may get some errors about targets being skipped, like this:
...failed updating 2 target(s)... ...skipped 2 target(s)...
These will relate to problems similar to these:
Error - we have detected a version of faac that has libmp4v2 support and no copy of mpeg4ip-config. This means faac was built with faad2 and the libraries will be incompatible. Please reinstall faac without mp4v2 support [. . .] ...failed LibMp4v2 contrib/lib/libmp4v2.a ... Cc libhb/muxmp4.o libhb/muxmp4.c: In function ‘MP4Init’: libhb/muxmp4.c:45: error: too few arguments to function ‘MP4Create’ libhb/muxmp4.c:63: warning: implicit declaration of function ‘MP4AddH264VideoTrack’ libhb/muxmp4.c:70: warning: implicit declaration of function ‘MP4AddH264SequenceParameterSet’ libhb/muxmp4.c:72: warning: implicit declaration of function ‘MP4AddH264PictureParameterSet’ libhb/muxmp4.c:79: error: ‘MPEG4_SP_L3’ undeclared (first use in this function) libhb/muxmp4.c:79: error: (Each undeclared identifier is reported only once libhb/muxmp4.c:79: error: for each function it appears in.)
Do not despair! The fix for this is to temporarily move the /usr/lib/libmp4v2* and /usr/bin/faac files in question to your desktop or somewhere out of the way. Now run "jam" again.
If all goes well, it should compile a HandBrakeCLI for you, which you just have to copy into /usr/bin. Then you simply move back the files you moved before, libmp4v2* and faac, to their rightful directories.
Put a DVD in your DVD drive and test it out. Here is something similar to the command I use to grab a TV show from a series on a DVD
HandBrakeCLI -i /media/cdrom0/video_ts -o DVD_TV_Show.mp4 -t 2 -w 480 -l 320 -e x264
The -i and -o are straight forward, standing input and output (file), respectively. The -t is the title number of the show. The -w and -l are width and height for iPod Touch. The -e is for the encoding method and its parameter, x264, is sometimes cited as the best to use. I find this command, which largly relies on defaults, is adequate for me.
Here are a few other commands others have used:
HandBrakeCLI -i file.iso -o file.mp4 -t 2 -e x264 -q 0.5 -2 -T
HandBrakeCLI -f mp4 -i /dev/cdrom -o $1 -t $2 -e ffmpeg -E faac -w 320
Check out the HandBrakeCLI guide at http://handbrake.m0k.org/trac/wiki/CLIGuide for more.
The Script Method of Encoding H.264 Video
Yet another method was to use the script I found at the site: http://slated.org/howto_transcode_h264_for_ipod_with_ffmpeg Actually there are two scripts on the page, the main one and a small Perl script at the bottom. Simply follow the instructions and you'll have a converted MP4 in now time. To run the script, which you are asked to call podit, just do this:
podit inputfile.avi
The output will appear in your /home/user/tmp directory as inputfile.podit.mp4. You can change settings in the podit script file, such as resolution and the output file name. I was getting an error when I first ran it, saying that the b-frame rate could not be 0. I just looked in the podit script and found changed the -bf parameter to 1 in the long ffmpeg command. I don't know what that does, really, but it worked.
I also hashed out the MP4Box line. The author states that the output file may not work in iTunes without MP4Box, but will work in your iPod. Well, I found the opposite to be true. As with Winff, it worked in iTunes but I could not get it to load into iPod Touch. You can go to the trouble to download and compile GPAC for MP4Box, but I couldn't be bothered. I found a Windows exe of it and copied that into a Wine directory. I then changed the script to used Wine and this MP4Box.exe to do whatever it was supposed to do. It was a long shot, and it didn't work. In fact, using MP4Box made everything worse.
I've now hashed MP4Box out of the script. This script creates a good quality and clear version of your video. You only then need to add it to iTunes and use the iTunes' right-click conversion to get it to work for iPod Touch.
In terms of time, this probably takes as long as Videora, but then you have to add on the conversion time as well, which is also long.
Getting Rid of iTunes
Another problem with the iPod Touch I was not aware of was that it is not recognized as an external hard disk--no icon for it shows up and it doesn't automatically mount as a normal iPod will--so, you cannot use any of the existing alternative iPod management programs to copy files back and forth between and iPod and your computer.
This means one is at the mercy of iTunes. Already I've had unknown error messages pop up, which I had to fix by playing around with sound and head phone settings--I mean, WTF? At other times, iTunes simply does not see the iPod. And that truly fits the definition of being up shit creek without a paddle. Restarting does not solve it. You have to completely shut down and restart. For all of this, Apple, you suck more--deeper and harder.
I've searched a lot, but was disappointed to find that Yamipod does not support iPod Touch, nor do any other management programs except Touchcopy, which can be found at http://www.wideanglesoftware.com/touchcopy/ The problem is that you have to pay for it. But I'm reaching the point where I just might. I'll try it and see.
I'm sure many programs already out there will eventually have the functionality to work with iPod Touch. They are desperately needed, given the amount of angry and disappointed people on forums.
Current Preferred Method
For the moment, the command shown first above is the quickest and easiest way to get a file converted and ready to put into iTunes then on onto your iPod Touch. If I want a better quality video, it's easiest to use either the script or Free Video to iPod Converter. For conversion from DVD, I'm more than happy to use HandBrake.
As for an iPod Touch manager, I'm waiting for something decent to come out. I'm sure it will in time. Then I'm going to take please in saying goodbye to random errors and occasions when Touch is not recognized by uninstalling iTunes.
Links
Perhaps useful info: http://www.linuxjournal.com/article/9005
