From 18aa23ea62ccee26d957d32bed5ef35155d3563a Mon Sep 17 00:00:00 2001 From: Markham Date: Sun, 10 Sep 2017 12:26:03 +0200 Subject: [PATCH] bump version ffmpeg-3.3 git 2ba896f --- Makefile | 3 +- ...nal-buffer-size-and-restore-it-after.patch | 63 +++ ...-Revert-lavc-Switch-bitrate-to-64bit.patch | 381 ------------------ ...mpeg-increase-IO-BUFFER-SIZE-to-128k.patch | 17 + .../0005-ffmpeg-fix-pts-for-cooli.patch | 15 + .../0006-ffmpeg-fix-sps-pps-for-cooli.patch | 29 ++ ...-ffmpeg-reset-compressed-header-flag.patch | 11 + ...x-G-and-RCV-bitstream-filters.-Origi.patch | 335 +++++++++++++++ doc/config.example | 4 +- make/bootstrap.mk | 3 + make/libraries.mk | 7 +- make/prerequisites.mk | 14 - make/versions.mk | 2 +- 13 files changed, 483 insertions(+), 401 deletions(-) create mode 100644 archive-patches/ffmpeg/0003-Revert-libavformat-aviobuf-keep-track-of-the-original-buffer-size-and-restore-it-after.patch delete mode 100644 archive-patches/ffmpeg/0003-ffmpeg-Revert-lavc-Switch-bitrate-to-64bit.patch create mode 100644 archive-patches/ffmpeg/0003-ffmpeg-increase-IO-BUFFER-SIZE-to-128k.patch create mode 100644 archive-patches/ffmpeg/0005-ffmpeg-fix-pts-for-cooli.patch create mode 100755 archive-patches/ffmpeg/0006-ffmpeg-fix-sps-pps-for-cooli.patch create mode 100644 archive-patches/ffmpeg/0007-ffmpeg-reset-compressed-header-flag.patch create mode 100644 archive-patches/ffmpeg/0008-add-ASF-VC1-Annex-G-and-RCV-bitstream-filters.-Origi.patch diff --git a/Makefile b/Makefile index d047770..b426b84 100755 --- a/Makefile +++ b/Makefile @@ -103,7 +103,6 @@ update-git: $(MAKE) $(GIT_BOOTLOADER) $(MAKE) $(GIT_DRIVERS_THIRDPARTY) $(MAKE) $(GIT_DRIVERS) - $(MAKE) $(GIT_LIBRARIES)/ffmpeg $(MAKE) $(GIT_KERNEL) $(MAKE) $(GIT_PLUGINS) @@ -154,7 +153,7 @@ wittinobi-all: # prerequisites.mk prerequisites: - $(MAKE) $(SOURCE_DIR)/neutrino-hd $(GIT_BOOTLOADER) $(GIT_DRIVERS_THIRDPARTY) $(GIT_DRIVERS) $(GIT_LIBRARIES)/ffmpeg $(GIT_KERNEL) $(GIT_PLUGINS) + $(MAKE) $(SOURCE_DIR)/neutrino-hd $(GIT_BOOTLOADER) $(GIT_DRIVERS_THIRDPARTY) $(GIT_DRIVERS) $(GIT_KERNEL) $(GIT_PLUGINS) # bootstrap.mk BOOTSTRAP = targetprefix $(BUILD_TMP) $(CROSS_BASE) $(HOSTPREFIX)/bin diff --git a/archive-patches/ffmpeg/0003-Revert-libavformat-aviobuf-keep-track-of-the-original-buffer-size-and-restore-it-after.patch b/archive-patches/ffmpeg/0003-Revert-libavformat-aviobuf-keep-track-of-the-original-buffer-size-and-restore-it-after.patch new file mode 100644 index 0000000..f83405c --- /dev/null +++ b/archive-patches/ffmpeg/0003-Revert-libavformat-aviobuf-keep-track-of-the-original-buffer-size-and-restore-it-after.patch @@ -0,0 +1,63 @@ +diff --git a/libavformat/avio.h b/libavformat/avio.h +index 06dd7f5..5911a91 100644 +--- a/libavformat/avio.h ++++ b/libavformat/avio.h +@@ -191,13 +191,6 @@ typedef struct AVIOContext { + int writeout_count; + + /** +- * Original buffer size +- * used internally after probing and ensure seekback to reset the buffer size +- * This field is internal to libavformat and access from outside is not allowed. +- */ +- int orig_buffer_size; +- +- /** + * Threshold to favor readahead over seek. + * This is current internal only, do not use from outside. + */ +diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c +index 4e79e3f..c2681ed 100644 +--- a/libavformat/aviobuf.c ++++ b/libavformat/aviobuf.c +@@ -79,7 +79,6 @@ int ffio_init_context(AVIOContext *s, + int64_t (*seek)(void *opaque, int64_t offset, int whence)) + { + s->buffer = buffer; +- s->orig_buffer_size = + s->buffer_size = buffer_size; + s->buf_ptr = buffer; + s->opaque = opaque; +@@ -466,16 +465,16 @@ static void fill_buffer(AVIOContext *s) + } + + /* make buffer smaller in case it ended up large after probing */ +- if (s->read_packet && s->orig_buffer_size && s->buffer_size > s->orig_buffer_size) { ++ if (s->read_packet && s->buffer_size > max_buffer_size) { + if (dst == s->buffer && s->buf_ptr != dst) { +- int ret = ffio_set_buf_size(s, s->orig_buffer_size); ++ int ret = ffio_set_buf_size(s, max_buffer_size); + if (ret < 0) + av_log(s, AV_LOG_WARNING, "Failed to decrease buffer size\n"); + + s->checksum_ptr = dst = s->buffer; + } +- av_assert0(len >= s->orig_buffer_size); +- len = s->orig_buffer_size; ++ av_assert0(len >= max_buffer_size); ++ len = max_buffer_size; + } + + if (s->read_packet) +@@ -847,7 +846,6 @@ int ffio_set_buf_size(AVIOContext *s, int buf_size) + + av_free(s->buffer); + s->buffer = buffer; +- s->orig_buffer_size = + s->buffer_size = buf_size; + s->buf_ptr = buffer; + url_resetbuf(s, s->write_flag ? AVIO_FLAG_WRITE : AVIO_FLAG_READ); +-- +2.7.4.1.g5468f9e + + diff --git a/archive-patches/ffmpeg/0003-ffmpeg-Revert-lavc-Switch-bitrate-to-64bit.patch b/archive-patches/ffmpeg/0003-ffmpeg-Revert-lavc-Switch-bitrate-to-64bit.patch deleted file mode 100644 index f6d6b7e..0000000 --- a/archive-patches/ffmpeg/0003-ffmpeg-Revert-lavc-Switch-bitrate-to-64bit.patch +++ /dev/null @@ -1,381 +0,0 @@ -diff --git a/ffserver.c b/ffserver.c -index 8b819b6..2732d7f 100644 ---- a/ffserver.c -+++ b/ffserver.c -@@ -1914,9 +1914,9 @@ static inline void print_stream_params(AVIOContext *pb, FFServerStream *stream) - abort(); - } - -- avio_printf(pb, "%d%s%"PRId64 -+ avio_printf(pb, "%d%s%d" - "%s%s\n", -- i, type, (int64_t)st->codecpar->bit_rate/1000, -+ i, type, st->codecpar->bit_rate/1000, - codec ? codec->name : "", parameters); - } - -diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h -index 35df4f6..34363a7 100644 ---- a/libavcodec/avcodec.h -+++ b/libavcodec/avcodec.h -@@ -1794,7 +1794,7 @@ typedef struct AVCodecContext { - * - decoding: Set by user, may be overwritten by libavcodec - * if this info is available in the stream - */ -- int64_t bit_rate; -+ int bit_rate; - - /** - * number of bits the bitstream is allowed to diverge from the reference. -@@ -2729,14 +2729,14 @@ typedef struct AVCodecContext { - * - encoding: Set by user. - * - decoding: Set by user, may be overwritten by libavcodec. - */ -- int64_t rc_max_rate; -+ int rc_max_rate; - - /** - * minimum bitrate - * - encoding: Set by user. - * - decoding: unused - */ -- int64_t rc_min_rate; -+ int rc_min_rate; - - #if FF_API_MPV_OPT - /** -diff --git a/libavcodec/cook.c b/libavcodec/cook.c -index 53cb8385..2cd96cf 100644 ---- a/libavcodec/cook.c -+++ b/libavcodec/cook.c -@@ -1035,7 +1035,7 @@ static void dump_cook_context(COOKContext *q) - } - ff_dlog(q->avctx, "COOKContext\n"); - PRINT("nb_channels", q->avctx->channels); -- PRINT("bit_rate", (int)q->avctx->bit_rate); -+ PRINT("bit_rate", q->avctx->bit_rate); - PRINT("sample_rate", q->avctx->sample_rate); - PRINT("samples_per_channel", q->subpacket[0].samples_per_channel); - PRINT("subbands", q->subpacket[0].subbands); -diff --git a/libavcodec/dcaenc.c b/libavcodec/dcaenc.c -index 3c5c33c..28ab9b2 100644 ---- a/libavcodec/dcaenc.c -+++ b/libavcodec/dcaenc.c -@@ -161,7 +161,7 @@ static int encode_init(AVCodecContext *avctx) - c->samplerate_index = i; - - if (avctx->bit_rate < 32000 || avctx->bit_rate > 3840000) { -- av_log(avctx, AV_LOG_ERROR, "Bit rate %"PRId64" not supported.", (int64_t)avctx->bit_rate); -+ av_log(avctx, AV_LOG_ERROR, "Bit rate %i not supported.", avctx->bit_rate); - return AVERROR(EINVAL); - } - for (i = 0; ff_dca_bit_rates[i] < avctx->bit_rate; i++) -diff --git a/libavcodec/libfdk-aacenc.c b/libavcodec/libfdk-aacenc.c -index 98a817b..5df0c90 100644 ---- a/libavcodec/libfdk-aacenc.c -+++ b/libavcodec/libfdk-aacenc.c -@@ -215,8 +215,8 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) - } - if ((err = aacEncoder_SetParam(s->handle, AACENC_BITRATE, - avctx->bit_rate)) != AACENC_OK) { -- av_log(avctx, AV_LOG_ERROR, "Unable to set the bitrate %"PRId64": %s\n", -- (int64_t)avctx->bit_rate, aac_get_error(err)); -+ av_log(avctx, AV_LOG_ERROR, "Unable to set the bitrate %d: %s\n", -+ avctx->bit_rate, aac_get_error(err)); - goto error; - } - } -diff --git a/libavcodec/libgsmenc.c b/libavcodec/libgsmenc.c -index 69ce439..45fdb8e 100644 ---- a/libavcodec/libgsmenc.c -+++ b/libavcodec/libgsmenc.c -@@ -62,8 +62,8 @@ static av_cold int libgsm_encode_init(AVCodecContext *avctx) { - if (avctx->bit_rate != 13000 /* Official */ && - avctx->bit_rate != 13200 /* Very common */ && - avctx->bit_rate != 0 /* Unknown; a.o. mov does not set bitrate when decoding */ ) { -- av_log(avctx, AV_LOG_ERROR, "Bitrate 13000bps required for GSM, got %"PRId64"bps\n", -- (int64_t)avctx->bit_rate); -+ av_log(avctx, AV_LOG_ERROR, "Bitrate 13000bps required for GSM, got %dbps\n", -+ avctx->bit_rate); - if (avctx->strict_std_compliance > FF_COMPLIANCE_UNOFFICIAL) - return -1; - } -diff --git a/libavcodec/libopusenc.c b/libavcodec/libopusenc.c -index c40fcde..cab7e3a 100644 ---- a/libavcodec/libopusenc.c -+++ b/libavcodec/libopusenc.c -@@ -351,12 +351,12 @@ static av_cold int libopus_encode_init(AVCodecContext *avctx) - avctx->bit_rate = 64000 * opus->stream_count + - 32000 * coupled_stream_count; - av_log(avctx, AV_LOG_WARNING, -- "No bit rate set. Defaulting to %"PRId64" bps.\n", (int64_t)avctx->bit_rate); -+ "No bit rate set. Defaulting to %d bps.\n", avctx->bit_rate); - } - - if (avctx->bit_rate < 500 || avctx->bit_rate > 256000 * avctx->channels) { -- av_log(avctx, AV_LOG_ERROR, "The bit rate %"PRId64" bps is unsupported. " -- "Please choose a value between 500 and %d.\n", (int64_t)avctx->bit_rate, -+ av_log(avctx, AV_LOG_ERROR, "The bit rate %d bps is unsupported. " -+ "Please choose a value between 500 and %d.\n", avctx->bit_rate, - 256000 * avctx->channels); - ret = AVERROR(EINVAL); - goto fail; -diff --git a/libavcodec/libspeexenc.c b/libavcodec/libspeexenc.c -index 4bdb961..b96b217 100644 ---- a/libavcodec/libspeexenc.c -+++ b/libavcodec/libspeexenc.c -@@ -125,10 +125,10 @@ static av_cold void print_enc_params(AVCodecContext *avctx, - av_log(avctx, AV_LOG_DEBUG, " quality: %f\n", s->vbr_quality); - } else if (s->abr) { - av_log(avctx, AV_LOG_DEBUG, "rate control: ABR\n"); -- av_log(avctx, AV_LOG_DEBUG, " bitrate: %"PRId64" bps\n", (int64_t)avctx->bit_rate); -+ av_log(avctx, AV_LOG_DEBUG, " bitrate: %d bps\n", avctx->bit_rate); - } else { - av_log(avctx, AV_LOG_DEBUG, "rate control: CBR\n"); -- av_log(avctx, AV_LOG_DEBUG, " bitrate: %"PRId64" bps\n", (int64_t)avctx->bit_rate); -+ av_log(avctx, AV_LOG_DEBUG, " bitrate: %d bps\n", avctx->bit_rate); - } - av_log(avctx, AV_LOG_DEBUG, "complexity: %d\n", - avctx->compression_level); -diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c -index db241c8..46ee6a4 100644 ---- a/libavcodec/mpegvideo_enc.c -+++ b/libavcodec/mpegvideo_enc.c -@@ -506,7 +506,7 @@ FF_ENABLE_DEPRECATION_WARNINGS - avctx->bit_rate * av_q2d(avctx->time_base) > - avctx->bit_rate_tolerance) { - av_log(avctx, AV_LOG_WARNING, -- "bitrate tolerance %d too small for bitrate %"PRId64", overriding\n", avctx->bit_rate_tolerance, (int64_t)avctx->bit_rate); -+ "bitrate tolerance %d too small for bitrate %d, overriding\n", avctx->bit_rate_tolerance, avctx->bit_rate); - avctx->bit_rate_tolerance = 5 * avctx->bit_rate * av_q2d(avctx->time_base); - } - -diff --git a/libavcodec/options_table.h b/libavcodec/options_table.h -index 022cb1d..14dc914 100644 ---- a/libavcodec/options_table.h -+++ b/libavcodec/options_table.h -@@ -42,8 +42,8 @@ - #define AV_CODEC_DEFAULT_BITRATE 200*1000 - - static const AVOption avcodec_options[] = { --{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = AV_CODEC_DEFAULT_BITRATE }, 0, INT64_MAX, A|V|E}, --{"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT64, {.i64 = 128*1000 }, 0, INT_MAX, A|E}, -+{"b", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = AV_CODEC_DEFAULT_BITRATE }, 0, INT64_MAX, A|V|E}, -+{"ab", "set bitrate (in bits/s)", OFFSET(bit_rate), AV_OPT_TYPE_INT, {.i64 = 128*1000 }, 0, INT_MAX, A|E}, - {"bt", "Set video bitrate tolerance (in bits/s). In 1-pass mode, bitrate tolerance specifies how far " - "ratecontrol is willing to deviate from the target average bitrate value. This is not related " - "to minimum/maximum bitrate. Lowering tolerance too much has an adverse effect on quality.", -@@ -194,9 +194,9 @@ static const AVOption avcodec_options[] = { - #if FF_API_MPV_OPT - {"rc_eq", "deprecated, use encoder private options instead", OFFSET(rc_eq), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, V|E}, - #endif --{"maxrate", "maximum bitrate (in bits/s). Used for VBV together with bufsize.", OFFSET(rc_max_rate), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, 0, INT_MAX, V|A|E}, -+{"maxrate", "maximum bitrate (in bits/s). Used for VBV together with bufsize.", OFFSET(rc_max_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, 0, INT_MAX, V|A|E}, - {"minrate", "minimum bitrate (in bits/s). Most useful in setting up a CBR encode. It is of little use otherwise.", -- OFFSET(rc_min_rate), AV_OPT_TYPE_INT64, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, -+ OFFSET(rc_min_rate), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, V|A|E}, - {"bufsize", "set ratecontrol buffer size (in bits)", OFFSET(rc_buffer_size), AV_OPT_TYPE_INT, {.i64 = DEFAULT }, INT_MIN, INT_MAX, A|V|E}, - #if FF_API_MPV_OPT - {"rc_buf_aggressivity", "deprecated, use encoder private options instead", OFFSET(rc_buffer_aggressivity), AV_OPT_TYPE_FLOAT, {.dbl = 1.0 }, -FLT_MAX, FLT_MAX, V|E}, -diff --git a/libavcodec/pcm-bluray.c b/libavcodec/pcm-bluray.c -index 22c1c08..e7f9ee4 100644 ---- a/libavcodec/pcm-bluray.c -+++ b/libavcodec/pcm-bluray.c -@@ -117,9 +117,9 @@ static int pcm_bluray_parse_header(AVCodecContext *avctx, - - if (avctx->debug & FF_DEBUG_PICT_INFO) - ff_dlog(avctx, -- "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %"PRId64" bit/s\n", -+ "pcm_bluray_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n", - avctx->channels, avctx->bits_per_coded_sample, -- avctx->sample_rate, (int64_t)avctx->bit_rate); -+ avctx->sample_rate, avctx->bit_rate); - return 0; - } - -diff --git a/libavcodec/pcm-dvd.c b/libavcodec/pcm-dvd.c -index 04c321e..46f730d 100644 ---- a/libavcodec/pcm-dvd.c -+++ b/libavcodec/pcm-dvd.c -@@ -140,9 +140,9 @@ static int pcm_dvd_parse_header(AVCodecContext *avctx, const uint8_t *header) - - if (avctx->debug & FF_DEBUG_PICT_INFO) - ff_dlog(avctx, -- "pcm_dvd_parse_header: %d channels, %d bits per sample, %d Hz, %"PRId64" bit/s\n", -+ "pcm_dvd_parse_header: %d channels, %d bits per sample, %d Hz, %d bit/s\n", - avctx->channels, avctx->bits_per_coded_sample, -- avctx->sample_rate, (int64_t)avctx->bit_rate); -+ avctx->sample_rate, avctx->bit_rate); - - s->last_header = header_int; - -diff --git a/libavcodec/sipr.c b/libavcodec/sipr.c -index 70d460a..5e428ef 100644 ---- a/libavcodec/sipr.c -+++ b/libavcodec/sipr.c -@@ -493,8 +493,8 @@ static av_cold int sipr_decoder_init(AVCodecContext * avctx) - else if (avctx->bit_rate > 5750 ) ctx->mode = MODE_6k5; - else ctx->mode = MODE_5k0; - av_log(avctx, AV_LOG_WARNING, -- "Invalid block_align: %d. Mode %s guessed based on bitrate: %"PRId64"\n", -- avctx->block_align, modes[ctx->mode].mode_name, (int64_t)avctx->bit_rate); -+ "Invalid block_align: %d. Mode %s guessed based on bitrate: %d\n", -+ avctx->block_align, modes[ctx->mode].mode_name, avctx->bit_rate); - } - - av_log(avctx, AV_LOG_DEBUG, "Mode: %s\n", modes[ctx->mode].mode_name); -diff --git a/libavcodec/utils.c b/libavcodec/utils.c -index 1336e92..7877488 100644 ---- a/libavcodec/utils.c -+++ b/libavcodec/utils.c -@@ -967,7 +967,7 @@ FF_ENABLE_DEPRECATION_WARNINGS - } - if ( (avctx->codec_type == AVMEDIA_TYPE_VIDEO || avctx->codec_type == AVMEDIA_TYPE_AUDIO) - && avctx->bit_rate>0 && avctx->bit_rate<1000) { -- av_log(avctx, AV_LOG_WARNING, "Bitrate %"PRId64" is extremely low, maybe you mean %"PRId64"k\n", (int64_t)avctx->bit_rate, (int64_t)avctx->bit_rate); -+ av_log(avctx, AV_LOG_WARNING, "Bitrate %d is extremely low, maybe you mean %dk\n", avctx->bit_rate, avctx->bit_rate); - } - - if (!avctx->rc_initial_buffer_occupancy) -@@ -1522,7 +1522,7 @@ void avcodec_string(char *buf, int buf_size, AVCodecContext *enc, int encode) - ", %"PRId64" kb/s", bitrate / 1000); - } else if (enc->rc_max_rate > 0) { - snprintf(buf + strlen(buf), buf_size - strlen(buf), -- ", max. %"PRId64" kb/s", (int64_t)enc->rc_max_rate / 1000); -+ ", max. %d kb/s", enc->rc_max_rate / 1000); - } - } - -diff --git a/libavcodec/wma.c b/libavcodec/wma.c -index f70937f..717f950 100644 ---- a/libavcodec/wma.c -+++ b/libavcodec/wma.c -@@ -185,8 +185,8 @@ av_cold int ff_wma_init(AVCodecContext *avctx, int flags2) - high_freq = high_freq * 0.5; - } - ff_dlog(s->avctx, "flags2=0x%x\n", flags2); -- ff_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%"PRId64" block_align=%d\n", -- s->version, avctx->channels, avctx->sample_rate, (int64_t)avctx->bit_rate, -+ ff_dlog(s->avctx, "version=%d channels=%d sample_rate=%d bitrate=%d block_align=%d\n", -+ s->version, avctx->channels, avctx->sample_rate, avctx->bit_rate, - avctx->block_align); - ff_dlog(s->avctx, "bps=%f bps1=%f high_freq=%f bitoffset=%d\n", - bps, bps1, high_freq, s->byte_offset_bits); -diff --git a/libavcodec/wmaenc.c b/libavcodec/wmaenc.c -index c68babd..765f570 100644 ---- a/libavcodec/wmaenc.c -+++ b/libavcodec/wmaenc.c -@@ -52,8 +52,8 @@ static av_cold int encode_init(AVCodecContext *avctx) - - if (avctx->bit_rate < 24 * 1000) { - av_log(avctx, AV_LOG_ERROR, -- "bitrate too low: got %"PRId64", need 24000 or higher\n", -- (int64_t)avctx->bit_rate); -+ "bitrate too low: got %i, need 24000 or higher\n", -+ avctx->bit_rate); - return AVERROR(EINVAL); - } - -diff --git a/libavdevice/fbdev_dec.c b/libavdevice/fbdev_dec.c -index 3b31373..33a2054 100644 ---- a/libavdevice/fbdev_dec.c -+++ b/libavdevice/fbdev_dec.c -@@ -136,11 +136,11 @@ static av_cold int fbdev_read_header(AVFormatContext *avctx) - fbdev->width * fbdev->height * fbdev->bytes_per_pixel * av_q2d(fbdev->framerate_q) * 8; - - av_log(avctx, AV_LOG_INFO, -- "w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%"PRId64"\n", -+ "w:%d h:%d bpp:%d pixfmt:%s fps:%d/%d bit_rate:%d\n", - fbdev->width, fbdev->height, fbdev->varinfo.bits_per_pixel, - av_get_pix_fmt_name(pix_fmt), - fbdev->framerate_q.num, fbdev->framerate_q.den, -- (int64_t)st->codecpar->bit_rate); -+ st->codecpar->bit_rate); - return 0; - - fail: -diff --git a/libavformat/movenc.c b/libavformat/movenc.c -index d20d272..9adf08f 100644 ---- a/libavformat/movenc.c -+++ b/libavformat/movenc.c -@@ -3897,7 +3897,7 @@ static int mov_write_isml_manifest(AVIOContext *pb, MOVMuxContext *mov, AVFormat - manifest_bit_rate = props->max_bitrate; - } - -- avio_printf(pb, "<%s systemBitrate=\"%"PRId64"\">\n", type, -+ avio_printf(pb, "<%s systemBitrate=\"%d\">\n", type, - manifest_bit_rate); - param_write_int(pb, "systemBitrate", manifest_bit_rate); - param_write_int(pb, "trackID", track_id); -diff --git a/libavformat/rdt.c b/libavformat/rdt.c -index 8670ead..57ee07e 100644 ---- a/libavformat/rdt.c -+++ b/libavformat/rdt.c -@@ -448,7 +448,7 @@ real_parse_asm_rule(AVStream *st, const char *p, const char *end) - { - do { - /* can be either averagebandwidth= or AverageBandwidth= */ -- if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%"SCNd64, &st->codecpar->bit_rate) == 1) -+ if (sscanf(p, " %*1[Aa]verage%*1[Bb]andwidth=%d", &st->codecpar->bit_rate) == 1) - break; - if (!(p = strchr(p, ',')) || p > end) - p = end; -diff --git a/libavformat/sdp.c b/libavformat/sdp.c -index 4e37f65..df2cb43 100644 ---- a/libavformat/sdp.c -+++ b/libavformat/sdp.c -@@ -748,7 +748,7 @@ void ff_sdp_write_media(char *buff, int size, AVStream *st, int idx, - av_strlcatf(buff, size, "m=%s %d RTP/AVP %d\r\n", type, port, payload_type); - sdp_write_address(buff, size, dest_addr, dest_type, ttl); - if (p->bit_rate) { -- av_strlcatf(buff, size, "b=AS:%"PRId64"\r\n", (int64_t)p->bit_rate / 1000); -+ av_strlcatf(buff, size, "b=AS:%d\r\n", p->bit_rate / 1000); - } - - sdp_write_media_attributes(buff, size, st, payload_type, fmt); -diff --git a/libavformat/smoothstreamingenc.c b/libavformat/smoothstreamingenc.c -index dabd1ea..6d126e9 100644 ---- a/libavformat/smoothstreamingenc.c -+++ b/libavformat/smoothstreamingenc.c -@@ -263,7 +263,7 @@ static int write_manifest(AVFormatContext *s, int final) - if (s->streams[i]->codecpar->codec_type != AVMEDIA_TYPE_VIDEO) - continue; - last = i; -- avio_printf(out, "\n", index, (int64_t)s->streams[i]->codecpar->bit_rate, os->fourcc, s->streams[i]->codecpar->width, s->streams[i]->codecpar->height, os->private_str); -+ avio_printf(out, "\n", index, s->streams[i]->codecpar->bit_rate, os->fourcc, s->streams[i]->codecpar->width, s->streams[i]->codecpar->height, os->private_str); - index++; - } - output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size); -@@ -277,7 +277,7 @@ static int write_manifest(AVFormatContext *s, int final) - if (s->streams[i]->codecpar->codec_type != AVMEDIA_TYPE_AUDIO) - continue; - last = i; -- avio_printf(out, "\n", index, (int64_t)s->streams[i]->codecpar->bit_rate, os->fourcc, s->streams[i]->codecpar->sample_rate, s->streams[i]->codecpar->channels, os->packet_size, os->audio_tag, os->private_str); -+ avio_printf(out, "\n", index, s->streams[i]->codecpar->bit_rate, os->fourcc, s->streams[i]->codecpar->sample_rate, s->streams[i]->codecpar->channels, os->packet_size, os->audio_tag, os->private_str); - index++; - } - output_chunk_list(&c->streams[last], out, final, c->lookahead_count, c->window_size); -@@ -324,7 +324,7 @@ static int ism_write_header(AVFormatContext *s) - ret = AVERROR(EINVAL); - goto fail; - } -- snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%"PRId64")", s->filename, (int64_t)s->streams[i]->codecpar->bit_rate); -+ snprintf(os->dirname, sizeof(os->dirname), "%s/QualityLevels(%d)", s->filename, s->streams[i]->codecpar->bit_rate); - if (mkdir(os->dirname, 0777) == -1 && errno != EEXIST) { - ret = AVERROR(errno); - av_log(s, AV_LOG_ERROR, "mkdir failed\n"); -diff --git a/libavformat/vqf.c b/libavformat/vqf.c -index 841840e..b5cdb78 100644 ---- a/libavformat/vqf.c -+++ b/libavformat/vqf.c -@@ -211,8 +211,8 @@ static int vqf_read_header(AVFormatContext *s) - size = 2048; - break; - default: -- av_log(s, AV_LOG_ERROR, "Mode not supported: %d Hz, %"PRId64" kb/s.\n", -- st->codecpar->sample_rate, (int64_t)st->codecpar->bit_rate); -+ av_log(s, AV_LOG_ERROR, "Mode not supported: %d Hz, %d kb/s.\n", -+ st->codecpar->sample_rate, st->codecpar->bit_rate); - return -1; - } - c->frame_bit_len = st->codecpar->bit_rate*size/st->codecpar->sample_rate; diff --git a/archive-patches/ffmpeg/0003-ffmpeg-increase-IO-BUFFER-SIZE-to-128k.patch b/archive-patches/ffmpeg/0003-ffmpeg-increase-IO-BUFFER-SIZE-to-128k.patch new file mode 100644 index 0000000..9bff24c --- /dev/null +++ b/archive-patches/ffmpeg/0003-ffmpeg-increase-IO-BUFFER-SIZE-to-128k.patch @@ -0,0 +1,17 @@ +diff --git a/libavformat/aviobuf.c b/libavformat/aviobuf.c +index c2681ed..711fff8 100644 +--- a/libavformat/aviobuf.c ++++ b/libavformat/aviobuf.c +@@ -33,7 +33,7 @@ + #include "url.h" + #include + +-#define IO_BUFFER_SIZE 32768 ++#define IO_BUFFER_SIZE 131072 + + /** + * Do seeks within this distance ahead of the current buffer by skipping +-- +2.7.4.1.g5468f9e + + diff --git a/archive-patches/ffmpeg/0005-ffmpeg-fix-pts-for-cooli.patch b/archive-patches/ffmpeg/0005-ffmpeg-fix-pts-for-cooli.patch new file mode 100644 index 0000000..bad6105 --- /dev/null +++ b/archive-patches/ffmpeg/0005-ffmpeg-fix-pts-for-cooli.patch @@ -0,0 +1,15 @@ +--- a/libavformat/mpegts.c 2016-06-27 02:54:30.000000000 +0300 ++++ b/libavformat/mpegts.c 2016-08-20 01:39:36.668873256 +0300 +@@ -904,10 +904,10 @@ + pes->buffer = NULL; + reset_pes_packet_state(pes); + +- sd = av_packet_new_side_data(pkt, AV_PKT_DATA_MPEGTS_STREAM_ID, 1); ++ /*sd = av_packet_new_side_data(pkt, AV_PKT_DATA_MPEGTS_STREAM_ID, 1); + if (!sd) + return AVERROR(ENOMEM); +- *sd = pes->stream_id; ++ *sd = pes->stream_id;*/ + + return 0; + } diff --git a/archive-patches/ffmpeg/0006-ffmpeg-fix-sps-pps-for-cooli.patch b/archive-patches/ffmpeg/0006-ffmpeg-fix-sps-pps-for-cooli.patch new file mode 100755 index 0000000..8d87f3a --- /dev/null +++ b/archive-patches/ffmpeg/0006-ffmpeg-fix-sps-pps-for-cooli.patch @@ -0,0 +1,29 @@ +From 1c7b83f945e710a17a41ad9feb7dc929f26f2b0e Mon Sep 17 00:00:00 2001 +From: Jacek Jendrzej +Date: Wed, 28 Jun 2017 11:38:20 +0200 +Subject: [PATCH] fix sps/pps for cooli;This is commit that breaks seek in some + mkv.break with commit 6d2219e9f950b96279fd8464cc11c4d02518b629 + +--- + libavcodec/h264_mp4toannexb_bsf.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/libavcodec/h264_mp4toannexb_bsf.c b/libavcodec/h264_mp4toannexb_bsf.c +index 163d0f59ce..c895cf2829 100644 +--- a/libavcodec/h264_mp4toannexb_bsf.c ++++ b/libavcodec/h264_mp4toannexb_bsf.c +@@ -235,6 +235,11 @@ static int h264_mp4toannexb_filter(AVBSFContext *ctx, AVPacket *out) + if (!s->new_idr && unit_type == 5 && (buf[1] & 0x80)) + s->new_idr = 1; + ++ if (s->new_idr && unit_type == 6 && s->idr_sps_seen && s->idr_pps_seen){ ++ s->idr_sps_seen= 0; ++ s->idr_pps_seen= 0; ++ } ++ + /* prepend only to the first type 5 NAL unit of an IDR picture, if no sps/pps are already present */ + if (s->new_idr && unit_type == 5 && !s->idr_sps_seen && !s->idr_pps_seen) { + if ((ret=alloc_and_copy(out, +-- +2.13.2 + diff --git a/archive-patches/ffmpeg/0007-ffmpeg-reset-compressed-header-flag.patch b/archive-patches/ffmpeg/0007-ffmpeg-reset-compressed-header-flag.patch new file mode 100644 index 0000000..7d94b3d --- /dev/null +++ b/archive-patches/ffmpeg/0007-ffmpeg-reset-compressed-header-flag.patch @@ -0,0 +1,11 @@ +# reset compressed header flag, fix http 302 request +--- a/libavformat/http.c 2017-05-04 15:49:41.890902000 +0200 ++++ b/libavformat/http.c 2017-07-30 11:30:47.502581448 +0200 +@@ -1248,6 +1248,7 @@ + s->willclose = 0; + s->end_chunked_post = 0; + s->end_header = 0; ++ s->compressed = 0; + if (post && !s->post_data && !send_expect_100) { + /* Pretend that it did work. We didn't read any header yet, since + * we've still to send the POST data, but the code calling this diff --git a/archive-patches/ffmpeg/0008-add-ASF-VC1-Annex-G-and-RCV-bitstream-filters.-Origi.patch b/archive-patches/ffmpeg/0008-add-ASF-VC1-Annex-G-and-RCV-bitstream-filters.-Origi.patch new file mode 100644 index 0000000..166b4a5 --- /dev/null +++ b/archive-patches/ffmpeg/0008-add-ASF-VC1-Annex-G-and-RCV-bitstream-filters.-Origi.patch @@ -0,0 +1,335 @@ +From c6f8769255ec6c4bb4ce02879d2332461ef1e24e Mon Sep 17 00:00:00 2001 +From: Jacek Jendrzej +Date: Sat, 12 Aug 2017 17:05:08 +0200 +Subject: [PATCH 7/7] add ASF VC1 Annex-G and RCV bitstream filters. Originally + done by Google but modified by us to convert certain VC1 in MKV without + startcodes. port fot 3.x + +Signed-off-by: Jacek Jendrzej +--- + libavcodec/Makefile | 2 + + libavcodec/bitstream_filters.c | 2 + + libavcodec/vc1_asftoannexg_bsf.c | 182 +++++++++++++++++++++++++++++++++++++++ + libavcodec/vc1_asftorcv_bsf.c | 95 ++++++++++++++++++++ + 4 files changed, 281 insertions(+) + create mode 100644 libavcodec/vc1_asftoannexg_bsf.c + create mode 100644 libavcodec/vc1_asftorcv_bsf.c + +diff --git a/libavcodec/Makefile b/libavcodec/Makefile +index 982d7f5179..1ea13ddb01 100644 +--- a/libavcodec/Makefile ++++ b/libavcodec/Makefile +@@ -1003,6 +1003,8 @@ OBJS-$(CONFIG_TEXT2MOVSUB_BSF) += movsub_bsf.o + OBJS-$(CONFIG_VP9_RAW_REORDER_BSF) += vp9_raw_reorder_bsf.o + OBJS-$(CONFIG_VP9_SUPERFRAME_BSF) += vp9_superframe_bsf.o + OBJS-$(CONFIG_VP9_SUPERFRAME_SPLIT_BSF) += vp9_superframe_split_bsf.o ++OBJS-$(CONFIG_VC1_ASFTORCV_BSF) += vc1_asftorcv_bsf.o ++OBJS-$(CONFIG_VC1_ASFTOANNEXG_BSF) += vc1_asftoannexg_bsf.o vc1.o \ + + # thread libraries + OBJS-$(HAVE_LIBC_MSVCRT) += file_open.o +diff --git a/libavcodec/bitstream_filters.c b/libavcodec/bitstream_filters.c +index ce34de640d..e1c5c0a848 100644 +--- a/libavcodec/bitstream_filters.c ++++ b/libavcodec/bitstream_filters.c +@@ -44,6 +44,8 @@ extern const AVBitStreamFilter ff_text2movsub_bsf; + extern const AVBitStreamFilter ff_vp9_raw_reorder_bsf; + extern const AVBitStreamFilter ff_vp9_superframe_bsf; + extern const AVBitStreamFilter ff_vp9_superframe_split_bsf; ++extern const AVBitStreamFilter ff_vc1_asftoannexg_bsf; ++extern const AVBitStreamFilter ff_vc1_asftorcv_bsf; + + #include "libavcodec/bsf_list.c" + +diff --git a/libavcodec/vc1_asftoannexg_bsf.c b/libavcodec/vc1_asftoannexg_bsf.c +new file mode 100644 +index 0000000000..83a31591be +--- /dev/null ++++ b/libavcodec/vc1_asftoannexg_bsf.c +@@ -0,0 +1,182 @@ ++/* ++ * copyright (c) 2010 Google Inc. ++ * copyright (c) 2013 CoolStream International Ltd. ++ * copyright (c) 2017 Jacek Jendrzej port to 3.x ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#include "avcodec.h" ++#include "bytestream.h" ++#include "vc1.h" ++#include "bsf.h" ++ ++// An arbitrary limit in bytes greater than the current bytes used. ++#define MAX_SEQ_HEADER_SIZE 50 ++ ++typedef struct ASFTOANNEXGBSFContext { ++ int frames; ++ uint8_t *seq_header; ++ int seq_header_size; ++ uint8_t *ep_header; ++ int ep_header_size; ++} ASFTOANNEXGBSFContext; ++ ++static int find_codec_data(ASFTOANNEXGBSFContext *ctx, uint8_t *data, int data_size, int keyframe) { ++ const uint8_t *start = data; ++ const uint8_t *end = data + data_size; ++ const uint8_t *next; ++ int size; ++ int has_seq_header = 0; ++ int has_ep_header = 0; ++ int has_frame_header = 0; ++ ++ start = find_next_marker(start, end); ++ next = start; ++ for(; next < end; start = next){ ++ next = find_next_marker(start + 4, end); ++ size = next - start; ++ if(size <= 0) continue; ++ switch(AV_RB32(start)){ ++ case VC1_CODE_SEQHDR: ++ has_seq_header = 1; ++ break; ++ case VC1_CODE_ENTRYPOINT: ++ has_ep_header = 1; ++ break; ++ case VC1_CODE_FRAME: ++ has_frame_header = 1; ++ break; ++ default: ++ break; ++ } ++ } ++ ++ if((has_seq_header && has_ep_header && has_frame_header && keyframe) || ++ (!has_seq_header && !has_ep_header && has_frame_header) ) return 0; ++ ++ return -1; ++} ++ ++static int parse_extradata(ASFTOANNEXGBSFContext *ctx, uint8_t *extradata, int extradata_size) { ++ const uint8_t *start = extradata; ++ const uint8_t *end = extradata + extradata_size; ++ const uint8_t *next; ++ int size; ++ ++ start = find_next_marker(start, end); ++ next = start; ++ for(; next < end; start = next){ ++ next = find_next_marker(start + 4, end); ++ size = next - start; ++ if(size <= 0) continue; ++ switch(AV_RB32(start)){ ++ case VC1_CODE_SEQHDR: ++ ctx->seq_header = av_mallocz(size); ++ ctx->seq_header_size = size; ++ memcpy(ctx->seq_header, start, size); ++ break; ++ case VC1_CODE_ENTRYPOINT: ++ ctx->ep_header = av_malloc(size); ++ ctx->ep_header_size = size; ++ memcpy(ctx->ep_header, start, size); ++ break; ++ default: ++ break; ++ } ++ } ++ ++ if(!ctx->seq_header || !ctx->ep_header) { ++ av_log(NULL, AV_LOG_ERROR, "Incomplete extradata\n"); ++ return -1; ++ } ++ return 0; ++} ++ ++static int asftoannexg_filter(AVBSFContext *ctx, AVPacket *out) ++{ ++ ASFTOANNEXGBSFContext* bsfctx = ctx->priv_data; ++ AVPacket *in; ++ int keyframe = 0; ++ int ret = 0; ++ uint8_t* bs = NULL; ++ ++ ret = ff_bsf_get_packet(ctx, &in); ++ if (ret < 0) ++ return ret; ++ ++ keyframe = in->flags & AV_PKT_FLAG_KEY; ++ if(in->size >= 1 && !find_codec_data(bsfctx, in->data, in->size, keyframe)) { ++// av_log(NULL, AV_LOG_INFO, "Nothing to do: %i\n",in->size); ++ out->data = in->data; ++ out->size = in->size; ++ return 0; ++ } ++ ++ if(!ctx->par_in->extradata || ctx->par_in->extradata_size < 16) { ++ av_log(NULL, AV_LOG_INFO, "Extradata size too small: %i\n", ctx->par_in->extradata_size); ++ out->data = in->data; ++ out->size = in->size; ++ return 0; ++ } ++ ++ if (!bsfctx->frames && parse_extradata(bsfctx, ctx->par_in->extradata , ctx->par_in->extradata_size ) < 0) { ++ av_freep(in); ++ av_log(NULL, AV_LOG_ERROR, "Cannot parse extra data!\n"); ++ return -1; ++ } ++ ++ if (keyframe) { ++ // If this is the keyframe, need to put sequence header and entry point header. ++ out->size = bsfctx->seq_header_size + bsfctx->ep_header_size + 4 + in->size; ++ out->data = av_malloc(out->size); ++ bs = out->data; ++ ++ memcpy(bs, bsfctx->seq_header, bsfctx->seq_header_size); ++ bs += bsfctx->seq_header_size; ++ memcpy(bs, bsfctx->ep_header, bsfctx->ep_header_size); ++ bs += bsfctx->ep_header_size; ++ } else { ++ out->size = 4 + in->size; ++ out->data = av_malloc(out->size); ++ bs = out->data; ++ } ++ ++ // Put the frame start code and frame data. ++ bytestream_put_be32(&bs, VC1_CODE_FRAME); ++ memcpy(bs, in->data, in->size); ++ ++bsfctx->frames; ++ return 1; ++ ++ } ++ ++static void asftoannexg_close(AVBSFContext *bsfc) { ++ ASFTOANNEXGBSFContext *bsfctx = bsfc->priv_data; ++ av_freep(&bsfctx->seq_header); ++ av_freep(&bsfctx->ep_header); ++} ++ ++static const enum AVCodecID codec_ids[] = { ++ AV_CODEC_ID_VC1, AV_CODEC_ID_NONE, ++}; ++ ++AVBitStreamFilter ff_vc1_asftoannexg_bsf = { ++ .name = "vc1_asftoannexg", ++ .priv_data_size = sizeof(ASFTOANNEXGBSFContext), ++ .filter = asftoannexg_filter, ++ .close = asftoannexg_close, ++ .codec_ids = codec_ids ++}; +diff --git a/libavcodec/vc1_asftorcv_bsf.c b/libavcodec/vc1_asftorcv_bsf.c +new file mode 100644 +index 0000000000..ee338d384c +--- /dev/null ++++ b/libavcodec/vc1_asftorcv_bsf.c +@@ -0,0 +1,95 @@ ++/* ++ * copyright (c) 2010 Google Inc. ++ * copyright (c) 2017 Jacek Jendrzej port to 3.x ++ * This file is part of FFmpeg. ++ * ++ * FFmpeg is free software; you can redistribute it and/or ++ * modify it under the terms of the GNU Lesser General Public ++ * License as published by the Free Software Foundation; either ++ * version 2.1 of the License, or (at your option) any later version. ++ * ++ * FFmpeg is distributed in the hope that it will be useful, ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ * Lesser General Public License for more details. ++ * ++ * You should have received a copy of the GNU Lesser General Public ++ * License along with FFmpeg; if not, write to the Free Software ++ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ */ ++ ++#include "avcodec.h" ++#include "bytestream.h" ++#include "bsf.h" ++ ++#define RCV_STREAM_HEADER_SIZE 36 ++#define RCV_PICTURE_HEADER_SIZE 8 ++ ++typedef struct ASFTORCVBSFContext { ++ int frames; ++} ASFTORCVBSFContext; ++ ++static int asftorcv_filter(AVBSFContext *ctx, AVPacket *out){ ++ ASFTORCVBSFContext* bsfctx = ctx->priv_data; ++ AVPacket *in; ++ int keyframe = 0; ++ int ret = 0; ++ uint8_t* bs = NULL; ++ ++ ret = ff_bsf_get_packet(ctx, &in); ++ if (ret < 0) ++ return ret; ++ ++ keyframe = in->flags & AV_PKT_FLAG_KEY; ++ ++ if (!bsfctx->frames) { ++ // Write the header if this is the first frame. ++ out->data = av_malloc(RCV_STREAM_HEADER_SIZE + RCV_PICTURE_HEADER_SIZE + in->size); ++ out->size = RCV_STREAM_HEADER_SIZE + RCV_PICTURE_HEADER_SIZE + in->size; ++ bs = out->data; ++ ++ // The following structure of stream header comes from libavformat/vc1testenc.c. ++ bytestream_put_le24(&bs, 0); // Frame count. 0 for streaming. ++ bytestream_put_byte(&bs, 0xC5); ++ bytestream_put_le32(&bs, 4); // 4 bytes of extra data. ++ bytestream_put_byte(&bs, ctx->par_in->extradata[0]); ++ bytestream_put_byte(&bs, ctx->par_in->extradata[1]); ++ bytestream_put_byte(&bs, ctx->par_in->extradata[2]); ++ bytestream_put_byte(&bs, ctx->par_in->extradata[3]); ++ bytestream_put_le32(&bs, ctx->par_in->height); ++ bytestream_put_le32(&bs, ctx->par_in->width); ++ bytestream_put_le32(&bs, 0xC); ++ bytestream_put_le24(&bs, 0); // hrd_buffer ++ bytestream_put_byte(&bs, 0x80); // level|cbr|res1 ++ bytestream_put_le32(&bs, 0); // hrd_rate ++ ++ // The following LE32 describes the frame rate. Since we don't care so fill ++ // it with 0xFFFFFFFF which means variable framerate. ++ // See: libavformat/vc1testenc.c ++ bytestream_put_le32(&bs, 0xFFFFFFFF); ++ } else { ++ out->data = av_malloc(RCV_PICTURE_HEADER_SIZE + in->size); ++ out->size = RCV_PICTURE_HEADER_SIZE + in->size; ++ bs = out->data; ++ } ++ ++ // Write the picture header. ++ bytestream_put_le32(&bs, in->size | (keyframe ? 0x80000000 : 0)); ++ ++ // The following LE32 describes the pts. Since we don't care so fill it with 0. ++ bytestream_put_le32(&bs, 0); ++ memcpy(bs, in->data, in->size); ++ ++ ++bsfctx->frames; ++ return 0; ++} ++ ++static const enum AVCodecID codec_ids[] = { ++ AV_CODEC_ID_WMV3, AV_CODEC_ID_NONE, ++}; ++ ++AVBitStreamFilter ff_vc1_asftorcv_bsf = { ++ .name = "vc1_asftorcv", ++ .priv_data_size = sizeof(ASFTORCVBSFContext), ++ .filter = asftorcv_filter ++}; +-- +2.14.1 + diff --git a/doc/config.example b/doc/config.example index 800f3ad..47aa64f 100755 --- a/doc/config.example +++ b/doc/config.example @@ -51,8 +51,8 @@ CST_DRIVER_VERSION=master # choose one of the following coolstream ffmpeg versions: # CST_FFMPEG_VERSION=ffmpeg-head -# CST_FFMPEG_VERSION=ffmpeg-2.3.3 -CST_FFMPEG_VERSION=ffmpeg-head +# CST_FFMPEG_VERSION=ffmpeg-3.3 +CST_FFMPEG_VERSION=ffmpeg-3.3 ########################################################################################### ### SYSTEMTOOLS diff --git a/make/bootstrap.mk b/make/bootstrap.mk index 05cf7f4..f30a7ba 100755 --- a/make/bootstrap.mk +++ b/make/bootstrap.mk @@ -79,6 +79,9 @@ $(HOSTPREFIX)/bin/get%.sh: | $(HOSTPREFIX)/bin $(TARGETPREFIX)/lib: | $(TARGETPREFIX) mkdir -p $@ cp -a $(SOURCE_DIR)/git/DRIVERS/$(DRIVER_DIR)/libs/* $@/ + if [ "$(CST_FFMPEG_VERSION)" = "ffmpeg-3.3" ]; then \ + cp -a $(SOURCE_DIR)/git/DRIVERS/$(DRIVER_DIR)/libs-$(CST_FFMPEG_VERSION)/* $@/; \ + fi $(TARGETPREFIX)/lib/firmware: | $(TARGETPREFIX) mkdir -p $@ diff --git a/make/libraries.mk b/make/libraries.mk index d1e7ae8..762f844 100755 --- a/make/libraries.mk +++ b/make/libraries.mk @@ -540,8 +540,13 @@ $(D)/ffmpeg: $(D)/libxml2 $(D)/librtmp $(D)/libroxml $(ARCHIVE)/ffmpeg-git-$(FFM set -e; pushd $(BUILD_TMP)/ffmpeg-git-$(FFMPEG_GIT) && \ $(PATCH)/ffmpeg/0001-ffmpeg-hds-libroxml-3.x.patch; \ $(PATCH)/ffmpeg/0002-ffmpeg-aac-3.x.patch; \ - $(PATCH)/ffmpeg/0003-ffmpeg-Revert-lavc-Switch-bitrate-to-64bit.patch; \ + $(PATCH)/ffmpeg/0003-ffmpeg-increase-IO-BUFFER-SIZE-to-128k.patch; \ + $(PATCH)/ffmpeg/0003-Revert-libavformat-aviobuf-keep-track-of-the-original-buffer-size-and-restore-it-after.patch; \ $(PATCH)/ffmpeg/0004-FFmpeg-devel-v14*.patch; \ + $(PATCH)/ffmpeg/0005-ffmpeg-fix-pts-for-cooli.patch; \ + $(PATCH)/ffmpeg/0006-ffmpeg-fix-sps-pps-for-cooli.patch; \ + $(PATCH)/ffmpeg/0007-ffmpeg-reset-compressed-header-flag.patch; \ + $(PATCH)/ffmpeg/0008-add-ASF-VC1-Annex-G-and-RCV-bitstream-filters.-Origi.patch; \ $(BUILDENV) \ ./configure \ $(FFMPEG_CONFIGURE) \ diff --git a/make/prerequisites.mk b/make/prerequisites.mk index e6ebc66..45dd965 100755 --- a/make/prerequisites.mk +++ b/make/prerequisites.mk @@ -80,19 +80,6 @@ $(GIT_DRIVERS): git checkout $(CST_DRIVER_VERSION); \ fi -$(GIT_LIBRARIES)/ffmpeg: - mkdir -p $(GIT_LIBRARIES) - cd $(GIT_LIBRARIES) && \ - if [ -d $(GIT_LIBRARIES)/ffmpeg/$(CST_FFMPEG_VERSION)/ ]; then \ - cd $(GIT_LIBRARIES)/ffmpeg/$(CST_FFMPEG_VERSION) && \ - git checkout $(CST_FFMPEG_VERSION); \ - git pull origin $(CST_FFMPEG_VERSION); \ - else \ - git clone $(CSGIT)/$(REPO_LIBRARY_FFMPEG_CST) ffmpeg/$(CST_FFMPEG_VERSION); \ - cd $(GIT_LIBRARIES)/ffmpeg/$(CST_FFMPEG_VERSION) && \ - git checkout $(CST_FFMPEG_VERSION); \ - fi - $(GIT_KERNEL): mkdir -p $(SOURCE_DIR)/git mkdir -p $(GIT_KERNEL) @@ -123,6 +110,5 @@ PHONY += $(SOURCE_DIR)/neutrino-hd PHONY += $(GIT_BOOTLOADER) PHONY += $(GIT_DRIVERS_THIRDPARTY) PHONY += $(GIT_DRIVERS) -PHONY += $(GIT_LIBRARIES)/ffmpeg PHONY += $(GIT_KERNEL) PHONY += $(GIT_PLUGINS) diff --git a/make/versions.mk b/make/versions.mk index 4193f8e..b32dd8a 100644 --- a/make/versions.mk +++ b/make/versions.mk @@ -44,7 +44,7 @@ E2FSPROGS_VER=1.42.13 # C library for parsing XML EXPAT_VER = 2.2.0 -# A complete, cross-platform solution to record, convert and stream audio and video +# FFMPEG-3.3 | A complete, cross-platform solution to record, convert and stream audio and video FFMPEG_GIT = 2ba896f # FLEX (the fast lexical analyser) -- 2.39.5