Browse Source

libavcodec probe

rexim 6 years ago
parent
commit
8488b7743e

+ 5 - 2
TODO.org

@@ -28,5 +28,8 @@
 - [-] Quick video rendering
 - [-] Quick video rendering
   - [X] [[https://gstreamer.freedesktop.org/][GStreamer: open source multimedia framework]]
   - [X] [[https://gstreamer.freedesktop.org/][GStreamer: open source multimedia framework]]
     - [X] Looks too big for this project
     - [X] Looks too big for this project
-  - [ ] [[https://ffmpeg.org/libavcodec.html][Libavcodec Documentation]]
-    - [ ] [[https://www.ffmpeg.org/doxygen/0.6/api-example_8c-source.html][FFmpeg: libavcodec/api-example.c Source File]]
+  - [-] [[https://ffmpeg.org/libavcodec.html][Libavcodec Documentation]]
+    - [X] [[https://www.ffmpeg.org/doxygen/0.6/api-example_8c-source.html][FFmpeg: libavcodec/api-example.c Source File]]
+      - [X] Does not work on my version of ffmpeg 3.4+
+    - [ ] [[https://www.ffmpeg.org/doxygen/3.4/encode_video_8c-example.html][FFmpeg: encode_video.c]]
+      - [ ] 

+ 1 - 0
libavcodec-cairo-probe/.gitignore

@@ -0,0 +1 @@
+avcodec-probe

+ 9 - 0
libavcodec-cairo-probe/Makefile

@@ -0,0 +1,9 @@
+LIBS=cairo sdl2 libavcodec
+
+hello.png: avcodec-probe
+	./avcodec-probe
+
+avcodec-probe: main.c
+	gcc -Wall -Werror $(shell pkg-config --cflags $(LIBS)) \
+		-o avcodec-probe main.c \
+		$(shell pkg-config --libs $(LIBS))

+ 12 - 0
libavcodec-cairo-probe/default.nix

@@ -0,0 +1,12 @@
+with import <nixpkgs> {}; {
+    cairoprobeEnv = stdenv.mkDerivation {
+        name = "cairoprobe-env";
+        buildInputs = [ stdenv
+                        gcc
+                        pkgconfig
+                        cairo
+                        SDL2
+                        ffmpeg-full
+                      ];
+    };
+}

+ 17 - 0
libavcodec-cairo-probe/main.c

@@ -0,0 +1,17 @@
+#include <stdio.h>
+
+#include <cairo.h>
+#include <libavcodec/avcodec.h>
+
+int main(int argc, char *argv[])
+{
+    AVCodec *codec = avcodec_find_encoder(AV_CODEC_ID_MPEG1VIDEO);
+    if (!codec) {
+        fprintf(stderr, "codec not found\n");
+        return -1;
+    }
+
+    AVCodecContext *c = avcodec_alloc_context();
+
+    return 0;
+}