This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cheaply convert container only, given compatible internal codecs | |
ffmpeg -i ../panama_loop/WtoxxHADnGk_0820.ts -map 0 -c copy WtoxxHADnGk_0820.mp4 | |
# extract every 150th frame (5s) (random ordering of files). jpeg preserve quality | |
ls ../panama_loop_mp4/ | shuf | xargs -L 1 -I {} -P 20 bash -c "mkdir -p {} && ffmpeg -i ../panama_loop_mp4/{} -vf 'select=not(mod(n\,150))' -q:v 2 {}/frame_%06d.jpg" | |
## need to add -vsync vpf above to avoid the same frame showing up multiple times | |
ls ../panama_loop_mp4/ | shuf | xargs -L 1 -I{} -P 120 bash -c "mkdir -p {} && ffmpeg -filter_threads 1 -i ../panama_loop_mp4/{} -threads 1 -vf 'select=not(mod(n\,300)), scale=1008:-1' -vsync vfr -f image2 -q:v 2 -threads 1 -an {}/frame_%06d.jpg" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
plot_figure = figure( | |
title='embedding plot', | |
plot_width=700, | |
plot_height=400, | |
tools=('pan, wheel_zoom, reset, tap, box_select'), | |
output_backend="webgl" | |
) | |
color_col = 'curr_label' | |
cids = class_names#db_df[color_col].unique() # really should be class |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import inspect | |
def copy_locals(): | |
''' | |
copies all local variables from this context into the jupyter top level, eg, for easier | |
debugging of data and for prototyping new code that is eventually meant to run within this context. | |
''' | |
stack = inspect.stack() | |
caller = stack[1] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
ffmpeg_install_dir = '/nvme_drive/orm/ffmpeg_install2/' | |
os.environ['LD_LIBRARY_PATH'] = f'{ffmpeg_install_dir}/lib/' | |
import skvideo | |
skvideo.setFFmpegPath(f'{ffmpeg_install_dir}/bin/') | |
import skvideo.io | |
## minimal options | |
device=0 | |
file = /big_fast_drive/orm/birds/birds_panama.mp4', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
origin https://git.videolan.org/git/ffmpeg/nv-codec-headers.git | |
# tag n10.0.26.0 | |
# may be useful to point ffmpeg to different path, eg. conda | |
# --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu | |
base=/home/gridsan/omoll/ | |
mkdir ${base}/ffmpeg_install | |
prefix=${base}/ffmpeg_install | |
nv_codec_install=${base}/nv-codec-headers-install/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export ytbkey=<ytbkey here>; | |
for i in `seq -f '%04g' 672`; | |
do /home/gridsan/omoll/.local/bin/streamlink --hls-duration 01:00:00 --hls-live-restart -o ${ytbkey}_$i.ts https://www.youtube.com/watch?v=${ytbkey} best; | |
done; | |
# convert ts container without re-encoding with this | |
# ffmpeg -i ${ytbkey}_$i.ts -s 0:0 -vcodec copy -an ${ytbkey}_$i.mp4; done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def plt2arr(fig, draw=True): | |
""" | |
need to draw if figure is not drawn yet | |
""" | |
if draw: | |
fig.canvas.draw() | |
rgba_buf = fig.canvas.buffer_rgba() | |
(w,h) = fig.canvas.get_width_height() | |
rgba_arr = np.frombuffer(rgba_buf, dtype=np.uint8).reshape((h,w,4)) | |
return rgba_arr |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"type": "FeatureCollection", "features": [{"geometry": {"type": "LineString", "coordinates": [[-71.118052, 42.3661482], [-71.1180446, 42.3659904]]}, "type": "Feature", "id": "0", "properties": {"index": 0, "dst": 2671760283, "src": 61403923, "osm_id": 8646197}}, {"geometry": {"type": "LineString", "coordinates": [[-71.118052, 42.3661482], [-71.1181256, 42.3654855]]}, "type": "Feature", "id": "1", "properties": {"index": 1, "dst": 2671760279, "src": 2671760283, "osm_id": 8646197}}, {"geometry": {"type": "LineString", "coordinates": [[-71.1180446, 42.3659904], [-71.1180425, 42.3658109]]}, "type": "Feature", "id": "2", "properties": {"index": 2, "dst": 61372243, "src": 2671760279, "osm_id": 8646197}}, {"geometry": {"type": "LineString", "coordinates": [[-71.1180425, 42.3658109], [-71.1180266, 42.3637903]]}, "type": "Feature", "id": "3", "properties": {"index": 3, "dst": 2671858992, "src": 61372243, "osm_id": 8646197}}, {"geometry": {"type": "LineString", "coordinates": [[-71.1180266, 42.3637903], [-71.1180211, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"type": "FeatureCollection", "features": [{"geometry": {"type": "LineString", "coordinates": [[-71.0975293, 42.3617372], [-71.096938, 42.3613854]]}, "type": "Feature", "id": "0", "bbox": [-71.0975293, 42.3613854, -71.096938, 42.3617372], "properties": {}}, {"geometry": {"type": "LineString", "coordinates": [[-71.0961381, 42.3609094], [-71.0960005, 42.3608275]]}, "type": "Feature", "id": "1", "bbox": [-71.0961381, 42.3608275, -71.0960005, 42.3609094], "properties": {}}, {"geometry": {"type": "LineString", "coordinates": [[-71.0953508, 42.3604364], [-71.0948847, 42.3601506]]}, "type": "Feature", "id": "2", "bbox": [-71.0953508, 42.3601506, -71.0948847, 42.3604364], "properties": {}}, {"geometry": {"type": "LineString", "coordinates": [[-71.0936993, 42.3607137], [-71.0929964, 42.3610495]]}, "type": "Feature", "id": "3", "bbox": [-71.0936993, 42.3607137, -71.0929964, 42.3610495], "properties": {}}, {"geometry": {"type": "LineString", "coordinates": [[-71.0914907, 42.3617964], [-71.0907826, 42.3621783]]}, "type": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
osm=# select postgis_full_version(); | |
postgis_full_version | |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
POSTGIS="2.2.1 r14555" GEOS="3.5.0-CAPI-1.9.0 r4084" PROJ="Rel. 4.9.2, 08 September 2015" GDAL="GDAL 1.11.3, released 2015/09/16" LIBXML="2.9.3" LIBJSON="0.11.99" RASTER | |
(1 row) | |
-- the 10 is for decimal points, the 2 is for adding the SRID to the result. | |
osm=# select ST_AsGeoJSON(geometry, 10, 2) from import.osm_roads where osm_id = 8616015; | |
-- the 4326 stands for 'SRID:4326' |
NewerOlder