Skip to content

Instantly share code, notes, and snippets.

Things to Look for When Evaluating Encoders

"Our encoder mixes DCT synergies and gamma radiation to provide excellent quality that abides by industry standard salsa dancing techniques, using adaptive streaming techniques." — Vendor.

First Steps

  1. First, verify they actually have a product to sell that actually exists and can be tested in-house.

    Warning signs: incredibly vague descriptions of the product, lots of "patent pending" claims with no real patents to be found, and insistence that they can do the testing for you and provide metrics instead of letting you test it yourself.

// This is pseudocode / example to explain what kind of implementation I mean.
// I have not checked it for off-by-one errors, 100% accurate C compliance, etc.
// It's just to show what I mean, implementation wise.
#define SOME_DEFAULT_SIZE 20
char *vlc_uri_compose(const vlc_url_t *uri)
{
char *buf, *enc;
size_t len = SOME_DEFAULT_SIZE;
daemon404@bbvm:~/dev/f/ffmpeg/tests/data/fate$ grep Seg *.err
h264-conformance-caba1_sva_b.err:Segmentation fault
h264-conformance-cabac_mot_fld0_full.err:Segmentation fault
h264-conformance-cama1_toshiba_b.err:Segmentation fault
h264-conformance-capcm1_sand_e.err:Segmentation fault
h264-conformance-capcmnl1_sand_e.err:Segmentation fault
h264-conformance-cvbs3_sony_c.err:Segmentation fault
h264-conformance-frext-hpcv_brcm_a.err:Segmentation fault
h264-conformance-frext-hpcvfl_bcrm_a.err:Segmentation fault
h264-conformance-nrf_mw_e.err:Segmentation fault
commit c870059ddb2131e6bf20c89b164aa69e5531c0e8
Author: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Date: Fri Mar 23 20:34:21 2018 +0000
videosource: Do not increment the delay counter when packets are marked as DISCARD
They do not count towards the codec delay, and are used to signal, for example,
edit list edits.
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
@@ -537,6 +537,13 @@ bool FFMS_VideoSource::DecodePacket(AVPacket *Packet) {
if (!(Packet->flags & AV_PKT_FLAG_DISCARD))
DelayCounter++;
}
+ {
+ AVFrame *t = av_frame_alloc();
+ int SA = avcodec_receive_frame(CodecContext, t);
+ printf("SA = %d\n", SA);
+ av_frame_free(&t);
+ }
{
"codec_type": "video",
"stream_index": 1,
"pts": 0,
"pts_time": "0.000000",
"dts": -21,
"dts_time": "-0.035000",
"duration": 20,
"duration_time": "0.033333",
"size": "229363",
From 49fe0ce6217dd23956032c33c3985456af0d73b3 Mon Sep 17 00:00:00 2001
From: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Date: Tue, 27 Mar 2018 17:32:55 +0100
Subject: [PATCH] avcodec/avutil: Add timeline side data
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
---
libavcodec/avcodec.h | 9 ++++
libavutil/timeline.h | 125 +++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 134 insertions(+)
#include <stdio.h>
#include <libavutil/frame.h>
#include <libavutil/avutil.h>
#include <libavformat/avformat.h>
#include <libavcodec/avcodec.h>
#define INFILE "test.webm"
#define OUTFILE "test_yuv420p_1920x1080.yuv"
#define TRACK 0
General:
* I assume enum vals are guaranteed by rust/c stuff?
* You need to document how to call the send/recieve and how to drain them, etc. How to loop properly, and if they can be called concurrently, etc.
line 43: No alt-ref / invisible? Or "multiple" if bundled? Does it matter? I'm not sure.
line 85: Mention allocation maybe? Does instatiation imply allocation? I'm legitimately not sure.
line 88/98/etc: Are configs and contexts reference counted? It's really weird to "unref" a config or context to me... Don't you just free it? If they /are/ reference counted... to what end?
vimeo@vimeo-dev:~/crav1e/c-examples$ git diff
diff --git a/c-examples/simple_encoding.c b/c-examples/simple_encoding.c
index 0a11d54..68621b4 100644
--- a/c-examples/simple_encoding.c
+++ b/c-examples/simple_encoding.c
@@ -38,6 +38,8 @@ int main(int argc, char **argv)
goto clean;
}
+ rav1e_config_parse(rac, "low_latency", "true");