User Tools

Site Tools


ffmpeg

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
ffmpeg [2014/02/11 02:54] javapimpffmpeg [2023/08/18 18:15] (current) – external edit 127.0.0.1
Line 47: Line 47:
  
 for /r %%a in (%src%) do (ffmpeg -i "%%a" "%%~na.avi") for /r %%a in (%src%) do (ffmpeg -i "%%a" "%%~na.avi")
 +</code>
 +
 +====== Concatenate two mp4 files ======
 +
 +The videos need to have the same aspects to be joined without re-encoding (same size, bitrate, etc.)
 +
 +<code>
 +ffmpeg -i first.mp4 -c copy -bsf h264_mp4toannexb first.ts
 +ffmpeg -i second.mp4 -c copy -bsf h264_mp4toannexb second.ts
 +ffmpeg -i "concat:first.ts|second.ts" -c copy -bsf aac_adtstoasc output.mp4
 +</code>
 +
 +====== Decent Blu-Ray Compression ======
 +
 +  * Determine the size of the black bars on top and bottom and crop them.
 +  * Play with the compression ''-crf'' value.
 +    * Ranges from 0 (lossless) to 51 (terrible)
 +    * 18-28 is usually pretty good. Default is 23.
 +    * The smaller the number the better quality but bigger output file.
 +  * Crop filter: ''-filter:v "crop=out_w:out_h:x:y"''
 +    * ''out_w'' is the width of the output rectangle
 +    * ''out_h'' is the height of the output rectangle
 +    * ''x'' and ''y'' specify the top left corner of the output rectangle
 +    * Handbrake can be used as an easy way to get these values
 +
 +<code>
 +ffmpeg -i input.mkv -filter:v "crop=1920:800:0:140" -c:v libx264 -preset medium -crf 23 -c:a aac -b:a 384k -strict -2 output.mp4
 </code> </code>
  
  
ffmpeg.1392087298.txt.gz · Last modified: 2023/08/18 18:15 (external edit)