This file contains hidden or 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
| /** A fragment shader to convert NV12 to RGB. | |
| * Input textures Y - is a block of size w*h. | |
| * texture UV is of size w*h/2. | |
| * Remember, both U and V are individually of size w/2*h/2, but they are interleaved. | |
| * The layout looks like this : | |
| * ---------- | |
| * | | | |
| * | Y | size = w*h | |
| * | | | |
| * |________| |
This file contains hidden or 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
| /** A fragment shader to convert YUV420P to RGB. | |
| * Input textures Y - is a block of size w*h. | |
| * texture U is of size w/2*h/2. | |
| * texture V is of size w/2*h/2. | |
| * In this case, the layout looks like the following : | |
| * __________ | |
| * | | | |
| * | Y | size = w*h | |
| * | | | |
| * |________| |
This file contains hidden or 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
| from flask import Flask, jsonify, request, make_response | |
| from flask.ext.httpauth import HTTPBasicAuth | |
| from flask_sqlalchemy import SQLAlchemy | |
| from flask import render_template, redirect, url_for | |
| from sqlalchemy import UniqueConstraint, exc | |
| app = Flask(__name__) | |
| app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///memes.db' | |
| app.config['SECRET_KEY'] = 'HALO' |
This file contains hidden or 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
| /** | |
| * It took me a whole 6 hours to finally get the color conversion right. | |
| * I have a fairly good understanding of the various color formats (YUV420P, SP, 422, etc etc), | |
| * and how to access individual Y, U, and V components. | |
| * I however struggled because of a very simple yet hair-pulling gotcha. | |
| * All primitives in Java are signed! If you come from a Python-like world where 0xFF prints 255, | |
| * you see yourself struggle just the same. I am however embarrassed at spending 6 hours on this. | |
| * | |
| * @author rish | |
| */ |
This file contains hidden or 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
| #include <string.h> | |
| #include <gst/gst.h> | |
| #include <signal.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| // v4l2src ! tee name=t t. ! x264enc ! mp4mux ! filesink location=/home/rish/Desktop/okay.264 t. ! videoconvert ! autovideosink | |
| static GMainLoop *loop; |
This file contains hidden or 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
| #include <string.h> | |
| #include <gst/gst.h> | |
| #include <signal.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| #include <stdio.h> | |
| // udpsrc port=8554 caps="application/x-rtp, media=(string)video, clock-rate=(int)90000, width=(int)720, height=(int)480, encoding-name=(string)H264, payload=(int)96" ! | |
| // rtpjitterbuffer name=rtpjitbuff ! rtph264depay ! | |
| // tee name=t t. ! avdec_h264 ! appsink name=sink sync=false |
This file contains hidden or 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
| #include <string.h> | |
| #include <gst/gst.h> | |
| #include <signal.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| // v4l2src ! tee name=t t. ! x264enc ! mp4mux ! filesink location=/home/rish/Desktop/okay.264 t. ! videoconvert ! autovideosink | |
| static GMainLoop *loop; | |
| static GstElement *pipeline, *src, *tee, *encoder, *muxer, *filesink, *videoconvert, *videosink, *queue_record, *queue_display; |
This file contains hidden or 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
| #include <string.h> | |
| #include <gst/gst.h> | |
| #include <signal.h> | |
| #include <unistd.h> | |
| #include <stdlib.h> | |
| // gst-launch-1.0 v4l2src ! x264enc ! mp4mux ! filesink location=/home/rish/Desktop/okay.264 -e | |
| static GMainLoop *loop; | |
| static GstElement *pipeline, *src, *encoder, *muxer, *sink; | |
| static GstBus *bus; |
This file contains hidden or 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
| { | |
| "users": [ | |
| { | |
| "_id": "user1", | |
| "email": "user1@example.com", | |
| "name": "User One", | |
| "gender": "male", | |
| "friends": [ | |
| { | |
| "_id": "user2", |
This file contains hidden or 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
| #! /usr/bin/env python | |
| ''' | |
| Created on June 3, 2018 | |
| @author: rish | |
| This snippet sends messages or video calls a friend on Whatsapp. | |
| This requires you to keep the Whatsapp chat page open for this to work. | |
| ''' |
NewerOlder