[Cin] Interlace driving me mad .....

Phyllis Smith phylsmith2017 at gmail.com
Sun Feb 21 17:04:19 CET 2021


Andras,
Thank you!  I am trying to learn C++ by looking at the code but mostly all
I can do is copy other working parts that were patches.

On Sun, Feb 21, 2021 at 7:43 AM Reuss András via Cin <
cin at lists.cinelerra-gg.org> wrote:

> Hi, Phyllis,
> Not a real problem, here is a patch.
>
> br
> andras
>
> On 2021. 02. 20. 1:22, Phyllis Smith via Cin wrote:
> > Andrew,
> > I just noticed these error messages today and was hoping for a
> > solution as the interlace mods may not be working as you expected.
> > Specifically in the interlace_aspect_autodetect-12 patch that was
> > checked into GIT on January 18 the compiler is giving the errors:
> >
> > fileffmpeg.C: In member function ‘virtual int
> > FFOptionsFormatView::handle_event()’:
> > fileffmpeg.C:1947:24: warning: ISO C++ forbids converting a string
> > constant to ‘char*’ [-Wwrite-strings]
> >   1947 |  char *replace_name0 = "mov";
> >        |                        ^~~~~
> > fileffmpeg.C:1948:24: warning: ISO C++ forbids converting a string
> > constant to ‘char*’ [-Wwrite-strings]
> >   1948 |  char *replace_name1 = "mpegts";
> >        |                        ^~~~~~~~
> > fileffmpeg.C:1949:24: warning: ISO C++ forbids converting a string
> > constant to ‘char*’ [-Wwrite-strings]
> >   1949 |  char *replace_name2 = "matroska";
> >
> > _The patch code was:_
> > --- a/cinelerra-5.1/cinelerra/fileffmpeg.C
> > +++ b/cinelerra-5.1/cinelerra/fileffmpeg.C
> > @@ -326,7 +326,7 @@ int FileFFMPEG::open_file(int rd, int wr)
> >          int result = 0;
> >          if( ff ) return 1;
> >          ff = new FFMPEG(this);
> > ...
> > @@ -1938,6 +1943,15 @@ int FFOptionsFormatView::handle_event()
> >   {
> >          Asset *asset = fmt_config->asset;
> >          char *format_name = asset->fformat;
> > *+       char *replace_name0 = "mov";
> > +       char *replace_name1 = "mpegts";
> > +       char *replace_name2 = "matroska";*
> > +       if (!strcmp(format_name, "qt"))
> >
> > On Wed, Nov 18, 2020 at 9:49 AM Andrew Randrianasulu via Cin
> > <cin at lists.cinelerra-gg.org <mailto:cin at lists.cinelerra-gg.org>> wrote:
> >
> >     So, I grep'ed ffmpeg-4.3 sources and apparently thise falgs
> >     consumed by few encoders outside of mpeg2/4:
> >
> >     guest at slax:/dev/shm/cinelerra/cinelerra-5.1/cinelerra$ grep
> >     'AV_CODEC_FLAG_INTERLACED_DCT' ../thirdparty/ffmpeg-4.3/libav
> >     libavcodec/    libavdevice/   libavfilter/   libavformat/
> >       libavresample/ libavutil/
> >     guest at slax:/dev/shm/cinelerra/cinelerra-5.1/cinelerra$ grep
> >     'AV_CODEC_FLAG_INTERLACED_DCT'
> >     ../thirdparty/ffmpeg-4.3/libavcodec/*.c
> >     ../thirdparty/ffmpeg-4.3/libavcodec/cuviddec.c:
> >     avctx->flags |= AV_CODEC_FLAG_INTERLACED_DCT;
> >     ../thirdparty/ffmpeg-4.3/libavcodec/cuviddec.c:
> >     avctx->flags &= ~AV_CODEC_FLAG_INTERLACED_DCT;
> >     ../thirdparty/ffmpeg-4.3/libavcodec/dnxhddata.c:
> >     interlaced == !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) &&
> >     ../thirdparty/ffmpeg-4.3/libavcodec/dnxhdenc.c:    if
> >     (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/dvenc.c:    if
> >     (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/libx264.c:
> >     x4->params.b_interlaced   = avctx->flags &
> >     AV_CODEC_FLAG_INTERLACED_DCT;
> >     ../thirdparty/ffmpeg-4.3/libavcodec/libxavs.c:
> >     x4->params.b_interlaced   = avctx->flags &
> >     AV_CODEC_FLAG_INTERLACED_DCT;
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo_enc.c:    if
> >     ((s->avctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT |
> >     AV_CODEC_FLAG_INTERLACED_ME)) &&
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo_enc.c:
> >     s->progressive_sequence = !(avctx->flags &
> >     (AV_CODEC_FLAG_INTERLACED_DCT |
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo_enc.c:        if
> >     (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo_enc.c:        if
> >     (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/nvenc.c:    if (ret < 1 &&
> >     avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/nvenc.c:    if (avctx->flags
> >     & AV_CODEC_FLAG_INTERLACED_DCT) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/nvenc.c:        if
> >     (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/pngenc.c:
> >     s->is_progressive = !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT);
> >     ../thirdparty/ffmpeg-4.3/libavcodec/proresenc_anatoliy.c:
> >     ctx->is_interlaced = !!(avctx->flags &
> >     AV_CODEC_FLAG_INTERLACED_DCT);
> >     ../thirdparty/ffmpeg-4.3/libavcodec/proresenc_kostya.c:    if
> >     (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT)
> >     ../thirdparty/ffmpeg-4.3/libavcodec/proresenc_kostya.c:    int
> >     interlaced = !!(avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT);
> >     ../thirdparty/ffmpeg-4.3/libavcodec/qsvenc.c:    if
> >     (avctx->flags & AV_CODEC_FLAG_INTERLACED_DCT) {
> >     guest at slax:/dev/shm/cinelerra/cinelerra-5.1/cinelerra$ grep
> >     'AV_CODEC_FLAG_INTERLACED_ME'
> >     ../thirdparty/ffmpeg-4.3/libavcodec/*.c
> >     ../thirdparty/ffmpeg-4.3/libavcodec/huffyuvenc.c:
> >     s->interlaced = avctx->flags & AV_CODEC_FLAG_INTERLACED_ME ? 1 : 0;
> >     ../thirdparty/ffmpeg-4.3/libavcodec/motion_est.c:        if
> >     ((s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)
> >     ../thirdparty/ffmpeg-4.3/libavcodec/motion_est.c:        if
> >     ((s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)
> >     ../thirdparty/ffmpeg-4.3/libavcodec/motion_est.c:    if
> >     (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo.c:
> >     (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME)) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo_enc.c:    if
> >     ((s->avctx->flags & (AV_CODEC_FLAG_INTERLACED_DCT |
> >     AV_CODEC_FLAG_INTERLACED_ME)) &&
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo_enc.c:
> >                                          AV_CODEC_FLAG_INTERLACED_ME) ||
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo_enc.c:
> >     if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo_enc.c:
> >     if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
> >     ../thirdparty/ffmpeg-4.3/libavcodec/mpegvideo_enc.c:
> >     if (s->avctx->flags & AV_CODEC_FLAG_INTERLACED_ME) {
> >
> >
> >     So, reworked this section again ... basically only excluding
> >     mjpeg codec case from setting those flags, instead of
> >     whilelisting mpeg2/4 only
> >
> >     Strangely ffv1/avi shows interlace (with my patch) if source was
> >     Top Field First and not showing it if source was Bottom Field
> >     First ..:/
> >
> >     dv file re-encoded as dv_ntsc.avi shows bff correctly, it seems.
> >     mp4 container with h264 also gets it right now ....
> >     mpeg2 works (but not sure if field order correct or now ..I'm
> >     confused by ffmpeg source :/)
> >     mkv seems to work (but it was working before)
> >
> >     https://cloud.mail.ru/public/5AM1/275yC576u
> >     <https://cloud.mail.ru/public/5AM1/275yC576u>
> >
> >     How to test those 'tb/bb/tt/bt' cases? There must be some
> >     artificial picture clearly showing if I did it wrong ..Not found
> >     it yet.
> >
> >
> >
> >
> >     --
> >     Cin mailing list
> >     Cin at lists.cinelerra-gg.org <mailto:Cin at lists.cinelerra-gg.org>
> >     https://lists.cinelerra-gg.org/mailman/listinfo/cin
> >     <https://lists.cinelerra-gg.org/mailman/listinfo/cin>
> >
> >
>
> --
> Cin mailing list
> Cin at lists.cinelerra-gg.org
> https://lists.cinelerra-gg.org/mailman/listinfo/cin
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20210221/b3b81a74/attachment-0001.htm>


More information about the Cin mailing list