Skip to content

Instantly share code, notes, and snippets.

View tmm1's full-sized avatar

Aman Karmani tmm1

View GitHub Profile
@tmm1
tmm1 / .block
Last active April 16, 2020 22:51 — forked from piwodlaiwo/.block
World Map in D3v4 with Queue and Tooltips
license: mit
@tmm1
tmm1 / h264bsf.patch
Last active October 9, 2019 23:29
ffmpeg h264_metadata_bsf issue
$ wget https://tmm1.s3.amazonaws.com/h264-metadata.mpg
$ ffmpeg -i h264-metadata.mpg -c copy -map v -f h264 -y /dev/stdout | h264_analyze /dev/stdin > /tmp/a.out
$ ffmpeg -i h264-metadata.mpg -bsf:v h264_metadata -c copy -map v -f h264 -y /dev/stdout | h264_analyze /dev/stdin > /tmp/b.out
$ diff -uNdr /tmp/a.out /tmp/b.out | head -20
--- /tmp/a.out 2019-10-09 14:33:07.000000000 -0700
+++ /tmp/b.out 2019-10-09 14:33:01.000000000 -0700
@@ -144,8 +144,8 @@
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
diff --git a/libavcodec/vaapi_encode_h264.c b/libavcodec/vaapi_encode_h264.c
index 9152af4fb3..896a945470 100644
--- a/libavcodec/vaapi_encode_h264.c
+++ b/libavcodec/vaapi_encode_h264.c
@@ -64,6 +64,7 @@ typedef struct VAAPIEncodeH264Context {
H264RawSEIPicTiming pic_timing;
H264RawSEIRecoveryPoint recovery_point;
H264RawSEIUserDataUnregistered identifier;
+ H264RawSEIUserDataRegistered a53_cc;
char *identifier_string;
@tmm1
tmm1 / aes_reader.go
Last active April 30, 2019 16:41
Golang AES CBC PKCS7 io.Reader
package hls
import (
"crypto/aes"
"crypto/cipher"
"io"
"github.com/Sonelli/gojuice/crypto/pkcs7"
)
From db6f249e3d95b124c388f26e39f95b855b15dcdf Mon Sep 17 00:00:00 2001
From: Aman Gupta <aman@tmm1.net>
Date: Fri, 22 Mar 2019 17:54:38 -0700
Subject: [PATCH] avformat/utils: add hack to allow read seeks via io context
Signed-off-by: Aman Gupta <aman@tmm1.net>
---
libavformat/utils.c | 3 +++
1 file changed, 3 insertions(+)

I have a sample.mpg mpegts file with a video keyframe starting at 65738.512389

$ ffprobe -hide_banner -loglevel fatal sample.mpg -select_streams v -print_format json -show_packets -read_intervals "%+#1"
{
    "packets": [
        {
            "codec_type": "video",
            "stream_index": 0,
            "pts": 5916466115,
diff --git a/SynoBuildConf/abiconfig b/SynoBuildConf/abiconfig
new file mode 100644
index 0000000000..70e02a72b5
--- /dev/null
+++ b/SynoBuildConf/abiconfig
@@ -0,0 +1,4 @@
+{
+ "skip_including": ["d3d11va.h", "dxva2.h", "qsv.h", "vda.h", "vdpau.h", "xvmc.h"],
+ "defines": "#define __STDC_CONSTANT_MACROS"
+}
diff --git a/src/cmd/cgo/gcc.go b/src/cmd/cgo/gcc.go
index c104067a93..d9d6d7c7bf 100644
--- a/src/cmd/cgo/gcc.go
+++ b/src/cmd/cgo/gcc.go
@@ -64,6 +64,9 @@ func cname(s string) string {
if strings.HasPrefix(s, "sizeof_") {
return "sizeof(" + cname(s[len("sizeof_"):]) + ")"
}
+ if strings.HasPrefix(s, "objc_class_") {
+ return s[len("objc_class_"):]
@tmm1
tmm1 / mpv-opengl-android.patch
Last active October 9, 2017 19:09
mpv --vo=opengl --opengl-backend=android --wid=(int64_t)(intptr_t)(android.view.Surface *)surface
diff --git a/video/out/opengl/context.c b/video/out/opengl/context.c
index 72311e11fa..dab32d122a 100644
--- a/video/out/opengl/context.c
+++ b/video/out/opengl/context.c
@@ -46,10 +46,14 @@ extern const struct mpgl_driver mpgl_driver_angle;
extern const struct mpgl_driver mpgl_driver_angle_es2;
extern const struct mpgl_driver mpgl_driver_dxinterop;
extern const struct mpgl_driver mpgl_driver_rpi;
+extern const struct mpgl_driver mpgl_driver_android;
extern const struct mpgl_driver mpgl_driver_mali;
diff --git a/app/src/main/java/is/xyz/mpv/MPVLib.java b/app/src/main/java/is/xyz/mpv/MPVLib.java
index 686b6a6..47bd989 100644
--- a/app/src/main/java/is/xyz/mpv/MPVLib.java
+++ b/app/src/main/java/is/xyz/mpv/MPVLib.java
@@ -6,6 +6,7 @@ import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.opengl.GLSurfaceView;
+import android.view.Surface;