convert mpg to mp4
Hi all,
Please advise how to convert .mpg video file to .mp4. TIA Regards satimis |
Use conversion tools like ffmpeg (CLI), HandBrake (CLI and GUI) or even VLC:
Code:
ffmpeg -i video.mpg video.mp4 |
Use ffmpeg:
Code:
ffmpeg -i input.mpg output.mp4 Code:
HandBrakeCLI -Z Universal -i input.mpg -o output.mp4 |
Hi all,
Thanks for your advice. $ ffmpeg -i MOV_Ayala_Mall_01.MPG MOV_Ayala_Mall_01.mp4 Code:
ffmpeg version 0.8.13-4:0.8.13-0ubuntu0.12.04.1, Copyright (c) 2000-2014 the Libav developers $ which HandBrakeCLI No output. It may not be available Regards satimis |
I recommend 2 pass encoding:
Code:
ffmpeg -i input.mpg -vcodec libxvid -q:v 5 -s 640x480 -aspect 640:480 -r 30 -g 300 -bf 2 -acodec libmp3lame -ab 160k -ar 32000 -async 32000 -ac 2 |
Quote:
Quote:
Quote:
|
i like to use xvidenc (or its brother h264enc). heres my output:
Code:
schneidz@xbmc:~$ cat bin/xvidenc-ac3-mkv.ksh |
Hi all,
Thanks for your advice. Problem solved as follow; $ apt-get install libavcodec-extra-53 $ avconv -i file.mpg -c:v mpeg2video -q:v 2 -c:a libmp3lame output.mp4 Regards satimis |
The mpeg2 video codec is very old and have very bad compression. Would recommend at least mpeg4.
|
.mpg videos are usually MPEG2, so encoding your MP4 video in it does not make much sense, why changing format at all in that case?
Encoding to MPEG4 will not work, MPEG4 (or in short MP4) is a container format. I would recommend to encode to H.264 instead. Keep in mind that even if H.264 is the better codec the quality will decrease anyways when converting to that format. |
mpeg4/xvid/divx is also actually a video codec. It is also a contained format, the .mp4. It is a bit confusing, and device compatibility also varies.
|
Hi all,
Thanks for your advice. Also I'm confused here. mpg is the format of the Sony video camera in my possession. I have no idea whether I can change the format on recording. Which format would you recommend on conversion? My problem here is the huge size of the video. Putting the video in a container on my webpage it takes long time to load. I'm running WordPress. I'm considering uploading the video to YouTube or Vimeo and then embed using that link to the video. But the size of video is dead knot. Regards satimis |
The huge size is probably due to the nearly uncompressed mpeg2video. Here's the command I would use:
Code:
ffmpeg -i input.mpg -vcodec libx264 -crf 15 -s 640x480 -aspect 640:480 -r 30 -threads 4 -acodec libvo_aacenc -ab 128k -ar 32000 -async 32000 -ac 2 -scodec copy output.mkv http://johnvansickle.com/ffmpeg/ |
Quote:
Your command works for me. Thanks. Code:
avconv -i input.MPG -c:v mpeg2video -q:v 2 -c:a libmp3lame output.mkv Quote:
What I expect to achieve is reducing the video size without sacrificing its quality, if possible. Otherwise it takes long time loading the page. Regards satimis |
I linked the static builds because I know some distros ship with a broken ffmpeg. There is no real advantage to using them, except for convenience.
|
All times are GMT -5. The time now is 05:11 PM. |