How do you split mpg files using a ffmpeg command?
Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
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
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.
.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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.