

It might better or worse when outputting to an. Fixed with this: ffmpeg -i recoded.avi -c copy recoded-fixed.avi As a result, the video played only halfways. I had errors regarding non monotonically increasing dts to muxer. Or, for re-encoding into AVI XVID with low-end mp3 sound, go: ffmpeg -f concat -i list.txt -ab 128k -acodec libmp3lame -b 5000k -vcodec mpeg4 -vtag XVID recoded.avi If the files all have the same format, re-encoding may not be necessary, so just go ffmpeg -f concat -i list.txt -c copy concat.avi First, prepare a list of files to handle, say as list.txt with the following format file 'file1.avi' Stitching several video clips can be handy. This is a bit of clumsy solution, but I haven’t seen anything more elegant around. The Perl one-liner script just looks for the last occurrence of a time stamp. Using the copy encoder (-c copy) is somewhat inaccurate but fast (the copy encoder counts in non-video frames at the end, if such exist). The trick is to extract the last timestamp that is given during an encoding of the data into null. So this gives the actual length: ffmpeg -i clip.mp4 -c copy -f null - 2>&1 | perl -e 'local $/ $a=~ /time=(+)/g) print "$x\n" '
#Ffmpegx avidivx download#
If the file has been truncated by a partial download or something, this is noticed only when the file is played. Surprisingly enough, this can be done with exiftool too: exiftool -T -Duration clip.mp4īut there’s a problem with these two commands: They output the duration of the file according to the metadata. Note that ffprobe supports a wide range of output formats, including JSON, CSV etc. Getting the length of a video (the -pretty flag makes it display it in human-readable format, as opposed to number of seconds): ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1 -pretty clip.mp4 ffmpeg -i clip_mjpeg.avi -threads 16 -qmin 10 -qmax 51 -i_qfactor 0.71 -qcomp 0.6 -qdiff 4 -trellis 0 -vcodec libx264 -acodec libmp3lame -aspect 16:9 -b 10M -ab 128k -y clip.mp4
#Ffmpegx avidivx mp4#
I suppose this should be done in a dual pass, but since I needed MP4 merely as a backup, so be it. Also, mp3 is used rather than AAC, because libfaac isn’t supported on my computer, and choosing -acodec aac lead to a warning about using an experimental codec. The result isn’t very impressive, despite the 10Mbit/s rate. Playing a video with an external mono soundtrack, listening in stereo (very good when working only on audio track, so there’s no need to render the video all the time): $ mplayer -audiofile sound.wav -af channels=2:2:1:0:1:1 rendered_video.aviĭumping keyframes from an MPEG video stream (don’t ask me why this is necessary) mplayer clip.avi -benchmark -nosound -noaspect -noframedrop -ao null -vo png:z=6 -vf framestep=IĬreating an HD MP4 video. Or convert a 30 fps video to 25 fps (making the voice sound unnaturally dark, but other sounds are OK): $ mencoder -speed 25/30 -ofps 25 -srate 44100 -vf harddup MVI_7613.avi -ovc copy -oac pcm -o weird_MVI_7613.aviįix brightness, contrast and saturation on a MJPEG video, resulting in an MJPEG video $ mencoder -vf harddup,eq2=1.0:1.2:0.2:1.2 mjpeg_MVI_7608.avi -oac copy -ovc lavc -lavcopts vcodec=mjpeg -ffourcc MJPG -o. $ mencoder -speed 1/3 -ofps 30 -srate 44100 -vf harddup MVI_7596.avi -ovc copy -oac pcm -o slowmo_MVI_7596.avi See more below on playing with video / audio rates. Without the -ofps and -srate arguments, I would get 10 fps and some weird sound rate, which could possible mess up video players and video editing software. Note that in this example, the input frame rate was 30 fps (and I wanted to keep it, hence the -ofps 30) and input audio rate was 44100, which I also wanted to keep. Using mencoder to create a slow motion version of a video.

The other way around: A 10 fps AVI video clip from images (Blender output): $ ffmpeg -r 10 -f image2 -i %04d.png -b 1000k -vcodec mpeg4 -vtag XVID clip.avi This is more or less one frame every 10 seconds, and taken down to 25% of the size. Just so I have them when I need them.Ĭonvert a lot of Flash Video files to DIVX, audio rate 128 kb/sec mp3: for i in *.flv do ffmpeg -i "$i" -ab 128k -b 1500k -vcodec mpeg4 -vtag DIVX "$_%04d.jpg done This is just a few command lines I use every now and then. This post was written by eli on October 27, 2010
