Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 22 Aug 2014, 15:59
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Anyone know command line FFmpeg for Xvid & Ac3?
Post new topic   Reply to topic View previous topic :: View next topic
Page 2 of 2 [25 Posts]   Goto page: Previous 1, 2
Author Message
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Tue 03 Nov 2009, 05:15    Post subject:  

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 ?
Back to top
View user's profile Send private message 
gposil


Joined: 06 Apr 2009
Posts: 1305
Location: Stanthorpe (The Granite Belt), QLD, Australia

PostPosted: Tue 03 Nov 2009, 05:23    Post subject:  

to join video files...

Quote:
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....

_________________
Dpup Home
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Makoto


Joined: 03 Sep 2009
Posts: 1789
Location: Out wandering... maybe.

PostPosted: Tue 03 Nov 2009, 10:01    Post subject:  

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. Embarassed

(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.

_________________
[ Puppy 4.3.1 JP, Frugal install | 1GB RAM | 1.3GB swap ] * My Pidgin Builds for Puppy 4.3.1+
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).

Last edited by Makoto on Tue 03 Nov 2009, 10:12; edited 1 time in total
Back to top
View user's profile Send private message 
gposil


Joined: 06 Apr 2009
Posts: 1305
Location: Stanthorpe (The Granite Belt), QLD, Australia

PostPosted: Tue 03 Nov 2009, 10:05    Post subject:  

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...
_________________
Dpup Home
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Makoto


Joined: 03 Sep 2009
Posts: 1789
Location: Out wandering... maybe.

PostPosted: Tue 03 Nov 2009, 10:16    Post subject:  

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


...but did that include Handbrake? Smile

Edit: Hmm... wonder if VOB2MPG would work under Wine...

_________________
[ Puppy 4.3.1 JP, Frugal install | 1GB RAM | 1.3GB swap ] * My Pidgin Builds for Puppy 4.3.1+
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
Back to top
View user's profile Send private message 
gposil


Joined: 06 Apr 2009
Posts: 1305
Location: Stanthorpe (The Granite Belt), QLD, Australia

PostPosted: Tue 03 Nov 2009, 10:33    Post subject:  

Handbrake uses FFmpeg for that very thing...it is good but too large to include as standard Puppy feature...FFmpeg has no problems converting vobs to mpeg, or any other codec for that matter(provided you've compiled FFmpeg with the codec support you want)...

What sunburnt was getting at was creating a simple GUI to access the enormous range of features FFmpeg has...without resorting to PupFF/WinFF or Handbrake.

_________________
Dpup Home
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Makoto


Joined: 03 Sep 2009
Posts: 1789
Location: Out wandering... maybe.

PostPosted: Tue 03 Nov 2009, 15:25    Post subject:  

Well, yes, but I was mainly wondering if he'd tried it. Smile
_________________
[ Puppy 4.3.1 JP, Frugal install | 1GB RAM | 1.3GB swap ] * My Pidgin Builds for Puppy 4.3.1+
In memory of our beloved American Eskimo puppy (1995-2010) and black Lab puppy (1997-2011).
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Tue 03 Nov 2009, 16:41    Post subject:  

I`m working with vobcopy to try to improve it at the moment.
But if I get more time and I get FFmpeg working well I may try it.
I`m thinking of a GUI that does simple conversions, not all FFmpeg`s options.
I use to make TV stuff, but not any more, now I only do full size and quality.
So V & A codec selection, bit rate or sameq ( same quality ), simple stuff.

### I need to figure out how to select the audio streams, I got Spanish...
Back to top
View user's profile Send private message 
sunburnt


Joined: 08 Jun 2005
Posts: 5016
Location: Arizona, U.S.A.

PostPosted: Thu 05 Nov 2009, 17:29    Post subject:  

gposil; Your Dpup FFmpeg combo seems to be doing what avidemux can`t.
avidemux just can`t seem to get the sync correct ever, I`ve given up on it.

I want to fine tune my command lines for a GUI I`m making, so... Qs:

1) To set file size instead of bit rate I used: -fs , but I got a 800MB file.???
I substituted -fs 1500000000 for -b. Will it take -fs 1500m or -fs 1500000k.?
Using file size is best, big movie = 2 on a DVD, smaller = 3, Animated = 4.

2) So I used -b , but for a 1,200MB file I had to use: -b 3000k !!! ... ???

3) Should I use x264 or h264 instead of Xvid, are they really much better?
264s don`t work in player boxes right now, but that will probably change.
If 264 is a good idea, what optimized command line is best for it?

Below is my command line, could you make any suggestions to improve it?
Code:
ffmpeg -i /mnt/sdb5/V/Movie/-l1-2.vob -vcodec libxvid -b 3000k -acodec ac3 -ab 192k -f avi -g 300 -bf 2 /mnt/sda6/v/movie.avi
Back to top
View user's profile Send private message 
gposil


Joined: 06 Apr 2009
Posts: 1305
Location: Stanthorpe (The Granite Belt), QLD, Australia

PostPosted: Thu 05 Nov 2009, 20:32    Post subject:  

I find using this bitrate calculator works well for determining the right settings for -b

The format is kilobits/sec

Say for arguments sake your movie is 1 hour 30 minutes in length, and you want to limit filesize to 700Mb, your audio bitrate is 192k, then the calculator would return a require video bitrate of 869 kilobits/sec...So command line would be

Quote:
ffmpeg -i /mnt/sdb5/V/Movie/-l1-2.vob -vcodec libxvid -b 869 -acodec ac3 -ab 192 -g 300 -bf 2 /mnt/sda6/v/movie.avi


and for x264 it would be

Quote:
ffmpeg -i /mnt/sdb5/V/Movie/-l1-2.vob -vcodec libx264 -b 869 -acodec ac3 -ab 192 -g 300 -bf 2 /mnt/sda6/v/movie.avi


The Advantage in using x264 is the vastly reduced file size, but as you say it is not a standard in player boxes yet..although quite a few do it...

I hope that helps... Smile

Cheers
Guy

_________________
Dpup Home
Back to top
View user's profile Send private message Visit poster's website MSN Messenger 
Display posts from previous:   Sort by:   
Page 2 of 2 [25 Posts]   Goto page: Previous 1, 2
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0711s ][ Queries: 12 (0.0074s) ][ GZIP on ]