fant0men

ffmpeg setpts (lower framerate from 50 to 25)

Feb 17th, 2020
162
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. * using -r *
  2.  
  3. the setpts filter will play the 400 resulting frames from the deinterlacer at 16 times the speed, so all 400 are displayed in one second
  4. the fps filter will then set the framerate to 25 fps, collecting all of the 400 frames into 25 frames
  5. timebase (TB) needs to be multiplied by 2, because the framerate is half as low as the native framerate of the deinterlaced video (50 fps)
  6.  
  7. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i '/run/media/lucifer/0d6b70fa-0c49-47d6-84c1-3f8509d52b58/the_code_test/avidemux/VTS_05_1_1st_half_encodethis.mkv' -vf bwdif=mode=send_field:parity=auto:deint=interlaced,dejudder,setpts="N/(25*(TB*2))",crop=702:576:10 -r 25 -c:v ffv1 -c:a copy 'thecodetest_setpts25_part1.mkv'
  8.  
  9. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i '/run/media/lucifer/0d6b70fa-0c49-47d6-84c1-3f8509d52b58/the_code_test/avidemux/VTS_06_1_2nd half_encodethis.mkv' -vf bwdif=mode=send_field:parity=auto:deint=interlaced,dejudder,setpts="N/(25*(TB*2))",crop=702:576:10 -r 25 -c:v ffv1 -c:a copy 'thecodetest_setpts25_part2.mkv'
  10.  
  11. *
  12.  
  13. * using the fps filter *
  14.  
  15. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i '/run/media/lucifer/0d6b70fa-0c49-47d6-84c1-3f8509d52b58/the_code_test/avidemux/VTS_05_1_1st_half_encodethis.mkv' -vf bwdif=mode=send_field:parity=auto:deint=interlaced,dejudder,setpts="N/(25*(TB*2))",fps=fps=25,crop=702:576:10 -c:v ffv1 -c:a copy 'thecodetest_setpts25_part1_fpsfilter.mkv'
  16.  
  17. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i '/run/media/lucifer/0d6b70fa-0c49-47d6-84c1-3f8509d52b58/the_code_test/avidemux/VTS_06_1_2nd half_encodethis.mkv' -vf bwdif=mode=send_field:parity=auto:deint=interlaced,dejudder,setpts="N/(25*(TB*2))",fps=fps=25,crop=702:576:10 -c:v ffv1 -c:a copy 'thecodetest_setpts25_part2_fpsfilter.mkv'
  18.  
  19. ***
  20.  
  21. * BLEND *
  22.  
  23. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i '/run/media/lucifer/0d6b70fa-0c49-47d6-84c1-3f8509d52b58/the_code_test/avidemux/VTS_05_1_1st_half_encodethis.mkv' -vf bwdif=mode=send_field:parity=auto:deint=interlaced,dejudder,setpts="N/(25*(TB*2))",tblend=all_mode=normal,framestep=2,crop=702:576:10 -r 25 -c:v ffv1 -c:a copy 'thecodetest_setpts25_part1_blendtest.mkv'
  24.  
  25. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i '/run/media/lucifer/0d6b70fa-0c49-47d6-84c1-3f8509d52b58/the_code_test/avidemux/VTS_05_1_1st_half_encodethis.mkv' -vf bwdif=mode=send_field:parity=auto:deint=interlaced,dejudder,tblend=all_mode=normal,framestep=2,setpts="N/(25*(TB*1))",crop=702:576:10 -r 25 -c:v ffv1 -c:a copy 'thecodetest_setpts25_part1_blendtest2.mkv'
  26.  
  27. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i '/run/media/lucifer/0d6b70fa-0c49-47d6-84c1-3f8509d52b58/the_code_test/avidemux/VTS_06_1_2nd half_encodethis.mkv' -vf bwdif=mode=send_field:parity=auto:deint=interlaced,dejudder,tblend=all_mode=normal,framestep=2,setpts="N/(25*(TB*1))",crop=702:576:10 -r 25 -c:v ffv1 -c:a copy 'thecodetest_setpts25_part2_blendtest2.mkv'
  28.  
  29.  
  30. ***
  31.  
  32. timebase is a fraction of the input framerate (1/400, or 1/50 or 1/25)
  33.  
  34. ***
  35.  
  36. * CUT *
  37.  
  38. part1 (cutout):
  39. 00:39:59.280
  40.  
  41. ffmpeg -i 'thecodetest_part1_50fps.mkv' -ss 00:39:59.520 -c:v ffv1 -c:a copy 'thecodetest_part1_50fps_billgates.mkv'
  42.  
  43. ffmpeg -i 'thecodetest_part1_50fps.mkv' -c:v ffv1 -c:a copy -t 00:39:59.520 'thecodetest_part1_50fps_cut.mkv'
  44.  
  45. ffmpeg -i 'thecodetest_part2_50fps.mkv' -ss 00:00:00.760 -c:v ffv1 -c:a copy 'thecodetest_part2_50fps_cut.mkv'
  46.  
  47. mkvmerge -o thecodetest_part1_50fps_billgates_noaudio.mkv --no-audio thecodetest_part1_50fps_billgates.mkv
  48.  
  49. *
  50.  
  51. blend:a ihop de två bill gates-klippen:
  52. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i 'thecodetest_part2_50fps_cut.mkv' -i 'thecodetest_part1_50fps_billgates_noaudio.mkv' -filter_complex blend=all_mode=normal:eof_action=pass -c:v ffv1 -c:a copy 'thecodetest_part2_50fps_cut_billgates_blended.mkv'
  53.  
  54. slå ihop alla tre filerna:
  55. ffmpeg -f concat -safe 0 -i concat.txt -vf setdar=dar=16/9 -r 50 -c:v ffv1 -c:a copy 'thecodetest_50fps_finished_cut.mkv'
  56.  
  57. *
  58.  
  59. encode to x265:
  60.  
  61. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i 'thecodetest_50fps_finished_cut.mkv' -c:v libx265 -crf 20 -preset slow -tune grain -profile:v main10 -c:a copy 'thecodetest_50fps_finished_cut_x265.mkv'
  62.  
  63. ***
  64.  
  65. * 50 FPS *
  66.  
  67. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i '/run/media/lucifer/0d6b70fa-0c49-47d6-84c1-3f8509d52b58/the_code_test/avidemux/VTS_05_1_1st_half_encodethis.mkv' -vf bwdif=mode=send_field:parity=auto:deint=interlaced,dejudder,crop=702:576:10 -r 50 -c:v ffv1 -c:a copy 'thecodetest_part1_50fps.mkv'
  68.  
  69. /home/lucifer/ffmpeg-4.2.2-amd64-static/ffmpeg -i '/run/media/lucifer/0d6b70fa-0c49-47d6-84c1-3f8509d52b58/the_code_test/avidemux/VTS_06_1_2nd half_encodethis.mkv' -vf bwdif=mode=send_field:parity=auto:deint=interlaced,dejudder,crop=702:576:10 -r 50 -c:v ffv1 -c:a copy 'thecodetest_part2_50fps.mkv'
  70.  
  71. ***
  72.  
  73. test ffmpeg cut:
  74. ffmpeg -i 'thecodetest_setpts25_part1.mkv' -ss 00:39:49.280 -c:v ffv1 -c:a copy -to 00:39:59.280 'thecodetest_setpts25_part1_cut.mkv'
  75.  
  76. ***
RAW Paste Data