From Schmid.wiki
Jump to: navigation, search
Line 22: Line 22:
  
 
     # Highpass 10 Hz, 12dB/octave
 
     # Highpass 10 Hz, 12dB/octave
     ffmpeg -i INPUTFILE -vcodec copy -filter_complex "highpass=f=10" OUTPUT.mp4
+
     ffmpeg -i INPUTFILE -vcodec copy -filter_complex "highpass=f=10" OUTPUTFILE
  
 
Create a lossless compressed h264 video (-crf 0 means uncompressed):
 
Create a lossless compressed h264 video (-crf 0 means uncompressed):
  
     ffmpeg -i INPUT.avi -crf 0 -preset veryslow OUTPUT.mp4
+
     ffmpeg -i INPUTFILE -crf 0 -preset veryslow OUTPUT.mp4
  
 
Adjust volume:
 
Adjust volume:
  
     ffmpeg -i INPUT.avi -crf 0 -preset veryslow -af volume=0.3 OUTPUT.mp4
+
     ffmpeg -i INPUTFILE -vcodec copy -af volume=0.3 OUTPUTFILE
  
 
Trim:
 
Trim:
  
 
     # first 30s
 
     # first 30s
     ffmpeg -i INPUT.avi -ss 00:00:00.000 -t 00:00:30.000 -vcodec copy -acodec copy -y OUTPUT.mp4
+
     ffmpeg -i INPUTFILE -ss 00:00:00.000 -t 00:00:30.000 -vcodec copy -acodec copy -y OUTPUTFILE
 
     # from 10s to 20s (note that -t sets the duration of the video, not an offset)
 
     # from 10s to 20s (note that -t sets the duration of the video, not an offset)
     ffmpeg -i INPUT.avi -ss 00:00:10.000 -t 00:00:10.000 -vcodec copy -acodec copy -y OUTPUT.mp4
+
     ffmpeg -i INPUTFILE -ss 00:00:10.000 -t 00:00:10.000 -vcodec copy -acodec copy -y OUTPUTFILE
  
 
== MAME ==
 
== MAME ==

Revision as of 10:18, 5 June 2017

Get file info:

   ffprobe INPUTFILE

Get audio gain info:

   ffmpeg -i INPUTFILE -af volumedetect -f null /dev/null # *nix
   ffmpeg -i INPUTFILE -af volumedetect -f null NUL # Windows

Outputs:

   ...
   mean_volume: -48.8 dB
   max_volume: -25.3 dB
   ...

Extract audio:

   ffmpeg -i INPUTFILE -vn OUTPUT.wav              # convert to wav
   ffmpeg -i INPUTFILE -vn -acodec copy OUTPUTFILE # dump raw audio data

Highpass filter audio (useful for DC removal from emulator recordings):

   # Highpass 10 Hz, 12dB/octave
   ffmpeg -i INPUTFILE -vcodec copy -filter_complex "highpass=f=10" OUTPUTFILE

Create a lossless compressed h264 video (-crf 0 means uncompressed):

   ffmpeg -i INPUTFILE -crf 0 -preset veryslow OUTPUT.mp4

Adjust volume:

   ffmpeg -i INPUTFILE -vcodec copy -af volume=0.3 OUTPUTFILE

Trim:

   # first 30s
   ffmpeg -i INPUTFILE -ss 00:00:00.000 -t 00:00:30.000 -vcodec copy -acodec copy -y OUTPUTFILE
   # from 10s to 20s (note that -t sets the duration of the video, not an offset)
   ffmpeg -i INPUTFILE -ss 00:00:10.000 -t 00:00:10.000 -vcodec copy -acodec copy -y OUTPUTFILE

MAME

Record video from MAME, output file is in 'snap':

   mame defender -aviwrite test.avi
   ffmpeg -i snap\test.avi -crf 0 -preset veryslow test.mp4