Comments (14)
Did you try with
brew install amiaopensource/amiaos/decklinksdk
as explained in the ReadMe, or did you use another formula?
from homebrew-ffmpeg.
Did you try with
brew install amiaopensource/amiaos/decklinksdk
as explained in the ReadMe, or did you use another formula?
Yeah, I also tried that one and got exactly the same errors.
And I also tried on Apple Silicon+Monterey, Intel+Monterey and Intel+Big Sur. Same results.
from homebrew-ffmpeg.
I see. Could you possibly check if with the following patch it works?
Signed-off-by: Paul B Mahol <[email protected]>
---
fftools/ffmpeg.c | 5 +
fftools/ffmpeg.h | 1 +
fftools/ffmpeg_opt.c | 1 +
tests/ref/fate/adpcm-ima-smjpeg | 658 ++++++++++++++++----------------
tests/ref/fate/dcinema-encode | 26 +-
tests/ref/lavf/smjpeg | 2 +-
6 files changed, 350 insertions(+), 343 deletions(-)
diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c
index b0ce7c7c32..bde36dbb12 100644
--- a/fftools/ffmpeg.c
+++ b/fftools/ffmpeg.c
@@ -2382,6 +2382,11 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output,
decoded_frame->pts = ist->dts;
decoded_frame_tb = AV_TIME_BASE_Q;
}
+ if (pkt && pkt->duration && ist->prev_pkt_pts != AV_NOPTS_VALUE &&
+ pkt->pts != AV_NOPTS_VALUE && pkt->pts - ist->prev_pkt_pts > pkt->duration)
+ ist->filter_in_rescale_delta_last = 0;
+ if (pkt)
+ ist->prev_pkt_pts = pkt->pts;
if (decoded_frame->pts != AV_NOPTS_VALUE)
decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts,
(AVRational){1, avctx->sample_rate}, decoded_frame->nb_samples, &ist->filter_in_rescale_delta_last,
diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h
index d2dd7ca092..6657773d32 100644
--- a/fftools/ffmpeg.h
+++ b/fftools/ffmpeg.h
@@ -313,6 +313,7 @@ typedef struct InputStream {
AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */
AVPacket *pkt;
+ int64_t prev_pkt_pts;
int64_t start; /* time when read started */
/* predicted dts of the next packet read for this stream or (when there are
* several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */
diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c
index 428934a3d8..a7d35b1ee2 100644
--- a/fftools/ffmpeg_opt.c
+++ b/fftools/ffmpeg_opt.c
@@ -867,6 +867,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
}
ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE;
+ ist->prev_pkt_pts = AV_NOPTS_VALUE;
ist->dec_ctx = avcodec_alloc_context3(ist->dec);
if (!ist->dec_ctx) {
--
2.17.1
--
X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/7539a01bb0ea24998e1aa87706edf9785ddd3ac6..57aaeff523ec45039c564765673c998ee900d4f9:/libavformat/dv.c
diff --git a/libavformat/dv.c b/libavformat/dv.c
index cbb38cbd7d..d7909683c3 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -40,12 +40,22 @@
#include "dv.h"
#include "libavutil/avassert.h"
+// Must be kept in sync with AVPacket
+struct DVPacket {
+ int64_t pts;
+ uint8_t *data;
+ int size;
+ int stream_index;
+ int flags;
+ int64_t pos;
+};
+
struct DVDemuxContext {
const AVDVProfile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */
AVFormatContext* fctx;
AVStream* vst;
AVStream* ast[4];
- AVPacket audio_pkt[4];
+ struct DVPacket audio_pkt[4];
uint8_t audio_buf[4][8192];
int ach;
int frames;
@@ -261,11 +271,12 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame)
c->ast[i]->codecpar->codec_type = AVMEDIA_TYPE_AUDIO;
c->ast[i]->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE;
- av_init_packet(&c->audio_pkt[i]);
c->audio_pkt[i].size = 0;
c->audio_pkt[i].data = c->audio_buf[i];
c->audio_pkt[i].stream_index = c->ast[i]->index;
c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY;
+ c->audio_pkt[i].pts = AV_NOPTS_VALUE;
+ c->audio_pkt[i].pos = -1;
}
c->ast[i]->codecpar->sample_rate = dv_audio_frequency[freq];
c->ast[i]->codecpar->channels = 2;
@@ -358,7 +369,13 @@ int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
for (i = 0; i < c->ach; i++) {
if (c->ast[i] && c->audio_pkt[i].size) {
- *pkt = c->audio_pkt[i];
+ pkt->size = c->audio_pkt[i].size;
+ pkt->data = c->audio_pkt[i].data;
+ pkt->stream_index = c->audio_pkt[i].stream_index;
+ pkt->flags = c->audio_pkt[i].flags;
+ pkt->pts = c->audio_pkt[i].pts;
+ pkt->pos = c->audio_pkt[i].pos;
+
c->audio_pkt[i].size = 0;
size = pkt->size;
break;
@@ -404,7 +421,6 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
/* Now it's time to return video packet */
size = dv_extract_video_info(c, buf);
- av_init_packet(pkt);
pkt->data = buf;
pkt->pos = pos;
pkt->size = size;
--
Signed-off-by: Paul B Mahol <[email protected]>
---
libavformat/dv.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/libavformat/dv.c b/libavformat/dv.c
index d7909683c3..b2b74162df 100644
--- a/libavformat/dv.c
+++ b/libavformat/dv.c
@@ -48,6 +48,7 @@ struct DVPacket {
int stream_index;
int flags;
int64_t pos;
+ int64_t duration;
};
struct DVDemuxContext {
@@ -276,6 +277,7 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame)
c->audio_pkt[i].stream_index = c->ast[i]->index;
c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY;
c->audio_pkt[i].pts = AV_NOPTS_VALUE;
+ c->audio_pkt[i].duration = 0;
c->audio_pkt[i].pos = -1;
}
c->ast[i]->codecpar->sample_rate = dv_audio_frequency[freq];
@@ -374,6 +376,7 @@ int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt)
pkt->stream_index = c->audio_pkt[i].stream_index;
pkt->flags = c->audio_pkt[i].flags;
pkt->pts = c->audio_pkt[i].pts;
+ pkt->duration = c->audio_pkt[i].duration;
pkt->pos = c->audio_pkt[i].pos;
c->audio_pkt[i].size = 0;
@@ -404,6 +407,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt,
c->audio_pkt[i].pos = pos;
c->audio_pkt[i].size = size;
c->audio_pkt[i].pts = (c->sys->height == 720) ? (c->frames & ~1) : c->frames;
+ c->audio_pkt[i].duration = 1;
ppcm[i] = c->audio_buf[i];
}
if (c->ach)
--
2.17.1
from homebrew-ffmpeg.
I see. Could you possibly check if with the following patch it works?
Signed-off-by: Paul B Mahol <[email protected]> --- fftools/ffmpeg.c | 5 + fftools/ffmpeg.h | 1 + fftools/ffmpeg_opt.c | 1 + tests/ref/fate/adpcm-ima-smjpeg | 658 ++++++++++++++++---------------- tests/ref/fate/dcinema-encode | 26 +- tests/ref/lavf/smjpeg | 2 +- 6 files changed, 350 insertions(+), 343 deletions(-) diff --git a/fftools/ffmpeg.c b/fftools/ffmpeg.c index b0ce7c7c32..bde36dbb12 100644 --- a/fftools/ffmpeg.c +++ b/fftools/ffmpeg.c @@ -2382,6 +2382,11 @@ static int decode_audio(InputStream *ist, AVPacket *pkt, int *got_output, decoded_frame->pts = ist->dts; decoded_frame_tb = AV_TIME_BASE_Q; } + if (pkt && pkt->duration && ist->prev_pkt_pts != AV_NOPTS_VALUE && + pkt->pts != AV_NOPTS_VALUE && pkt->pts - ist->prev_pkt_pts > pkt->duration) + ist->filter_in_rescale_delta_last = 0; + if (pkt) + ist->prev_pkt_pts = pkt->pts; if (decoded_frame->pts != AV_NOPTS_VALUE) decoded_frame->pts = av_rescale_delta(decoded_frame_tb, decoded_frame->pts, (AVRational){1, avctx->sample_rate}, decoded_frame->nb_samples, &ist->filter_in_rescale_delta_last, diff --git a/fftools/ffmpeg.h b/fftools/ffmpeg.h index d2dd7ca092..6657773d32 100644 --- a/fftools/ffmpeg.h +++ b/fftools/ffmpeg.h @@ -313,6 +313,7 @@ typedef struct InputStream { AVFrame *filter_frame; /* a ref of decoded_frame, to be sent to filters */ AVPacket *pkt; + int64_t prev_pkt_pts; int64_t start; /* time when read started */ /* predicted dts of the next packet read for this stream or (when there are * several frames in a packet) of the next frame in current packet (in AV_TIME_BASE units) */ diff --git a/fftools/ffmpeg_opt.c b/fftools/ffmpeg_opt.c index 428934a3d8..a7d35b1ee2 100644 --- a/fftools/ffmpeg_opt.c +++ b/fftools/ffmpeg_opt.c @@ -867,6 +867,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic) } ist->filter_in_rescale_delta_last = AV_NOPTS_VALUE; + ist->prev_pkt_pts = AV_NOPTS_VALUE; ist->dec_ctx = avcodec_alloc_context3(ist->dec); if (!ist->dec_ctx) { -- 2.17.1 -- X-Git-Url: http://git.ffmpeg.org/gitweb/ffmpeg.git/blobdiff_plain/7539a01bb0ea24998e1aa87706edf9785ddd3ac6..57aaeff523ec45039c564765673c998ee900d4f9:/libavformat/dv.c diff --git a/libavformat/dv.c b/libavformat/dv.c index cbb38cbd7d..d7909683c3 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -40,12 +40,22 @@ #include "dv.h" #include "libavutil/avassert.h" +// Must be kept in sync with AVPacket +struct DVPacket { + int64_t pts; + uint8_t *data; + int size; + int stream_index; + int flags; + int64_t pos; +}; + struct DVDemuxContext { const AVDVProfile* sys; /* Current DV profile. E.g.: 525/60, 625/50 */ AVFormatContext* fctx; AVStream* vst; AVStream* ast[4]; - AVPacket audio_pkt[4]; + struct DVPacket audio_pkt[4]; uint8_t audio_buf[4][8192]; int ach; int frames; @@ -261,11 +271,12 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame) c->ast[i]->codecpar->codec_type = AVMEDIA_TYPE_AUDIO; c->ast[i]->codecpar->codec_id = AV_CODEC_ID_PCM_S16LE; - av_init_packet(&c->audio_pkt[i]); c->audio_pkt[i].size = 0; c->audio_pkt[i].data = c->audio_buf[i]; c->audio_pkt[i].stream_index = c->ast[i]->index; c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY; + c->audio_pkt[i].pts = AV_NOPTS_VALUE; + c->audio_pkt[i].pos = -1; } c->ast[i]->codecpar->sample_rate = dv_audio_frequency[freq]; c->ast[i]->codecpar->channels = 2; @@ -358,7 +369,13 @@ int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt) for (i = 0; i < c->ach; i++) { if (c->ast[i] && c->audio_pkt[i].size) { - *pkt = c->audio_pkt[i]; + pkt->size = c->audio_pkt[i].size; + pkt->data = c->audio_pkt[i].data; + pkt->stream_index = c->audio_pkt[i].stream_index; + pkt->flags = c->audio_pkt[i].flags; + pkt->pts = c->audio_pkt[i].pts; + pkt->pos = c->audio_pkt[i].pos; + c->audio_pkt[i].size = 0; size = pkt->size; break; @@ -404,7 +421,6 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, /* Now it's time to return video packet */ size = dv_extract_video_info(c, buf); - av_init_packet(pkt); pkt->data = buf; pkt->pos = pos; pkt->size = size; -- Signed-off-by: Paul B Mahol <[email protected]> --- libavformat/dv.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libavformat/dv.c b/libavformat/dv.c index d7909683c3..b2b74162df 100644 --- a/libavformat/dv.c +++ b/libavformat/dv.c @@ -48,6 +48,7 @@ struct DVPacket { int stream_index; int flags; int64_t pos; + int64_t duration; }; struct DVDemuxContext { @@ -276,6 +277,7 @@ static int dv_extract_audio_info(DVDemuxContext *c, const uint8_t *frame) c->audio_pkt[i].stream_index = c->ast[i]->index; c->audio_pkt[i].flags |= AV_PKT_FLAG_KEY; c->audio_pkt[i].pts = AV_NOPTS_VALUE; + c->audio_pkt[i].duration = 0; c->audio_pkt[i].pos = -1; } c->ast[i]->codecpar->sample_rate = dv_audio_frequency[freq]; @@ -374,6 +376,7 @@ int avpriv_dv_get_packet(DVDemuxContext *c, AVPacket *pkt) pkt->stream_index = c->audio_pkt[i].stream_index; pkt->flags = c->audio_pkt[i].flags; pkt->pts = c->audio_pkt[i].pts; + pkt->duration = c->audio_pkt[i].duration; pkt->pos = c->audio_pkt[i].pos; c->audio_pkt[i].size = 0; @@ -404,6 +407,7 @@ int avpriv_dv_produce_packet(DVDemuxContext *c, AVPacket *pkt, c->audio_pkt[i].pos = pos; c->audio_pkt[i].size = size; c->audio_pkt[i].pts = (c->sys->height == 720) ? (c->frames & ~1) : c->frames; + c->audio_pkt[i].duration = 1; ppcm[i] = c->audio_buf[i]; } if (c->ach) -- 2.17.1
I would like to, but don't know how to do that exactly.
from homebrew-ffmpeg.
Okay. Then please test if this version works (I am afraid, I cannot do it myself before next week):
brew tap avpres/formulae/ffmpeg
brew install avpres/formulae/ffmpeg --with-srt --with-decklink
If it works, I will integrate here as well the patch.
from homebrew-ffmpeg.
Okay. Then please test if this version works (I am afraid, I cannot do it myself before next week):
brew tap avpres/formulae/ffmpeg brew install avpres/formulae/ffmpeg --with-srt --with-decklink
If it works, I will integrate here as well the patch.
I got this:
Error: Invalid tap name 'avpres/formulae/ffmpeg'
from homebrew-ffmpeg.
Oops, my fault:
tap avpres/formulae
from homebrew-ffmpeg.
Oops, my fault:
tap avpres/formulae
The result:
huangxiao@MacBook_M1 ~ % brew install avpres/formulae/ffmpeg --with-srt --with-decklink
==> Downloading https://ffmpeg.org/releases/ffmpeg-4.4.1.tar.xz
Already downloaded: /Users/huangxiao/Library/Caches/Homebrew/downloads/773e1876937ced8b367a77129340b5016c93a697e66b232d7cc02f40950a9c4b--ffmpeg-4.4.1.tar.xz
==> Installing ffmpeg from avpres/formulae
==> Installing FFmpeg with options...
Error: An exception occurred within a child process:
ArgumentError: wrong number of arguments (given 1, expected 0)
from homebrew-ffmpeg.
Then I fear I cannot help you… I know that the patch worked for other people, but I cannot remember if that’s related only to the DV format. Sorry, I cannot delve into DeckLink SDK issues now.
from homebrew-ffmpeg.
Thank you anyway. You're so kind.
from homebrew-ffmpeg.
So this is just a new dumb error related to the compiler std libs, it #includes <version>
somewhere, which finds VERSION in the root of the package, and then you're screwed. If you remove the VERSION file from the ffmpeg package it compiles. This has broken alot of software, go apple!
I don't remember enough homebrew to submit a patch renaming VERSION to VERSION.txt, but if someone does that it will fix it.
from homebrew-ffmpeg.
Thank you, @jim-lake, for the information!
from homebrew-ffmpeg.
If you remove the VERSION file from the ffmpeg package it compiles.
@jim-lake When I remove that file, the checksum doesn't match anymore and the script stops with an error...
from homebrew-ffmpeg.
Should be resolved in #100
from homebrew-ffmpeg.
Related Issues (20)
- add libzbvi to the default options in Homebrew formula from your repo HOT 9
- Please enable the ffplay building option, as the official brew formula does HOT 4
- Possible formula fixes/changes HOT 2
- Can't upgrade to 5.1 HOT 10
- Unknown decoder 'libx265' HOT 1
- FFmpeg 6.0 HOT 4
- Additional codecs don't seem to be included with installation HOT 1
- "unpaper" won't run without ffmpeg 5.x HOT 9
- Can you support installing older version of ffmpeg (e.g. ffmpeg@4) with the option --with-fdk-aac ? HOT 1
- Add `libplacebo` as a supported (optional) library HOT 11
- Install with a different name HOT 7
- Apple Silicon support in homebrew HOT 4
- Patch failure for libavcodec when re-installing ffmpeg HEAD HOT 7
- libavdevice build error (Mac M1 Silicon) HOT 24
- libvidstab error, failed on the 2nd pass, "Cannot parse localmotion" HOT 3
- Test optional installations in CI pipeline
- Error installing with`VkVideoDecodeAV1SessionParametersCreateInfoMESA` HOT 10
- ERROR: libflite not found HOT 32
- tap comparison HOT 1
- Brewing custom ffmpeg but failure at metal execution HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from homebrew-ffmpeg.