command line video converting?
ok heres the situation
i use sabnzbd+ to get my tv episodes (legaly no different to recording them on a vcr) i then move them to my windows pc and use Omniquiti Lathe 1.8 ( a VERY old converting program) to convert the files into a smaller more archos friendly format. Now sabnzbd has the power to do postprocessing in the form of a script so heres what im after but have zero idea how to even start, a simple command line conversion program that can take the command from the post processing script which provides various varible names in the form of $4echo the format i need the converted files to is; video avi container frame width 424 (height and width not set in stone just needs to be widescreen and around these numbers maybe set height and keep aspect ratio? ) frame height 234 datarate 48kbps total bitrate 128kbps 25 frames per second codec xvid audio codec mpga (mp3 would work i think, ac3 etc doesnt) channels 2 (1 would be fine) sample rate 44100mhz bitrate 80kbps im thinking along the lines off NAMEOFPROGRAM $4echo videosettings/audiosettings $4echo-converted so it would convert it and rename the resaulting file (but as i say i have no idea) any and all help greatfully recieved for reference the archos im using is the "av700 tv" |
There are a multitude of cli converters on Linux. Indeed, there are many more command line options than gui ones, and the gui's are usually mostly front-ends for the cli programs.
For your purposes, I'd say ffmpeg is probably all you need. It's simple to use and the fastest encoder available. mplayer/mencoder is another option. I also like transcode, which is a cli frontend for various individual encoders, including ffmpeg and mencoder. Read the man pages thoroughly and check out some Google searches or whatnot to get an idea of the command syntax for each program. |
Quote:
first thank you for the prompt reply. i googled ffmpeg and that seems to be the key going through the documentation (after a swift drink to stop my eyes going crosseyed)i think this line will work ffmpeg -i input.avi -s 424x234 -aspect 16:9 -vcodec xvid -b 48kbps -acodec mpga -ac 2 -ab bitrate 80 output.avi though i will cahnge input.avi to $4echo and output.avi to Conv-$4echo (so i get test.avi as input conv-test.avi as output) i just have to install mpga codec xvid codec and ffmpeg to give it a test but dont have time tonight, to save hassle latter can you tell me if that above line will convert the media to the format ineed or if i have done any of the syntax wrong? thankyou in advance |
Quote:
ffmpeg -i input.avi -s 424x234 -aspect 16:9 -vcodec libxvid -b 48k -acodec libmp3lame -ac 2 -ab 80k output.avi btw. are you sure you wanna use a bitrate of 48kbit/s ? This will result in very bad quality with the chosen video size ... |
Quote:
so i did a google and found many outdated solutions none of which worked or where suggestions to use other programs arghhhhhhh this being the most promising http://stream0.org/2008/01/install-f...ntu-gutsy.html a few of the commands i had to change (three of the enables went goodbye and i had to change one sudo command ) all of the changes where using the onscreen text to help, for example the sudo command i changed said one of the files packages was navailable but had been replaced with such and such so i changed the replaced one with the such and such one and hay presto :) but i still get the error unknown codec libxvid, why oh why does linux have to be so user unfriendly !!!!! im out of time for tonight but any hints on how to get xvid codec installed much apreciated (i did check synaptic package installer but that didnt help) all software repositries are shown as ticked in software sources (about five of my google hits said i needed the restricted repository enabled ...but it is) im stuck im lost i must of missed something simple please help ****edit*** i decided to do the sudo checkinstall to see if i had messed it up aparently sudo checkinstall doesnt check it, it installs it so its now installed but i have a new error instead of unknown codec i get bash: /usr/bin/ffmpeg: No such file or directory im off to bash the computer till it finds it ....... found it in the local folder so set up a symbolic link...whatever that is (google told me to do it) sudo ln -s /usr/local/bin/ffmpeg /usr/bin/ffmpeg and now get a new error ffmpeg: error while loading shared libraries: libavdevice.so.52: cannot open shared object file: No such file or directory i hate linux i really hate it i do i do i do (sorry but atleast you can see im trying to fix it im not just rellying on you guys to fix it for me ...though im now out of ideas) |
It would be useful if you told more about your system (e.g. distribution you are using). I'm guessing it's ubuntu from what you said.
If so, how did you check that the 'restricted repository' is enabled ? you probably just have to replace 'libxvid' with 'xvid' and 'libmp3lame' with 'mp3' to make the command work. So reinstall ffmpeg and its dependencies and make sure you install the version from the medibuntu repository (that's the 'restricted' one) and then try again like that. ffmpeg -i input.avi -s 424x234 -aspect 16:9 -vcodec xvid -b 48k -acodec mp3 -ac 2 -ab 80k output.avi If it doesn't work, post the output of 'ffmpeg -formats | grep -e xvid -e mp3' |
ffmpeg / mencoder / transcode
The three main ones to convert video. VLC / Kaffeine For capturing from DVB and other things. There's a few sources that are not included in some distros. Licensing / legal deterrents and whatnot. Lame is source only iirc. libxvid libx264 libdvdcss and others to some degree as well. Obtainable from videolan.org by clicking on the developers link and the corresponding library. Is there some reason you're wanting xvid output? There are other options without having to install extra libs. mpeg2, mpeg4, mjpeg, x264, quicktime, ........ I use -f avi -vcodec msmpeg4v2 output.mp4 if I want decent quality and relatively low disk usage. Or -vcodec mpeg2video output.mpeg if it's destined for dvd. Or this ugly mess for the camcorder I'll be getting. ffmpeg -i $INFILE -sameq -an -deinterlace -f yuv4mpegpipe - 2> /dev/null \ | yuvfps -s 60000:1001 -r 60000:1001 \ | yuvscaler -n n -M RATIO_1920_960_1080_540 2> /dev/null \ | ffmpeg -f yuv4mpegpipe -sameq -i - \ -croptop 270 -cropright 480 -cropbottom 270 -cropleft 480 \ -vcodec mpeg2video -r 60000/1001 $VIDFILE |
Quote:
and found the repositry added it with the insstructions online ticked them all in software sources sudo apt-get install ffmpeg --fix-missing (last bit was a suggestion from the terminal) did the command unknown codec xvid (and libxvid) heres the output Code:
mrgreaper@horeseman:~$ ffmpeg -formats | grep -e xvid -e mp3 again your help is majoly appreciated |
ok i have tried the following today,
instaled w32codecs from both apt-get and synaptic package manager installed "non-free" codecs from synaptic package manager sudo apt-get remove ffmpeg installed it from here http://packages.medibuntu.org/hardy/ffmpeg.html the command line you showed me shows same build date as last time which is 2008 the package installed but on the site if you look at the name it says 2007 in it (so did it just reinstall the old one?) sudo apt-get remove again (wierd how so many commands start sudo, is it a spelling mistake like should be sodo?) installed ffmpeg from synaptic package manager (it said that it was the "risky" one with mp3 etc enabled ) at each stage i tried the ffmpeg command to encode with xvid and libxvid both unknown every time i dont get it i just dont get it, why is this so hard? all i want is an xvid codec a terminal based conversion tool i can tell to convert from a script and a simple easier life is ubuntu unfriendlyier then other destros? (i got the impression it was suposed to be the most user friendly ...now i want to throw it through a window (not mine of course that would be silly, its cold outside)) |
ok new post as its a new idea
ffmpeg is clearly not for users of my low skill so im trying mencoder Code:
mrgreaper@horeseman:~$ mencoder -ovc help Code:
mrgreaper@horeseman:~$ mencoder -oac help i go to the memcoder help novel(volumes 1 through 2million) and to be honest im finding it unhelpful mencoder -h pr --help or just plain help do nothing all i can understand is "mencoder test.avi -ovc xvid (VIDEO OPTIONS) -oac mp3lame (AUDIO OPTIONS) -o output.avi" seems to be the rough format the encoding to xvid page http://www.mplayerhq.hu/DOCS/HTML/en...feat-xvid.html is of no help whatso ever so my question, my on my knees and begging for help is this how do i turn ffmpeg -i input.avi -s 424x234 -aspect 16:9 -vcodec xvid -b 48k -acodec mp3 -ac 2 -ab 80k output.avi into a mencoder command ? |
mencoder input.avi -ovc xvid -oac mp3lame -xvidencopts bitrate=48:aspect=16/9 -lameopts br=80 -vf scale=424:234 -o output.avi
I wouldn't give up on ffmpeg so fast because it's really useful. From the output you have posted it seems as if you have the correctly compiled version, but the dependencies (libavcodec, libavformat ...) are wrong, because they have no support for mp3 and xvid encoding. Maybe you have wrecked your installation with your checkinstall action. I'd try to uninstall everything (and make sure everything with name libav* is gone under /usr/lib and /usr/local/lib), then install again (and make sure that all packages come from medibuntu repository). |
Quote:
again thankyou |
I think that part of the problem is that you have names for containers, names for codecs and names for formats that can get mixed up.
I don't think that mpga is the name of a codec. It is one of the names for an mpeg container that only contains an audio stream. A demuxing program may take an mpeg video file that contains a video and an audio stream and split it into two files. So you end up with your original program.mpg, and the two output files, program.mpga and program.mpgv. Take a look at the notice at the end of "ffmpeg -formats": Quote:
If your container supports mp3, then you may want to use that instead. |
Hi,
You may be starting off on the wrong foot by installing ffmpeg and MPlayer from the Ubuntu repositories. Can I suggest: http://ubuntuforums.org/showthread.php?t=786095 http://ubuntuforums.org/showthread.php?t=558538 These guides deal with ffmpeg and MPlayer compiled from svn. Both gentlemen who wrote these guides are quite active and will respond to queries promptly. Andrew |
All times are GMT -5. The time now is 10:05 PM. |