Skip to content

Instantly share code, notes, and snippets.

View trolleway's full-sized avatar
🎯
Python, PostGIS, PostgreSQL, GIS

Artem Svetlov trolleway

🎯
Python, PostGIS, PostgreSQL, GIS
View GitHub Profile
#Speed up timewarp X5 to get 60fps
ffmpeg -i GH010467.MP4 -c:v libx264 -r 60 -filter:v "setpts=0.5*PTS" -tune film -threads 8 -crf 17 -x264-params opencl=true -y "Гжельский переулок 2021.mp4"
#cut
ffmpeg -ss 00:19 -i "Гжельский переулок 2021.mp4" -t 01:00 -c copy "Гжельский переулок кат.mp4"
#Compress for twitter
ffmpeg -i "Гжельский переулок кат.mp4" -c:v libx264 -vf scale=-1:720 -y -tune film -crf 27 -preset ultrafast "Гжельский переулок twitter.mp4"
#Possibly updates:
cat <<EOF >QUERY.JSON
{
"resource":{
"cls":"vector_layer",
"parent":{
"id":0
},
"display_name":"film_v4",
"keyname":null,
"description":null
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

for install mapillary_tools on termux

  • Use python2 and pip2 instead of python and pip
  • Install pil perlistiques from pip official page, there are instruction for termux
  • Use mapillary_tools installation command for linux from mapillary_|tools page on github
@trolleway
trolleway / interpolate_720p60.bat
Created November 14, 2019 00:15
video interpolate framerate to 60fps, resolution to 720p, convert to mp4 for twitter in ffmpeg. can be run on Windows or Bash
ffmpeg -i MVI_1226.avi -y -filter:v "minterpolate='mi_mode=mci:mc_mode=aobmc:vsbmc=1:fps=60'" output_tmp.mp4
ffmpeg -i output_tmp.mp4 -vf scale=-1:720 -vcodec libx264 -pix_fmt yuv420p -x264-params ref=4 -tune film -acodec aac -ac 2 -ar 24000 -ab 80k output_118.mp4
@trolleway
trolleway / dvgrab.sh
Last active August 11, 2019 21:17
My saved dvgrab keys for easyest backup of MiniDV tapes in Ubuntu
#!/usr/bin/env bash
dvgrab -timestamp -srt -showstatus -rewind -opendml -format dv2 -csize 0 -size 0
#set filename as datetime of frist scene
#write date-time to srt file
#rewind to begin tape before capture
#record one big avi file
#capture
dvgrab -showstatus -srt -timestamp
#create index
rm list.txt
for f in ./*.dv; do echo "file '$f'" >> list.txt; done
ffmpeg -f concat -safe 0 -i list.txt -filter:v "setpts=PTS/30" -framerate 60 -deinterlace speed-index.mp4
rm list.txt
#convert dv files to mp4 with embded subtitles
@trolleway
trolleway / Hugin-Mi-Sphere-Template.pto
Created February 2, 2019 20:41
Hugin template for Xiaomi Mi Sphere
# hugin project file
#hugin_ptoversion 2
p f2 w6912 h3456 v360 E13.7052 R0 n"TIFF_m c:NONE r:CROP"
m g1 i0 f0 m2 p0.00784314
# image lines
#-hugin cropFactor=1
i w6912 h3456 f2 v396.635230442757 Ra0 Rb0 Rc0 Rd0 Re0 Eev13.70516 Er1 Eb1 r0.00825082164820041 p1.44530867102748 y-179.842406724096 TrX0 TrY0 TrZ0 Tpy0 Tpp0 j0 a0 b0 c0 d-1664.3727797412 e0 g0 t0 Va1 Vb0 Vc0 Vd0 Vx0 Vy0 S90,3367,92,3369 Vm5 n"image.jpg"
#-hugin cropFactor=1
i w6912 h3456 f2 v388.424297290832 Ra0 Rb0 Rc0 Rd0 Re0 Eev13.70516 Er1 Eb1 r0.385796738657643 p-0.968200655049642 y-7.3874167823502 TrX0 TrY0 TrZ0 Tpy0 Tpp0 j0 a0 b0 c0 d1652.13282606849 e0 g0 t0 Va1 Vb0 Vc0 Vd0 Vx0 Vy0 S3555,6828,100,3373 Vm5 n"image.jpg"
mapillary_tools process --advanced --import_path "g:\Xiaomi_360\20190127\rotated\src2" --user_name trolleway --interpolate_directions --offset_angle 45 --rerun --overwrite_EXIF_direction_tag
%cd%
for /r %%v in (*.JPG) DO (
"exiftool.exe" -overwrite_original -ProjectionType="equirectangular" -UsePanoramaViewer="True" -"PoseHeadingDegrees<$exif:GPSImgDirection" -"CroppedAreaImageWidthPixels<$ImageWidth" -"CroppedAreaImageHeightPixels<$ImageHeight" -"FullPanoWidthPixels<$ImageWidth" -"FullPanoHeightPixels<$ImageHeight" -CroppedAreaLeftPixels="0" -CroppedAreaTopPixels="0" "%%v
)
PAUSE
#Largest cities per administrative entity of Russia
SELECT DISTINCT ?city ?cityLabel ?population ?country ?countryLabel ?loc WHERE {
{
SELECT (MAX(?population) AS ?population) ?country WHERE {
?city wdt:P31/wdt:P279* wd:Q515 .
?city wdt:P1082 ?population .
?city wdt:P131 ?country .
?country wdt:P17 wd:Q159 .
}
GROUP BY ?country