[Cin] Upd: small fix for qt vs mov format option

Andrew Randrianasulu randrianasulu at gmail.com
Tue Nov 17 02:23:38 CET 2020


Ah, there were additional 'formats' in the need of same fixup ....

Patch is unclean (it includes some of my interlace detection work), but it will give you correct idea how to fix those non-working cases)

diff --git a/cinelerra-5.1/cinelerra/fileffmpeg.C b/cinelerra-5.1/cinelerra/fileffmpeg.C
index ff206b10..eed14f20 100644
--- 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);
-
+       
        if( rd ) {
                result = ff->init_decoder(asset->path);
                if( !result ) result = ff->open_decoder();
@@ -342,6 +342,11 @@ int FileFFMPEG::open_file(int rd, int wr)
                        int video_layers = ff->ff_total_video_layers();
                        if( video_layers > 0 ) {
                                asset->video_data = 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);
@@ -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"))
+               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
        avformat_free_context(fmt_ctx);  fmt_ctx = 0;
        int ret = avformat_alloc_output_context2(&fmt_ctx, 0, format_name, 0);
        if( ret || !fmt_ctx ) {

Not sure why it was not fixed before me ....

Possibility of changing muxer options was added in

https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=commit;h=86c9537e0540010ff43b16feb4cd7de98409eba1
Fri, 28 Feb 2020 18:34:55 +0300

see fileffmpeg.C changes

https://git.cinelerra-gg.org/git/?p=goodguy/cinelerra.git;a=blobdiff;f=cinelerra-5.1/cinelerra/fileffmpeg.C;h=0db64205be373bff1a33959de608a51b5da4438c;hp=564306e656e82fce65b89cbe7555cde7bc72f902;hb=86c9537e0540010ff43b16feb4cd7de98409eba1;hpb=ae9b00c3f960e5bd9f74a9d9103e332f4c288ab4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FILEFFMPEG_muxer_formats_fixup.patch
Type: text/x-diff
Size: 1710 bytes
Desc: not available
URL: <https://lists.cinelerra-gg.org/pipermail/cin/attachments/20201117/9461f5a4/attachment.bin>


More information about the Cin mailing list