So, I grep'ed ffmpeg-4.3 sources and apparently thise falgs consumed by few encoders outside of mpeg2/4: guest@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@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@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 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.
Andrew, I am still testing the interlace_aspect_autodetect-11.patch (or 12, now I can not remember). I got 1 crash but I can not reproduce it yet so maybe it was there before the patch anyway. Do not waste time looking at the patch until I can confirm or deny. Thanks, Phyllis ********************************************************************** Thread 622 "ci" received signal SIGSEGV, Segmentation fault. [Switching to Thread 0x7ffd71fc3700 (LWP 25673)] 0x0000000000b116c3 in FFMPEG::ff_video_mpeg_color_range (this=0x7ffe90006340, stream=1) at ffmpeg.C:3612 3612 return ffvideo[stream]->st->codecpar->color_range == AVCOL_RANGE_MPEG ? 1 : 0; Missing separate debuginfos, use: dnf debuginfo-install OpenEXR-libs-2.3.0-5.fc32.x86_64 alsa-lib-1.2.3.2-1.fc32.x86_64 bzip2-libs-1.0.8-2.fc32.x86_64 dbus-libs-1.12.20-1.fc32.x86_64 elfutils-libelf-0.181-1.fc32.x86_64 expat-2.2.8-2.fc32.x86_64 flac-libs-1.3.3-2.fc32.x86_64 fontconfig-2.13.92-9.fc32.x86_64 freetype-2.10.2-1.fc32.x86_64 gsm-1.0.18-6.fc32.x86_64 ilmbase-2.3.0-4.fc32.x86_64 jbigkit-libs-2.1-18.fc32.x86_64 libICE-1.0.10-3.fc32.x86_64 libSM-1.2.3-5.fc32.x86_64 libX11-1.6.12-1.fc32.x86_64 libX11-xcb-1.6.12-1.fc32.x86_64 libXau-1.0.9-3.fc32.x86_64 libXcursor-1.2.0-2.fc32.x86_64 libXdamage-1.1.5-2.fc32.x86_64 libXext-1.3.4-3.fc32.x86_64 libXfixes-5.0.3-11.fc32.x86_64 libXft-2.3.3-3.fc32.x86_64 libXi-1.7.10-3.fc32.x86_64 libXinerama-1.1.4-5.fc32.x86_64 libXrender-0.9.10-11.fc32.x86_64 libXtst-1.2.3-11.fc32.x86_64 libXv-1.0.11-11.fc32.x86_64 libXxf86vm-1.1.4-13.fc32.x86_64 libasyncns-0.8-18.fc32.x86_64 libdrm-2.4.102-1.fc32.x86_64 libedit-3.1-32.20191231cvs.fc32.x86_64 libffi-3.1-24.fc32.x86_64 libgcc-10.2.1-1.fc32.x86_64 libgcrypt-1.8.5-3.fc32.x86_64 libglvnd-1.3.2-1.fc32.x86_64 libglvnd-glx-1.3.2-1.fc32.x86_64 libgpg-error-1.36-3.fc32.x86_64 libpng-1.6.37-3.fc32.x86_64 libsndfile-1.0.28-12.fc32.x86_64 libstdc++-10.2.1-1.fc32.x86_64 libusbx-1.0.23-1.fc32.x86_64 libuuid-2.35.2-1.fc32.x86_64 libvdpau-1.4-2.fc32.x86_64 libxcb-1.13.1-4.fc32.x86_64 llvm-libs-10.0.1-4.fc32.x86_64 lz4-libs-1.9.1-2.fc32.x86_64 mesa-dri-drivers-20.1.9-1.fc32.x86_64 mesa-libGL-20.1.9-1.fc32.x86_64 mesa-libGLU-9.0.1-2.fc32.x86_64 mesa-libglapi-20.1.9-1.fc32.x86_64 numactl-libs-2.0.12-4.fc32.x86_64 pcre2-10.35-7.fc32.x86_64 pulseaudio-libs-13.99.1-4.fc32.x86_64 sssd-client-2.3.1-2.fc32.x86_64 xz-libs-5.2.5-1.fc32.x86_64 (gdb) On Wed, Nov 18, 2020 at 9:49 AM Andrew Randrianasulu via Cin < [email protected]> wrote:
So, I grep'ed ffmpeg-4.3 sources and apparently thise falgs consumed by few encoders outside of mpeg2/4:
guest@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@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@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
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 [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
Andrew, I could not reproduce the crash I got the other day so have finally *checked into GIT interlace_aspect_autodetect-12.patch *(from the ru download site). I tested and saw the correct interlace mode in the Resources window media folder "info" and under Settings->Format. Also looked at the code but I do not know much about C++. But the one thing that I for sure do not comprehend in the patch is the section in fileffmpeg.C about the Fixups (maybe this was explained in a different email though): 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")) + format_name = replace_name0; // fixup + if (!strcmp(format_name, "m2ts")) + format_name = replace_name1; // fixup + if (!strcmp(format_name, "mkv")) + format_name = replace_name2; // fixup And in mwindow.C, why is it needed to specifically add the following?: + float ar = asset->aspect_ratio; + if (ar) { + //printf ("Aspect ratio from asset: %f \n", ar); + if( EQUIV(ar, 1.3333) ) { session->aspect_w = 4; session->aspect_h = 3; } + if( EQUIV(ar, 1.7777) ) { session->aspect_w = 16; session->aspect_h = 9; } + if( EQUIV(ar, 2.1111) ) { session->aspect_w = 19; session->aspect_h = 9; } + if( EQUIV(ar, 2.2222) ) { session->aspect_w = 20; session->aspect_h = 9; } + if( EQUIV(ar, 2.3333) ) { session->aspect_w = 21; session->aspect_h = 9; } + if( EQUIV(ar, 2.370370) ) { session->aspect_w = 64; session->aspect_h = 27; }
В сообщении от Wednesday 02 December 2020 02:27:43 Phyllis Smith via Cin написал(а):
Andrew, I could not reproduce the crash I got the other day so have finally *checked into GIT interlace_aspect_autodetect-12.patch *(from the ru download site). I tested and saw the correct interlace mode in the Resources window media folder "info" and under Settings->Format. Also looked at the code but I do not know much about C++. But the one thing that I for sure do not comprehend in the patch is the section in fileffmpeg.C about the Fixups (maybe this was explained in a different email though):
Well, if you try to bring up 'format options' for say mkv or qt format CinGG will complain without this patch Just names used for format (container) not always match what libavcodec/libavformat use ... This code tries to fix up difference, so you can set some of container options via GUI now.
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")) + format_name = replace_name0; // fixup + if (!strcmp(format_name, "m2ts")) + format_name = replace_name1; // fixup + if (!strcmp(format_name, "mkv")) + format_name = replace_name2; // fixup
And in mwindow.C, why is it needed to specifically add the following?:
well, in theory this must be function, not code duplication .. this just sets session (display) aspect ratio (so if you bring up 'mainwindow menu->Format' you will see correcty-picked up values, not default 4:3) I'm a bit confused between session vs asset, because encoding for example seems to use asset's parameters (or may be they just stored there).
+ float ar = asset->aspect_ratio; + if (ar) { + //printf ("Aspect ratio from asset: %f \n", ar); + if( EQUIV(ar, 1.3333) ) { session->aspect_w = 4; session->aspect_h = 3; } + if( EQUIV(ar, 1.7777) ) { session->aspect_w = 16; session->aspect_h = 9; } + if( EQUIV(ar, 2.1111) ) { session->aspect_w = 19; session->aspect_h = 9; } + if( EQUIV(ar, 2.2222) ) { session->aspect_w = 20; session->aspect_h = 9; } + if( EQUIV(ar, 2.3333) ) { session->aspect_w = 21; session->aspect_h = 9; } + if( EQUIV(ar, 2.370370) ) { session->aspect_w = 64; session->aspect_h = 27; }
With the last git I can no longer see the png. Both in resources and timeline are not seen. In the terminal I have the following messages: Cinelerra Infinity - built: Dec 2 2020 10:36:34 git://git.cinelerra-gg.org/goodguy/cinelerra.git (c) 2006-2019 Heroine Virtual Ltd. by Adam Williams 2007-2020 mods for Cinelerra-GG by W.P.Morrow aka goodguy Cinelerra is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. There is absolutely no warranty for Cinelerra. sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 interlace from demux: 0 sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 interlace from demux: 0 sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 FFMPEG::open_decoder: some stream have bad times: /home/paz/video_editing/prova/1080/0003.png ff_aspect_ratio, 0.000000 interlace from demux: 0 FFMPEG::open_decoder: some stream have bad times: /home/paz/video_editing/prova/1080/0004.png ff_aspect_ratio, 0.000000 interlace from demux: 0 sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 interlace from demux: 0 sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 The error "some stream have bad times:" always gave it to me, but the pngs saw the same. EDIT: the same problem with jpg. An animated gif works.
В сообщении от Wednesday 02 December 2020 13:02:56 Andrea paz via Cin написал(а):
With the last git I can no longer see the png. Both in resources and timeline are not seen. In the terminal I have the following messages:
Cinelerra Infinity - built: Dec 2 2020 10:36:34 git://git.cinelerra-gg.org/goodguy/cinelerra.git (c) 2006-2019 Heroine Virtual Ltd. by Adam Williams 2007-2020 mods for Cinelerra-GG by W.P.Morrow aka goodguy Cinelerra is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. There is absolutely no warranty for Cinelerra.
sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 interlace from demux: 0 sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 interlace from demux: 0 sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 FFMPEG::open_decoder: some stream have bad times: /home/paz/video_editing/prova/1080/0003.png ff_aspect_ratio, 0.000000 interlace from demux: 0 FFMPEG::open_decoder: some stream have bad times: /home/paz/video_editing/prova/1080/0004.png ff_aspect_ratio, 0.000000 interlace from demux: 0 sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 interlace from demux: 0 sample_aspect_ratio, 1.000000 display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778
The error "some stream have bad times:" always gave it to me, but the pngs saw the same.
EDIT: the same problem with jpg. An animated gif works.
Yeah, for some reason it doesn't work with images-as-decoded-via-ffmpeg Try attached patch? diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C index eed14f20..387c0f69 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.C +++ b/cinelerra-5.1/cinelerra/fileffmpeg.C @@ -342,11 +342,13 @@ int FileFFMPEG::open_file(int rd, int wr) int video_layers = ff->ff_total_video_layers(); if( video_layers > 0 ) { asset->video_data = 1; + if ((ff->ff_video_codec(0) != "png" || (ff->ff_video_codec(0) != "mjpeg")) && (ff->ff_video_frames(0) > 1 )) { asset->aspect_ratio = ff->ff_aspect_ratio(0); printf("ff_aspect_ratio, %f \n", asset->aspect_ratio); if (!asset->interlace_mode) asset->interlace_mode = ff->ff_interlace(0); ff->video_probe(1); if (!asset->interlace_mode && (ff->interlace_from_codec) ) asset->interlace_mode = ff->video_probe(1); + } if( !asset->layers ) asset->layers = video_layers; asset->actual_width = ff->ff_video_width(0); asset->actual_height = ff->ff_video_height(0); I dunno how it should react to, say, interlaced png wrapped in mov .... Hopefully just skip ar/interlace setup, as it did before. (but at least you will have image visible)
On Wed, 2 Dec 2020, Andrew Randrianasulu via Cin wrote:
With the last git I can no longer see the png. Both in resources and timeline are not seen. In the terminal I have the following messages:
Must PNG work under ffmpeg at all? I think, I have seen somewhere in CGG manual that ffmpeg did not work with picture files (picture series?), so I loaded them always switching to 'try ffmpeg last' not testing the opposite. _______________________________________________________________________________ Georgy Salnikov NMR Group Novosibirsk Institute of Organic Chemistry Lavrentjeva, 9, 630090 Novosibirsk, Russia Phone +7-383-3307864 Email [email protected] _______________________________________________________________________________
В сообщении от Wednesday 02 December 2020 16:47:05 Georgy Salnikov via Cin написал(а):
On Wed, 2 Dec 2020, Andrew Randrianasulu via Cin wrote:
With the last git I can no longer see the png. Both in resources and timeline are not seen. In the terminal I have the following messages:
Must PNG work under ffmpeg at all? I think, I have seen somewhere in CGG manual that ffmpeg did not work with picture files (picture series?), so I loaded them always switching to 'try ffmpeg last' not testing the opposite.
I think it still works with single images, because my fiddling with fileffmpeg.C changes result (works/not) .... I narrowed failure to my probe function, it doesn't like single images, so I if'ed them away (and not png/mjpeg codecs *plus* ff_video_frames >1 conditional as in my prev. patch) New patch attached === diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C index eed14f20..43ed758b 100644 --- a/cinelerra-5.1/cinelerra/fileffmpeg.C +++ b/cinelerra-5.1/cinelerra/fileffmpeg.C @@ -345,8 +345,10 @@ int FileFFMPEG::open_file(int rd, int wr) asset->aspect_ratio = ff->ff_aspect_ratio(0); printf("ff_aspect_ratio, %f \n", asset->aspect_ratio); if (!asset->interlace_mode) asset->interlace_mode = ff->ff_interlace(0); + if ( ff->ff_video_frames(0) > 1 ) { ff->video_probe(1); if (!asset->interlace_mode && (ff->interlace_from_codec) ) asset->interlace_mode = ff->video_probe(1); + } if( !asset->layers ) asset->layers = video_layers; asset->actual_width = ff->ff_video_width(0); asset->actual_height = ff->ff_video_height(0); ==== But yes, loading jpegs/pngs with 'try ffmpeg last' also workaround my bug .... This hopefully still gives interlace/aspect autodetection (tested with m2t file), yet images should work as before ... Sorry!
_______________________________________________________________________________
Georgy Salnikov NMR Group Novosibirsk Institute of Organic Chemistry Lavrentjeva, 9, 630090 Novosibirsk, Russia Phone +7-383-3307864 Email [email protected] _______________________________________________________________________________
Andrew, This final fix patch was just now checked into GIT. I don't know how many other single frames there might be other than png so the "if-ed" for >1 was a good idea. The interlace patch is nice because now you don't have to guess if it is interlaced or how. Andrea, Thanks for testing as I would not have ordinarily loaded a png and seen the problem -- more testing is so helpful. Georgy,
Must PNG work under ffmpeg at all? I think, I have seen somewhere in CGG manual that ffmpeg did not work with picture files (picture series?), so I loaded them always switching to 'try ffmpeg last' not testing the opposite.
I believe you are referring to the section "4.2.2.1 Filelist format" and the specific line "When you load the outfile in CINELERRA-GG, you will need to set 'Try ffmpeg last' since ffmpeg does not work with jpeglist sequence files." It would be too confusing for casual users to have to switch from ffmpeg first to ffmpeg last. Also, I checked into GIT the correction for shortcuts.html for Select Edits (ctrl-alt-' instead of ctrl-alt-a). This was my mistake.
I think it still works with single images, because my fiddling with fileffmpeg.C changes result (works/not) ....
I narrowed failure to my probe function, it doesn't like single images, so I if'ed them away (and not png/mjpeg codecs *plus* ff_video_frames >1 conditional as in my prev. patch)
New patch attached
Andrew, probably eventually these print statements should be removed after the patch has had more use to ensure the aspect ratio and different interlacing of different varieties is known to being reported correctly. Otherwise it is hard to see errors instead. sample_aspect_ratio, 1.000000
display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 interlace from demux: 0
В сообщении от Thursday 03 December 2020 02:24:44 Phyllis Smith via Cin написал(а):
Andrew, probably eventually these print statements should be removed after the patch has had more use to ensure the aspect ratio and different interlacing of different varieties is known to being reported correctly. Otherwise it is hard to see errors instead.
sure, I just left them because I saw some files with real strange (display) aspect ratio... will comment out soon I was trying to understand why some interlaced files still not detected as such, for example this https://samples.ffmpeg.org/archive/video/mjpeg/ https://samples.ffmpeg.org/archive/video/mjpeg/avi%2Bmjpeg%2Bpcm_s16le%2B%2B... mediainfo reports it correctly (I hope) but cinGG still not ..... I was looking into adding same reporting as in https://sourceforge.net/p/mediainfo/feature-requests/484/ https://github.com/MediaArea/MediaInfoLib/commit/33776815ae717bfc2f52042f455... BUT apparently this file doesn't even have this 'vprp' header! On image front I tried to load bmp and tif - they both worked. I initially was fooled by how snapshots appeared correctly in media area, but as I can see now they used native decoder, not ffmpeg's ....
sample_aspect_ratio, 1.000000
display_aspect_ratio, 1.777778 ff_aspect_ratio, 1.777778 interlace from demux: 0
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 < [email protected]> wrote:
So, I grep'ed ffmpeg-4.3 sources and apparently thise falgs consumed by few encoders outside of mpeg2/4:
guest@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@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@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
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 [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
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 <[email protected] <mailto:[email protected]>> wrote:
So, I grep'ed ffmpeg-4.3 sources and apparently thise falgs consumed by few encoders outside of mpeg2/4:
guest@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@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@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 [email protected] <mailto:[email protected]> https://lists.cinelerra-gg.org/mailman/listinfo/cin <https://lists.cinelerra-gg.org/mailman/listinfo/cin>
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 < [email protected]> 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 <[email protected] <mailto:[email protected]>> wrote:
So, I grep'ed ffmpeg-4.3 sources and apparently thise falgs consumed by few encoders outside of mpeg2/4:
guest@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@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@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 [email protected] <mailto:[email protected]> https://lists.cinelerra-gg.org/mailman/listinfo/cin <https://lists.cinelerra-gg.org/mailman/listinfo/cin>
-- Cin mailing list [email protected] https://lists.cinelerra-gg.org/mailman/listinfo/cin
participants (5)
-
Andrea paz -
Andrew Randrianasulu -
Georgy Salnikov -
Phyllis Smith -
Reuss András