LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 04-03-2011, 04:54 PM   #16
rport
LQ Newbie
 
Registered: Apr 2011
Posts: 1

Rep: Reputation: 0
No problem to split with MP4Box


MP4Box seems to be another great tool to do things like this.

To split an .mp4 file into files of a maximum desired file size, e.g. 4000 kb, enter:

MP4Box -splits 4000 original_file.mp4

This will generate files original_file_001.mp4 , original_file_002.mp4 and so on.

There are also options for maximum duration in seconds, or for start and end time in seconds.

MP4Box comes with the gpac package (in my case version 0.4.5-1.pm.3.1 under SuSE 11.3)
and worked for me on first attempt.

Have fun!
 
Old 05-11-2011, 06:24 AM   #17
sarbojit
LQ Newbie
 
Registered: May 2011
Posts: 3

Rep: Reputation: 0
how to do this?

I have found this mail thread is quite help full for my current requirement. I tried some variation with given commands but did not get success.
Actually I wanted to convert a .VOB file into mp4 format but I wanted to convert it into small chunks.
Here as per the given example I can split a video file into same format like mpeg to mpeg but I want to split + convert at the same time. Please let me know if it is possible.

Commands that I have tried are below.
ffmpeg -i S.vob -vcodec copy -ss 00:01:00 -t 00:02:00 y.avi

Also when I am converting .VOB file into .AVI using below command, video quality is getting worst.
ffmpeg -i s.vob -f avi -vcodec mpeg4 -b 800k -g 300 -bf 2 -acodec libmp3lame -ab 128k z.avi
 
Old 05-11-2011, 07:57 AM   #18
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
Use '-qscale' and 2 pass encoding to get better quality, see:
http://htexmexh.byethost13.com/linux/encoding.html

I would split it before encoding, it's just easier. That way you can run a for loop, and encode them all.
 
Old 05-12-2011, 04:31 AM   #19
sarbojit
LQ Newbie
 
Registered: May 2011
Posts: 3

Rep: Reputation: 0
Thanks H_TeXMeX_H,
It helped, now I am getting same quality but facing a new problem now. Even though I am mentioning video and audio encoding formats as "-vcodec mpeg4" and "-acodec libmp3lame" but not able to play on IPAD. AFAIK, ipad supports mp4 then why it is not getting played? Do I need to set any other flag to make it IPAD compatible? The command that I am using is,
"ffmpeg -i S.vob -vcodec mpeg4 -vtag xvid -qscale 5 -s 640x272 -aspect 40:17 -r 23.976 -g 240 -bf 2 -acodec libmp3lame -ab 160k -ar 48000 -async 48000 -ac 2 test.avi "

Note: If I change the file name from test.avi to test.mp4 then it is giving error message. "[mp4 @ 01f8d010] Tag xvid/0x64697678 incompatible with output codec id '13'".

I actually need to convert vob files into a format which can be run on IPAD.
 
Old 05-12-2011, 08:09 AM   #20
H_TeXMeX_H
Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269Reputation: 1269
.mp4 is a format, so is .avi, so if it only plays .mp4, encode it to .mp4, not .avi.

Quote:
Video formats supported: H.264 video up to 720p, 30 frames per second, Main Profile level 3.1 with AAC-LC audio up to 160 Kbps, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; MPEG-4 video, up to 2.5 Mbps, 640 by 480 pixels, 30 frames per second, Simple Profile with AAC-LC audio up to 160 Kbps per channel, 48kHz, stereo audio in .m4v, .mp4, and .mov file formats; Motion JPEG (M-JPEG) up to 35 Mbps, 1280 by 720 pixels, 30 frames per second, audio in ulaw, PCM stereo audio in .avi file format
http://www.apple.com/ipad/specs/

It looks like .avi is supported, but only with mjpeg video and PCM audio, so do encode to .mp4.

I don't see why you don't use x264 instead tho, it's a better encoder and it is supported, and use AAC with it, and .mp4 format. See the same link I posted for x264 encoding. I hope it still works because ffmpeg syntax has changed recently, and I will have to update the guide.

Try:

Code:
ffmpeg -i input.vob -vcodec libx264 -vpre special -crf 15 -s 704x396 -aspect 16:9 -r 23.976 -threads 4 -acodec libfaac -ab 128k -ar 48000 -async 48000 -ac 2 -scodec copy output.mp4
You can use a different preset if you like, any will work, like 'hq'. Make sure to put the right resolution, aspect, FPS, etc.

Last edited by H_TeXMeX_H; 05-12-2011 at 08:12 AM.
 
  


Reply

Tags
file, how, mpg, split


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
where is the ffmpeg command line tool? leodemario Linux - Desktop 5 02-25-2007 03:11 PM
Need help with a short Linux command line script - working with split files bpmee Linux - Newbie 3 10-04-2006 02:08 AM
how does one use DD to recombine files from using pipe to split files originally? nerdful1 Linux - General 3 03-28-2006 07:46 AM
ffmpeg on slack 10.2 wmv to mpg Pier Slackware 2 01-05-2006 04:39 PM
mpg files MC62189 Linux - Newbie 3 01-14-2003 09:56 PM


All times are GMT -5. The time now is 09:01 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration