How can I convert AVI files into MPGs with ffmpeg?
Solution 1
mpeg instead of mpg
ffmpeg -i file.avi -vcodec mpeg4 -f mpeg output.mp4
Solution 2
Thanks to Andreas Cadhalpun ffmpeg
now has new filter: mpeg4_unpack_bframes
(see ref).
Usage is as simple as:
ffmpeg -i INPUT.avi -codec copy -bsf:v mpeg4_unpack_bframes OUTPUT.mpg
Solution 3
I'd use MPEG Streamclip. It's really simple. Although they haven't updated the software in a while, I've been using the same version for years (most recently on my Intel Mac with OS 10.6.6). It's good for individual files. Not sure about batching. Good luck.
MPEG Streamclip is a powerful free video converter, player, editor for Mac and Windows. It can play many movie files, not only MPEGs; it can convert MPEG files between muxed/demuxed formats for authoring; it can encode movies to many formats, including iPod; it can cut, trim and join movies. MPEG Streamclip can also download videos from YouTube and Google by entering the page URL.
Related videos on Youtube
Rodrigo Amaro
Updated on September 17, 2022Comments
-
Rodrigo Amaro almost 2 years
I'll try to be very specific. Look, I have an input that sends an array:
echo "<input type='hidden' name='valortot[]' class='valor$rowid' disabled>";
Once I click in a radio button the disable is removed and the value is set:
Radio button:
<input class='radio$rowid' name='".$codintercot."[]' value='$mpreco' type='radio' onclick='calcval($rowid,$valortot)'>
$rowid
is the id of each row and$valortot
is the value got by javascript and once clicked is insert in the hidden input.The Javascript:
<script type="text/javascript"> function calcval(valor,valortot){ var valortot = valortot; var rowid = valor; var calcval = document.getElementsByClassName("valor"+rowid); for(var i = 0; i < calcval.length; i++) { calcval[i].value=valortot; calcval[i].disabled = false; } }
My problem is, when I send the array they're copied, duplicates can exist, like 2 itens with the same value, but not a copy next the value like this:
Array ( [0] => 2.44 [1] => 2.44 [2] => 3.7 [3] => 32.92 [4] => 32.92 )
It's odd, 2.44 and 32.92 were copied but not 3.7, how can I skip clones?
EDIT:
Oh I fould, I was enabling 3 at same time while I should just enable 1. But still thank you guys.
-
slhck over 13 yearsHave you tried repairing the file?
ffmpeg -i infile.avi -acodec copy -vcodec copy outfile.avi
-
xralf over 13 yearsYes, outfile.avi has the same problem.
-
-
xralf over 13 yearsThis writes error message: Unknown encoder 'aac'
-
xralf over 13 yearsI'm on Linux (Ubuntu).
-
jet over 13 yearsI edited my answer - try
-
xralf over 13 yearsThis writes: Error while opening codec for output stream #0.1 - maybe incorrect parameters such as bit_rate, rate, width or height
-
jet over 13 years
ffmpeg -i file.avi -vcodec mpeg4 -s 320x240 -b 300k -r 23.98 -acodec libmp3lame -ar 48000 -ab 112k output.mp4
- you can play with size and bitrate -
xralf over 13 yearsThe same error.
-
parsecer about 3 yearsI get
buffer underflow
error. When it finished converting, the video works, but there is no sound