Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Source code installation failure: AVPacket struct member error #31

Open
qinziqiao opened this issue Jul 3, 2023 · 4 comments
Open

Source code installation failure: AVPacket struct member error #31

qinziqiao opened this issue Jul 3, 2023 · 4 comments

Comments

@qinziqiao
Copy link

qinziqiao commented Jul 3, 2023

Seek help. I have installed opencv and ffmpeg source code, but encountered the following problems when run "python -m pip install .":

src/mvextractor/video_cap.cpp:218:41: error: ‘AVPacket’ {aka ‘struct AVPacket’} has no member named ‘synced’
if (this->is_rtsp && packet.synced) {
^~~~~~
src/mvextractor/video_cap.cpp:222:32: error: ‘AVPacket’ {aka ‘struct AVPacket’} has no member named ‘last_rtcp_ntp_time’
ntp2tv(&packet.last_rtcp_ntp_time, &tv);
^~~~~~~~~~~~~~~~~~
src/mvextractor/video_cap.cpp:223:51: error: ‘AVPacket’ {aka ‘struct AVPacket’} has no member named ‘timestamp’
double rtp_diff = (double)(packet.timestamp - packet.last_rtcp_timestamp) / 90000.0;
^~~~~~~~~
src/mvextractor/video_cap.cpp:223:70: error: ‘AVPacket’ {aka ‘struct AVPacket’} has no member named ‘last_rtcp_timestamp’
double rtp_diff = (double)(packet.timestamp - packet.last_rtcp_timestamp) / 90000.0;

I check the AVPacket struct of the "ffmpeg_build/include/libavcodec/avcodec.h" file, and found they really don't exist either in the new version (ffmpeg 5.0, ffmpeg 4.1) or the old version ( ffmpeg 3.4).

@xizaoqu
Copy link

xizaoqu commented Oct 24, 2023

Same question, have you figured it out?

@xizaoqu
Copy link

xizaoqu commented Oct 24, 2023

Seek help. I have installed opencv and ffmpeg source code, but encountered the following problems when run "python -m pip install .":

src/mvextractor/video_cap.cpp:218:41: error: ‘AVPacket’ {aka ‘struct AVPacket’} has no member named ‘synced’
if (this->is_rtsp && packet.synced) {
^~~~~~
src/mvextractor/video_cap.cpp:222:32: error: ‘AVPacket’ {aka ‘struct AVPacket’} has no member named ‘last_rtcp_ntp_time’
ntp2tv(&packet.last_rtcp_ntp_time, &tv);
^~~~~~~~~~~~~~~~~~
src/mvextractor/video_cap.cpp:223:51: error: ‘AVPacket’ {aka ‘struct AVPacket’} has no member named ‘timestamp’
double rtp_diff = (double)(packet.timestamp - packet.last_rtcp_timestamp) / 90000.0;
^~~~~~~~~
src/mvextractor/video_cap.cpp:223:70: error: ‘AVPacket’ {aka ‘struct AVPacket’} has no member named ‘last_rtcp_timestamp’
double rtp_diff = (double)(packet.timestamp - packet.last_rtcp_timestamp) / 90000.0;

I check the AVPacket struct of the "ffmpeg_build/include/libavcodec/avcodec.h" file, and found they really don't exist either in the new version (ffmpeg 5.0, ffmpeg 4.1) or the old version ( ffmpeg 3.4).

Actually, this repo provides the patch in ffmpeg_patch

@vedantroy
Copy link

I used the custom FFMPEG installer script, but that doesn't seem to install libav-format. I can install libav-format using Ubuntu's package manager, but I think that installs the unpatched version.

@choasma
Copy link

choasma commented Aug 9, 2024

That's the great point @xizaoqu. Had the same issue, and execute the patch script here solved the problem, actually it just copy the patched three files into the installed path. Probably README file should update about this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants