From Schmid.wiki
Jump to: navigation, search
Line 2: Line 2:
  
 
     ffprobe INPUTFILE
 
     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:
 
Extract audio:
Line 27: Line 16:
  
 
     ffmpeg -i INPUTFILE -crf 0 -preset veryslow OUTPUT.mp4
 
     ffmpeg -i INPUTFILE -crf 0 -preset veryslow OUTPUT.mp4
 +
 +
Get audio gain info:
 +
 +
    ffmpeg -i INPUTFILE -af volumedetect -f null /dev/null # *nix
 +
    ffmpeg -i INPUTFILE -af volumedetect -f null NUL # Windows
 +
    ...
 +
    mean_volume: -48.8 dB
 +
    max_volume: -25.3 dB
 +
    ...
  
 
Adjust volume:
 
Adjust volume:
  
 
     ffmpeg -i INPUTFILE -vcodec copy -af volume=0.3 OUTPUTFILE
 
     ffmpeg -i INPUTFILE -vcodec copy -af volume=0.3 OUTPUTFILE
 +
    ffmpeg -i INPUTFILE -vcodec copy -af volume=25dB OUTPUTFILE
  
 
Trim:
 
Trim:

Revision as of 10:23, 5 June 2017

Get file info:

   ffprobe INPUTFILE

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

Get audio gain info:

   ffmpeg -i INPUTFILE -af volumedetect -f null /dev/null # *nix
   ffmpeg -i INPUTFILE -af volumedetect -f null NUL # Windows
   ...
   mean_volume: -48.8 dB
   max_volume: -25.3 dB
   ...

Adjust volume:

   ffmpeg -i INPUTFILE -vcodec copy -af volume=0.3 OUTPUTFILE
   ffmpeg -i INPUTFILE -vcodec copy -af volume=25dB 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