Anyone know command line FFmpeg for Xvid & Ac3?

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

Anyone know command line FFmpeg for Xvid & Ac3?

#1 Post by sunburnt »

Not exactly programming, but this seemed a better place than the Users forum.

I`m trying to make ffmpeg work because none of the GUIs will work.
I run ffmpeg and get the error: ffmpeg: unrecognized option '-i /mnt/hdb5/0/movie.avi
It`s hard to believe that "-i" and the input file is an unknown option...
Here`s the command line I used and ffmpeg`s output:

Code: Select all

 IN='-i /mnt/hdb5/0/movie.avi'
VO='-vcodec libxvidcore.so.4.1.0 -r 29.97 -sameq -b 2500 -pass 1 -passlogfile /mnt/hdb5/0/movie.log -deinterlace'
AO='-ab 224k'
OUT='-f avi -g 300 -bf 2 /mnt/hda5/0/movie.avi'
ffmpeg "$IN" "$VO" "$AO" "$OUT"
FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2007 Fabrice Bellard, et al.
  configuration: --prefix=/usr --libdir=/usr/lib --mandir=/usr/man --disable-debug --arch=i386 --enable-libmp3lame --enable-liba52 --enable-libogg --enable-libvorbis --enable-pthreads --enable-small --enable-gpl --enable-shared --enable-pp
  libavutil version: 49.5.0
  libavcodec version: 51.44.0
  libavformat version: 51.14.0
  built on Oct 23 2007 22:05:00, gcc: 4.2.2
ffmpeg: unrecognized option '-i /mnt/hdb5/0/movie.avi'
One thing I noticed is that the Xvid codec is not listed by ffmpeg.
I copied the Xvid library to /usr/lib, but I guess that may not be enough.
Also I noticed most examples use: "-vcodec libxvid" without the rest
of the Xvid library`s file name file, maybe they have a link?
It didn`t complain about that, but the error is so odd that who knows?

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#2 Post by sunburnt »

Surely someone here has used FFmpeg at the command line..!

User avatar
trapster
Posts: 2117
Joined: Mon 28 Nov 2005, 23:14
Location: Maine, USA
Contact:

#3 Post by trapster »

I am no expert with ffmpeg but I use this to convert the size of movies for my phone.

Code: Select all

ffmpeg -i "TheGoldenCompass.mp4" -s 320x240 -aspect 4:3 -b 1250k -ab 80k "TheGoldenCompass1.mp4"
trapster
Maine, USA

Asus eeepc 1005HA PU1X-BK
Frugal install: Slacko
Currently using full install: DebianDog

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#4 Post by gposil »

sunburnt,

your version of ffmpeg is not compiled with libxvid support, that is why it won't work.
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#5 Post by sunburnt »

gposil; That`s what I suspected, and I`m sure the same goes for x-h264 and AC3.
Whats the chances of getting one that has been compiled properly?
Do you have a copy of ffmpeg that`s been "fixed" ?

trapster; There`s so many examples it`s dizzying, my needs are simple.
Convert to Xvid or x-h264, keep the AC3 audio, maybe transcode it`s bit rate lower.

ALSO... I haven`t seen any examples of loading several video files into ffmpeg.
Or examples of using it to join separate video files together end to end..

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#6 Post by gposil »

sunburnt,
I'm doing a recompile of ffmpeg for dpup482beta5, and it includes all the codecs you would want, it won't be ready till probably Tuesday though...I'll post the link to it here when it's done...Hope that helps.

Cheers
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#7 Post by sunburnt »

gposil; That is killer! I want to dump Puppy400, but no other Puppy has worked.
Then I tried Dpup and I love it, I have Debian experience and it worked great...
Just that "load SFS file to ram no matter what" problem so Firefox lacked ram to run.
Let me know... And many thanks... Terry

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#8 Post by gposil »

sunburnt,

below is link to ffmpeg upgrade for dpup...it will not work in other puppies, it has just about all codecs known to man and dog...hope that helps...

http://dpup.org/test/dpup482beta4-2.6.3 ... pgrade.pet

Cheers
Guy
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#9 Post by sunburnt »

Thanks Guy; I`ll be working on this today, I`ll let you know how it goes.
I ran Dpup all night to see if it had any problems.. Nope, not a one!
Got up this morning and it responded to the mouse and was running fine.

User avatar
mikeb
Posts: 11297
Joined: Thu 23 Nov 2006, 13:56

#10 Post by mikeb »

Avidemux uses the shared Xvid library and not avcodec.

mike

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#11 Post by sunburnt »

gposil; I`ve tried your Dpup ffmpeg.pet and I`m getting the same error:

Code: Select all

# ffmpeg -i /mnt/sda6/V/tropicT/-1-1.vob -vcodec libxvidcore.so.4.2 -sameq -b 1500 -ab 224k -f avi -g 300 -bf 2 /mnt/sda3/v/tropic-1.avi

FFmpeg version 0.5, Copyright (c) 2000-2009 Fabrice Bellard, et al.
  configuration: --prefix=/usr --enable-libfaac --enable-libfaad --enable-libmp3lame --enable-libschroedinger --enable-libtheora --enable-libx264 --enable-libxvid --enable-libvorbis --enable-gpl --enable-x11grab --enable-pthreads --enable-postproc --enable-swscale
  libavutil     49.15. 0 / 49.15. 0
  libavcodec    52.20. 0 / 52.20. 0
  libavformat   52.31. 0 / 52.31. 0
  libavdevice   52. 1. 0 / 52. 1. 0
  libswscale     0. 7. 1 /  0. 7. 1
  libpostproc   51. 2. 0 / 51. 2. 0
  built on Oct 25 2009 17:22:15, gcc: 4.3.2
ffmpeg: unrecognized option '-i /mnt/sda6/V/tropicT/-1-1.vob'
I don`t know what the -g option does exactly, -bf is the number of B frames.
I`ve tried removing arguments to see if it helped, same error no matter what.
I`m puzzled by the error that it doesn`t recognize the -i option? Weird !!!

I have been using avidemux but almost all of them have really bad sync.
All ripped with pupdvdtool and the vobs play just fine. I`m getting nowhere.

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#12 Post by gposil »

sunburnt...command should be
ffmpeg -i /mnt/sda6/V/tropicT/-1-1.vob -vcodec libxvid -acodec ac3 -sameq -b 1500 -ab 224k -f avi -g 300 -bf 2 /mnt/sda3/v/tropic-1.avi
Cheers
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#13 Post by sunburnt »

gposil; It`s running! ( at last ) Many thanks my friend... Terry

I`m working on a replacement for pupdvdtool, I found a few flaws in it.
And I may work up a simplified GUI for ffmpeg also, a lot more work though.

# Qs;
1) Is there a way to get ffmpeg to append or load more than one input file?
2) Can ffmpeg multiplex separate V & A files together?
3) Your line put V & A codec declares first and bit rates after, is this needed?

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#14 Post by gposil »

1.) You can batch convert with ffmpeg simply using a script...like the following:
ls *.flv | while read file; do
echo $file
ffmpeg -i "$file" "${file%.flv}.avi"
done
2.) You would combine an audio and Video stream like this:
ffmpeg -i break-video.m2v -i break-audio.mp3 no-saving-the-bugle.flv
If the two streams differ in time length you can use the -itsoffset switch.
FFmpeg can quite easily strip streams out of a file also, using -vn and -an switches..

3.) It doesn't matter where the codec declarations go...

FFmpeg is a marvelous tool but it is complicated, no not complicated just a little cryptic... :)

Cheers
Guy
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#15 Post by disciple »

1) They want to know how to join several files together, one after the other... I can't remember now whether ffmpeg can do that.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#16 Post by sunburnt »

So to get only one input file, join the vobs first... Or join the avis afterwards...

Any suggestions as to what to do that with? cp or maybe dd ?

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#17 Post by gposil »

to join video files...
A few multimedia containers (MPEG-1, MPEG-2 PS, DV) allow to join video files by merely concatenating them.

Hence you may concatenate your multimedia files by first transcoding them to these privileged formats, then using the humble cat command (or the equally humble copy under Windows), and finally transcoding back to your format of choice.

ffmpeg -i input1.avi -sameq intermediate1.mpg
ffmpeg -i input2.avi -sameq intermediate2.mpg
cat intermediate1.mpg intermediate2.mpg > intermediate_all.mpg
ffmpeg -i intermediate_all.mpg -sameq output.avi

Notice that you should either use -sameq or set a reasonably high bitrate for your intermediate and output files, if you want to preserve video quality.

Also notice that you may avoid the huge intermediate files by taking advantage of named pipes, should your platform support it:

mkfifo intermediate1.mpg
mkfifo intermediate2.mpg
ffmpeg -i input1.avi -sameq -y intermediate1.mpg < /dev/null &
ffmpeg -i input2.avi -sameq -y intermediate2.mpg < /dev/null &
cat intermediate1.mpg intermediate2.mpg |\
ffmpeg -f mpeg -i - -sameq -vcodec mpeg4 -acodec libmp3lame output.avi

Similarly, the yuv4mpegpipe format, and the raw video, raw audio codecs also allow concatenation, and the transcoding step is almost lossless.

For example, let's say we want to join two FLV files into an output.flv file:

mkfifo temp1.a
mkfifo temp1.v
mkfifo temp2.a
mkfifo temp2.v
mkfifo all.a
mkfifo all.v
ffmpeg -i input1.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp1.a < /dev/null &
ffmpeg -i input2.flv -vn -f u16le -acodec pcm_s16le -ac 2 -ar 44100 - > temp2.a < /dev/null &
ffmpeg -i input1.flv -an -f yuv4mpegpipe - > temp1.v < /dev/null &
ffmpeg -i input2.flv -an -f yuv4mpegpipe - > temp2.v < /dev/null &
cat temp1.a temp2.a > all.a &
cat temp1.v temp2.v > all.v &
ffmpeg -f u16le -acodec pcm_s16le -ac 2 -ar 44100 -i all.a \
-f yuv4mpegpipe -i all.v \
-sameq -y output.flv
rm temp[12].[av] all.[av]
From the manual.....

In other words, after you read all that...vobs, being just mpeg2 video with ac3 audio, you should be able to just cat them together then use ffmpeg to convert the result to avi....
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
Makoto
Posts: 1665
Joined: Fri 04 Sep 2009, 01:30
Location: Out wandering... maybe.

#18 Post by Makoto »

Actually, not quite. That's the same as saying you can rename a .vob to .mpg/.mpeg without any problems. It may work for you, but then, it may just as likely not work. There's more to a .vob file than just an MPEG-2 video stream... but I don't remember exactly what. :oops:

(searches) Simple explanation from VideoHelp: . VOB = The VOB files contains the actual video,audio,subtitles and menus.

...so it can contain the bitmapped (VobSub) subtitle streams, still menu backgrounds, multiple angles, multiple audio streams, etc. - and note that a .vob doesn't necessarily contain a complete version of whatever video(s) are within it, of course.
Last edited by Makoto on Tue 03 Nov 2009, 14:12, edited 1 time in total.
[ Puppy 4.3.1 JP, Frugal install ] * [ XenialPup 7.5, Frugal install ] * [XenialPup 64 7.5, Frugal install] * [ 4GB RAM | 512MB swap ]
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).

User avatar
gposil
Posts: 1300
Joined: Mon 06 Apr 2009, 10:00
Location: Stanthorpe (The Granite Belt), QLD, Australia
Contact:

#19 Post by gposil »

Then the intelligent thing to do would be to use FFmpeg to convert the vobs to mpeg2, then join them, then convert the result to xvid...
[img]http://gposil.netne.net/images/tlp80.gif[/img] [url=http://www.dpup.org][b]Dpup Home[/b][/url]

User avatar
Makoto
Posts: 1665
Joined: Fri 04 Sep 2009, 01:30
Location: Out wandering... maybe.

#20 Post by Makoto »

Could Handbrake (http://handbrake.fr/) work for transcoding the DVD files into a single video file, perhaps? I know sunburnt stated:
I`m trying to make ffmpeg work because none of the GUIs will work
...but did that include Handbrake? :)

Edit: Hmm... wonder if VOB2MPG would work under Wine...
[ Puppy 4.3.1 JP, Frugal install ] * [ XenialPup 7.5, Frugal install ] * [XenialPup 64 7.5, Frugal install] * [ 4GB RAM | 512MB swap ]
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).

Post Reply