Advertisement
SmilingWolf

Long AV1 encodes setup

Dec 8th, 2018
1,302
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. Commands (run in an MSYS2 shell):
  2. ffmpeg -i presage.mkv -filter:v "select='gt(scene,0.5)',showinfo" -f null - 2> PresageSC.txt
  3. grep showinfo PresageSC.txt | grep -o "pts:[\ 0-9.]*" | grep -o "[0-9.]*" > pts.txt
  4.  
  5. Python scripts:
  6. select.py, to select timestamps at least 150 seconds apart:
  7. ---
  8. filePTS = open('pts.txt', 'r')
  9. PTSArray = []
  10. for line in filePTS:
  11. PTSArray.append(float(line)/1000)
  12. filePTS.close()
  13.  
  14. startPTS = 0
  15. for PTS in PTSArray:
  16. if (PTS - startPTS) >= 150:
  17. print PTS
  18. startPTS = PTS
  19. ---
  20.  
  21. gencmd.py, to generate the ffmpeg cmdline to split the video:
  22. ---
  23. filePTS = open('selectedPTS.txt', 'r')
  24. PTSArray = [0.000]
  25. for pts in filePTS:
  26. PTSArray.append(float(pts))
  27. filePTS.close()
  28.  
  29. PTSIndex = 1
  30. while PTSIndex < len(PTSArray):
  31. print 'ffmpeg -ss %0.3f -to %0.3f -i presage.mkv %d.y4m' % (PTSArray[PTSIndex-1], PTSArray[PTSIndex], PTSIndex)
  32. PTSIndex += 1
  33.  
  34. print 'ffmpeg -ss %0.3f -i presage.mkv %d.y4m' % (PTSArray[PTSIndex-1], PTSIndex)
  35. ---
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement