Coder Social home page Coder Social logo

Support FFMPEG 7 about zoneminder HOT 14 OPEN

VVD avatar VVD commented on June 2, 2024
Support FFMPEG 7

from zoneminder.

Comments (14)

VVD avatar VVD commented on June 2, 2024

This can help to update: https://code.videolan.org/videolan/vlc/-/merge_requests/5304/diffs
Maybe replace mAudioStream->codecpar->channels with mAudioStream->codecpar->ch_layout.nb_channels.

from zoneminder.

connortechnology avatar connortechnology commented on June 2, 2024

If you want to stay on 1.36, then please follow the release-1.36 branch which I believe (could be wrong) has this work done.

Otherwise, please follow current development release which again has this work done.

from zoneminder.

VVD avatar VVD commented on June 2, 2024

If you want to stay on 1.36, then please follow the release-1.36 branch which I believe (could be wrong) has this work done.

https://ffmpeg.org/index.html#news

April 5th, 2024, FFmpeg 7.0 "Dijkstra"

Last commit to branch https://github.com/ZoneMinder/zoneminder/commits/release-1.36/ was on Jan 16, 2024.
I doubt that all this has already been fixed there.

Otherwise, please follow current development release which again has this work done.

I'm working on update ffmpeg to 7.0 in FreeBSD ports: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278705
New release of the ZoneMinder or set of patches is enough for us.
These commits: d7682ba 60285ba 219af38 ?

from zoneminder.

VVD avatar VVD commented on June 2, 2024

BTW, any plans for next release?

from zoneminder.

VVD avatar VVD commented on June 2, 2024
/wrkdirs/usr/ports/multimedia/zoneminder/work/zoneminder-1.36.33/src/zm_mpeg.cpp:632:38: error: no member named 'frame_number' in 'AVCodecContext'; did you mean 'frame_num'?
  632 |                 opicture_ptr->pts = codec_context->frame_number;
      |                                                    ^~~~~~~~~~~~
      |                                                    frame_num
/usr/local/include/libavcodec/avcodec.h:2030:13: note: 'frame_num' declared here
 2030 |     int64_t frame_num;
      |             ^
2 warnings and 1 error generated.
*

https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/6b6f7db81932f94876ff4bcfd2da0582b8ab897e
https://git.ffmpeg.org/gitweb/ffmpeg.git/commitdiff/2717dcfb8527dd65a9fb0e7f8cb00d118af65b68

This patch fixed the issue:

--- src/zm_mpeg.cpp.orig        2023-02-23 21:44:01 UTC
+++ src/zm_mpeg.cpp
@@ -629,7 +629,11 @@ double VideoStream::ActuallyEncodeFrame( const uint8_t
     pkt->size = buffer_size;
     got_packet = 1;
        } else {
+#if LIBAVCODEC_VERSION_CHECK(61, 64, 0, 3, 100)
+               opicture_ptr->pts = codec_context->frame_num;
+#else
                opicture_ptr->pts = codec_context->frame_number;
+#endif
                opicture_ptr->quality = codec_context->global_quality;

 #if LIBAVCODEC_VERSION_CHECK(57, 64, 0, 64, 0)

But I don't know correct values for LIBAVCODEC_VERSION_CHECK(61, 64, 0, 3, 100).

from zoneminder.

VVD avatar VVD commented on June 2, 2024

If you want to stay on 1.36, then please follow the release-1.36 branch which I believe (could be wrong) has this work done.

Otherwise, please follow current development release which again has this work done.

Both doesn't build.
release-1.36 have a lot of different uses of removed from 7.0 deprecations.
Current development need this patch:

--- src/zm_mpeg.cpp.orig        2023-02-23 21:44:01 UTC
+++ src/zm_mpeg.cpp
@@ -463,7 +463,11 @@ double VideoStream::ActuallyEncodeFrame( const uint8_t
     pkt->data = (uint8_t *)opicture_ptr;
     pkt->size = buffer_size;
   } else {
+#if LIBAVCODEC_VERSION_CHECK(61, 64, 0, 3, 100)
+    opicture_ptr->pts = codec_context->frame_num;
+#else
     opicture_ptr->pts = codec_context->frame_number;
+#endif
     opicture_ptr->quality = codec_context->global_quality;

     avcodec_send_frame(codec_context, opicture_ptr);

Offtopic question: added new build dependency from pkg-config and lib dependency from libcurl?

from zoneminder.

connortechnology avatar connortechnology commented on June 2, 2024

I have updated both master and release-1.36 with further ffmpeg7 deprecation handling.

from zoneminder.

connortechnology avatar connortechnology commented on June 2, 2024

Hey I switched to using quick_exit instead() of exit(). this breaks on openbsd for me. Just wondering if it has broken freebsd as well. Does ZM still c ompile for you?

from zoneminder.

VVD avatar VVD commented on June 2, 2024

Do u say about this commit: 0048a6b?
I have only one host in production with zoneminder - can't test run development versions.
I can test build only.

from zoneminder.

connortechnology avatar connortechnology commented on June 2, 2024

Yes that's the one. quick_exit is not implemented in openbsd. I'm testing a workaround of using abort() instead. Just wondering if quick_exit exists in freebsd.

from zoneminder.

VVD avatar VVD commented on June 2, 2024

Look like it work fine:

$ cat e.cpp
#include <cstdlib>
#include <iostream>

int main()
{
  std::cout << "Hello world!\n";
  std::quick_exit(1);
}
$ clang e.cpp -o e -lc++
$ ./e
Hello world!
$ echo $?
1

from zoneminder.

connortechnology avatar connortechnology commented on June 2, 2024

Good to know, thanks for testing!

FYI on openBSD we get:

clang e.cpp -o e -lc++

e.cpp:7:8: error: reference to unresolved using declaration
std::quick_exit(1);
^
/usr/include/c++/v1/cstdlib:145:1: note: using declaration annotated with 'using_if_exists' here
using ::quick_exit _LIBCPP_USING_IF_EXISTS;
^
e.cpp:7:3: warning: expression result unused [-Wunused-value]
std::quick_exit(1);
^ ~
1 warning and 1 error generated.

from zoneminder.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.