mkv

actioncam transcoding

mkv
Sep 8th, 2017
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.27 KB | None | 0 0
  1. # you will need some things
  2. # https://sourceforge.net/projects/avisynth2/
  3. # https://sourceforge.net/projects/megui/
  4. # https://forum.doom9.org/showthread.php?t=152860
  5. #
  6. # install avisynth, extract megui somewhere then extract defish.dll too
  7. #
  8. # also you need a script called defish.avs,
  9. # it's included below just copypaste this into notepad:
  10.  
  11. LoadPlugin("C:\Users\ed\bin\megui\tools\lsmash\LSMASHSource.dll")
  12. LSMASHVideoSource("C0008.MP4").convertToRgb32()
  13.  
  14. LoadPlugin("C:\Users\ed\bin\avisynth\defish.dll")
  15. defish(fov=84)
  16.  
  17. convertToYV12()
  18.  
  19. ####### END OF DEFISH.AVS #######
  20. # remember to change the paths to the dll files above actually
  21.  
  22.  
  23.  
  24. # just deshake
  25. ##############################
  26. # let's first try to deshake the video
  27. # without correcting the fisheye effect
  28. # to see how well we can compress it
  29.  
  30. # lines starting with # is just a comment or
  31. # statistics like how fast it went or what
  32.  
  33.  
  34.  
  35. # deshake analysis:
  36. ffmpeg -ss 20 -i C0008.MP4 -t 30 -vf vidstabdetect=shakiness=10 -f null -
  37. # frame= 1799 fps= 11 q=-0.0 Lsize=N/A time=00:00:30.01 bitrate=N/A speed=0.188x
  38. # video:871kB audio:5625kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
  39.  
  40. # deshaking and encoding (last line is final version, forget the rest):
  41. ffmpeg -ss 20 -i C0008.MP4 -t 30 -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4 -vcodec libx264 -preset veryslow -crf 18 -acodec copy pel.mkv
  42. ffmpeg -ss 20 -i C0008.MP4 -t 30 -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4,scale=1280:720 -vcodec libx264 -preset veryslow -crf 24 -acodec copy pel2.mkv
  43. ffmpeg -ss 20 -i C0008.MP4 -t 30 -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4,colorlevels=rimin=0.058:gimin=0.058:bimin=0.058,scale=1280:720 -vcodec libx264 -preset veryslow -crf 28 -acodec copy pel3.mkv
  44. ffmpeg -ss 20 -i C0008.MP4 -t 30 -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4,curves=preset=darker,scale=1280:720 -vcodec libx264 -preset veryslow -crf 32 -acodec copy pel4.mkv
  45.  
  46. # finally to compress the audio and make an mp4:
  47. ffmpeg -i pel4.mkv -vcodec copy -acodec aac -b:a 192k -movflags +faststart pel4.mp4
  48.  
  49.  
  50.  
  51. # then with defish
  52. ##############################
  53. # ah whatever let's fix the fisheye too
  54.  
  55.  
  56.  
  57. # deshake analysis:
  58. ffmpeg32 -ss 20 -i defish.avs -t 30 -vf vidstabdetect=shakiness=10 -f null -
  59. # frame= 1798 fps=3.4 q=-0.0 Lsize=N/A time=00:00:29.99 bitrate=N/A speed=0.0574x
  60. # video:674kB audio:0kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: unknown
  61.  
  62. # deshaking and encoding:
  63. ffmpeg32 -ss 20 -i defish.avs -ss 20 -i C0008.MP4 -map 0:v -map 1:a -t 30 -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4,curves=preset=darker,scale=1280:720 -vcodec libx264 -preset veryslow -crf 32 -acodec copy pel5.mkv
  64. # frame= 1798 fps=2.3 q=-1.0 Lsize= 13787kB time=00:00:29.99 bitrate=3764.9kbits/s speed=0.039x
  65. # video:7945kB audio:5818kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.172580%
  66.  
  67. # compress audio and make mp4:
  68. ffmpeg -i pel5.mkv -vcodec copy -acodec aac -b:a 192k -movflags +faststart pel5.mp4
  69.  
  70.  
  71.  
  72.  
  73.  
  74. # something i used for a phone video
  75. ffmpeg -i VID_20170907_141038.mp4 -vf vidstabdetect=shakiness=10 -f null -
  76. ffmpeg -i VID_20170907_141038.mp4 -vf vidstabtransform,unsharp=5:5:0.8:3:3:0.4,scale=1024:576 -vcodec libx264 -preset veryslow -crf 32 -acodec copy jeg-besto.mkv
Advertisement
Add Comment
Please, Sign In to add comment