Skip to content

Instantly share code, notes, and snippets.

@lu-zero
lu-zero / gist:9400fc7b2fba1f35d118
Created August 20, 2014 15:07
Building libav for ios/arm64
../configure \
--cc=`xcrun -f --sdk iphoneos7.1 clang` \
--arch=aarch64 \
--cpu=generic \
--sysroot=`xcrun --sdk iphoneos7.1 --show-sdk-path` \
--target-os=darwin \
--extra-cflags='-arch arm64' \
--extra-ldflags='-arch arm64 -miphoneos-version-min=7.0' \
--enable-cross-compile

Keybase proof

I hereby claim:

  • I am lu-zero on github.
  • I am lu_zero (https://keybase.io/lu_zero) on keybase.
  • I have a public key whose fingerprint is 1965 8F02 6BD4 3483 3265 5B05 6DEF F12B 9916 8B55

To claim this, I am signing this object:

@lu-zero
lu-zero / gist:75a260874bb9931c6304
Created January 9, 2015 17:35
gnutls build system is horrid...
SRC_nettle="http://www.lysator.liu.se/~nisse/archive/nettle-2.7.1.tar.gz"
SRC_libtasn1="http://distfiles.gentoo.org/distfiles/libtasn1-4.2.tar.gz"
SRC_gmp="http://distfiles.gentoo.org/distfiles/gmp-6.0.0a.tar.xz"
SRC_gnutls="http://distfiles.gentoo.org/distfiles/gnutls-3.3.11.tar.xz"
#AUTOTOOL_SRC="gmp nettle libtasn1 gnutls"
AUTOTOOL_SRC="gmp nettle libtasn1 gnutls"
ROOTDIR="$PWD";
@lu-zero
lu-zero / mms_open.c
Created January 21, 2015 09:59
How to open mms:// url in Libav
/*
* How to open mms:// url in Libav
*
* Libav 12 will sport a chained protocol that aliases to the following
*
*/
int example_open(AVFormatContext **ic, const char *url)
{
class Libav < Formula
homepage "https://libav.org/"
url "https://libav.org/releases/libav-11.3.tar.xz"
sha256 "12ae6c051967765ae5faeddf94c4584129ac0b18edb884afffc5fcedcdb5e030"
head "git://git.libav.org/libav.git"
bottle do
sha256 "9a5947ed844346e6833fd13321ff794038c980cbfb02960a4627b3b53b9a6def" => :yosemite
sha256 "8d231acea028c5c6c942a91ed206ade71355a467f8c525a43b7d47257f51b4df" => :mavericks
@lu-zero
lu-zero / tesla-nvenc-libav-benchmark.md
Last active September 2, 2015 14:53
Playing with a Tesla K20m

Step 1: install cuda & nvenc

e.g. emerge nvidia-cuda-sdk

Step 2: build libav

git clone git://github.com/libav/libav
cd libav
./configure --enable-nvenc --extra-cflags="-I/path/to/cuda/include -I/path/to/nvenc/include"

make -j 18

<!doctype html>
<html>
<head>
<title>Plaid - {{title}}</title>
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/bootstrap.css')}}" />
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/bootstrap-theme.css')}}" />
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/octicons.css')}}" />
<link rel="stylesheet" type="text/css" href="{{url_for('static', filename='css/plaid.css')}}" />
{% block head %}{% endblock %}
</head>
- pb = avio_alloc_context(framebuf, 1000*1000, URL_RDONLY, opaque, read_packet_from_queue, NULL, NULL);
- pb->is_streamed = 1;
+ pb = avio_alloc_context(framebuf, 1000*1000, 0, opaque, read_packet_from_queue, NULL, NULL);
+ pb->seekable = 0;
+ avfc->pb = pb;
On Sun, Nov 27, 2011 at 10:07:55PM +0200, Asen Lekov wrote:
> --- a/libavcodec/snow.c
> +++ b/libavcodec/snow.c
> @@ -35,46 +35,51 @@
>
> s->b_width = w;
> - s->b_height= h;
> + s->b_height = h;
Here (and in similar places) the '=' should end up vertically aligned,
i.e.:
@lu-zero
lu-zero / yuv4mpeg-review.diff
Created November 30, 2011 10:57
Some corrections for you
diff --git a/libavformat/yuv4mpeg.c b/libavformat/yuv4mpeg.c
index e1db1a3..f80d2bc 100644
--- a/libavformat/yuv4mpeg.c
+++ b/libavformat/yuv4mpeg.c
@@ -42,7 +42,8 @@ static int yuv4_generate_header(AVFormatContext *s, char* buf)
width = st->codec->width;
height = st->codec->height;
- av_reduce(&raten, &rated, st->codec->time_base.den, st->codec->time_base.num, (1UL<<31)-1);
+ av_reduce(&raten, &rated, st->codec->time_base.den,