Capturing output file of ffmpeg with vid.stab in python into a variableHow do I check whether a file exists without exceptions?Calling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonWhat is the difference between Python's list methods append and extend?How can I safely create a nested directory?Does Python have a ternary conditional operator?Using global variables in a functionHow do I list all files of a directory?Does Python have a string 'contains' substring method?

What is a simple, physical situation where complex numbers emerge naturally?

How is it possible for this NPC to be alive during the Curse of Strahd adventure?

How can a single Member of the House block a Congressional bill?

What does War Machine's "Canopy! Canopy!" line mean in "Avengers: Endgame"?

Why is Colorado so different politically from nearby states?

Does any lore text explain why the planes of Acheron, Gehenna, and Carceri are the alignment they are?

Do I add my ability modifier to the damage of the bonus-action attack granted by the Crossbow Expert feat?

Creating Fictional Slavic Place Names

Why does MS SQL allow you to create an illegal column?

Can an old DSLR be upgraded to match modern smartphone image quality

How can I grammatically understand "Wir über uns"?

How to detach yourself from a character you're going to kill?

Get value of the passed argument to script importing variables from another script

Accidentally cashed a check twice

Is having a hidden directory under /etc safe?

What is the best option to connect old computer to modern TV

How to provide realism without making readers think grimdark

Is there a practical difference between different types of Berachos?

Unorthodox way of solving Einstein field equations

What if you don't bring your credit card or debit for incidentals?

Responsibility for visa checking

Is it possible to kill all life on Earth?

Why were the Night's Watch required to be celibate?

Could a guilty Boris Johnson be used to cancel Brexit?



Capturing output file of ffmpeg with vid.stab in python into a variable


How do I check whether a file exists without exceptions?Calling an external command in PythonWhat are metaclasses in Python?Finding the index of an item given a list containing it in PythonWhat is the difference between Python's list methods append and extend?How can I safely create a nested directory?Does Python have a ternary conditional operator?Using global variables in a functionHow do I list all files of a directory?Does Python have a string 'contains' substring method?






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I'm trying to write a python script to stabilize videos using ffmpeg and the vid.stab library.
My problem is that the output file doesn't seem to go through stdout, so using subprocess.Popen() returns an empty variable.



cmd1=["ffmpeg", "-i","./input.MOV", "-vf", "vidstabdetect=stepsize=6:shakiness=10:accuracy=15", "-f","null","pipe:1"]
p = subprocess.Popen(cmd1, stdout=subprocess.PIPE)
vectors, err = p.communicate()


The issues is that vibstabdetect takes a filter called result, and outputs a file to whatever's specified there, and stdout remains empty. (If there's no result specified it defaults to transforms.trf.)



Is there a way to get the contents of the result file?
When running the script with the code above it executes without error, but the file is created with the default name and the variable remains empty.










share|improve this question






















  • can't you just output the data with ffmpeg as an actual file, and read it in with python?

    – user3469811
    Mar 24 at 12:40











  • That's how I'm doing it currently, but I was wondering if there was a way to avoid that.

    – Circo
    Mar 24 at 12:46











  • -f fmt (input/output): Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases. maybe you have to set -f argument, because you do not explicitly produce an output file

    – user3469811
    Mar 24 at 13:04












  • Which OS is this?

    – Gyan
    Mar 24 at 15:20











  • @user3469811 there's already an explicit output - it's pipe:1 in this case. But that output is empty, the generated comes from the result filter. The -f null is used to specify that there's no file extension, as nothing is generated there because stdout is empty.

    – Circo
    Mar 24 at 15:29


















0















I'm trying to write a python script to stabilize videos using ffmpeg and the vid.stab library.
My problem is that the output file doesn't seem to go through stdout, so using subprocess.Popen() returns an empty variable.



cmd1=["ffmpeg", "-i","./input.MOV", "-vf", "vidstabdetect=stepsize=6:shakiness=10:accuracy=15", "-f","null","pipe:1"]
p = subprocess.Popen(cmd1, stdout=subprocess.PIPE)
vectors, err = p.communicate()


The issues is that vibstabdetect takes a filter called result, and outputs a file to whatever's specified there, and stdout remains empty. (If there's no result specified it defaults to transforms.trf.)



Is there a way to get the contents of the result file?
When running the script with the code above it executes without error, but the file is created with the default name and the variable remains empty.










share|improve this question






















  • can't you just output the data with ffmpeg as an actual file, and read it in with python?

    – user3469811
    Mar 24 at 12:40











  • That's how I'm doing it currently, but I was wondering if there was a way to avoid that.

    – Circo
    Mar 24 at 12:46











  • -f fmt (input/output): Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases. maybe you have to set -f argument, because you do not explicitly produce an output file

    – user3469811
    Mar 24 at 13:04












  • Which OS is this?

    – Gyan
    Mar 24 at 15:20











  • @user3469811 there's already an explicit output - it's pipe:1 in this case. But that output is empty, the generated comes from the result filter. The -f null is used to specify that there's no file extension, as nothing is generated there because stdout is empty.

    – Circo
    Mar 24 at 15:29














0












0








0








I'm trying to write a python script to stabilize videos using ffmpeg and the vid.stab library.
My problem is that the output file doesn't seem to go through stdout, so using subprocess.Popen() returns an empty variable.



cmd1=["ffmpeg", "-i","./input.MOV", "-vf", "vidstabdetect=stepsize=6:shakiness=10:accuracy=15", "-f","null","pipe:1"]
p = subprocess.Popen(cmd1, stdout=subprocess.PIPE)
vectors, err = p.communicate()


The issues is that vibstabdetect takes a filter called result, and outputs a file to whatever's specified there, and stdout remains empty. (If there's no result specified it defaults to transforms.trf.)



Is there a way to get the contents of the result file?
When running the script with the code above it executes without error, but the file is created with the default name and the variable remains empty.










share|improve this question














I'm trying to write a python script to stabilize videos using ffmpeg and the vid.stab library.
My problem is that the output file doesn't seem to go through stdout, so using subprocess.Popen() returns an empty variable.



cmd1=["ffmpeg", "-i","./input.MOV", "-vf", "vidstabdetect=stepsize=6:shakiness=10:accuracy=15", "-f","null","pipe:1"]
p = subprocess.Popen(cmd1, stdout=subprocess.PIPE)
vectors, err = p.communicate()


The issues is that vibstabdetect takes a filter called result, and outputs a file to whatever's specified there, and stdout remains empty. (If there's no result specified it defaults to transforms.trf.)



Is there a way to get the contents of the result file?
When running the script with the code above it executes without error, but the file is created with the default name and the variable remains empty.







python video ffmpeg image-stabilization






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 12:36









CircoCirco

1034




1034












  • can't you just output the data with ffmpeg as an actual file, and read it in with python?

    – user3469811
    Mar 24 at 12:40











  • That's how I'm doing it currently, but I was wondering if there was a way to avoid that.

    – Circo
    Mar 24 at 12:46











  • -f fmt (input/output): Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases. maybe you have to set -f argument, because you do not explicitly produce an output file

    – user3469811
    Mar 24 at 13:04












  • Which OS is this?

    – Gyan
    Mar 24 at 15:20











  • @user3469811 there's already an explicit output - it's pipe:1 in this case. But that output is empty, the generated comes from the result filter. The -f null is used to specify that there's no file extension, as nothing is generated there because stdout is empty.

    – Circo
    Mar 24 at 15:29


















  • can't you just output the data with ffmpeg as an actual file, and read it in with python?

    – user3469811
    Mar 24 at 12:40











  • That's how I'm doing it currently, but I was wondering if there was a way to avoid that.

    – Circo
    Mar 24 at 12:46











  • -f fmt (input/output): Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases. maybe you have to set -f argument, because you do not explicitly produce an output file

    – user3469811
    Mar 24 at 13:04












  • Which OS is this?

    – Gyan
    Mar 24 at 15:20











  • @user3469811 there's already an explicit output - it's pipe:1 in this case. But that output is empty, the generated comes from the result filter. The -f null is used to specify that there's no file extension, as nothing is generated there because stdout is empty.

    – Circo
    Mar 24 at 15:29

















can't you just output the data with ffmpeg as an actual file, and read it in with python?

– user3469811
Mar 24 at 12:40





can't you just output the data with ffmpeg as an actual file, and read it in with python?

– user3469811
Mar 24 at 12:40













That's how I'm doing it currently, but I was wondering if there was a way to avoid that.

– Circo
Mar 24 at 12:46





That's how I'm doing it currently, but I was wondering if there was a way to avoid that.

– Circo
Mar 24 at 12:46













-f fmt (input/output): Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases. maybe you have to set -f argument, because you do not explicitly produce an output file

– user3469811
Mar 24 at 13:04






-f fmt (input/output): Force input or output file format. The format is normally auto detected for input files and guessed from the file extension for output files, so this option is not needed in most cases. maybe you have to set -f argument, because you do not explicitly produce an output file

– user3469811
Mar 24 at 13:04














Which OS is this?

– Gyan
Mar 24 at 15:20





Which OS is this?

– Gyan
Mar 24 at 15:20













@user3469811 there's already an explicit output - it's pipe:1 in this case. But that output is empty, the generated comes from the result filter. The -f null is used to specify that there's no file extension, as nothing is generated there because stdout is empty.

– Circo
Mar 24 at 15:29






@user3469811 there's already an explicit output - it's pipe:1 in this case. But that output is empty, the generated comes from the result filter. The -f null is used to specify that there's no file extension, as nothing is generated there because stdout is empty.

– Circo
Mar 24 at 15:29













1 Answer
1






active

oldest

votes


















2














You need to specify stdout for the filter logging data, not the transcoded output from ffmpeg, which is what your current -f null pipe:1 does.



However, the vidstabdetect filter uses the POSIX fopen to open the destination for the transform data, unlike most other filters which use the internal avio_open. For fopen, pipe:1 is not acceptable. For Windows, CON, and for linux, /dev/stdout, as you confirmed, is required.






share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323852%2fcapturing-output-file-of-ffmpeg-with-vid-stab-in-python-into-a-variable%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    You need to specify stdout for the filter logging data, not the transcoded output from ffmpeg, which is what your current -f null pipe:1 does.



    However, the vidstabdetect filter uses the POSIX fopen to open the destination for the transform data, unlike most other filters which use the internal avio_open. For fopen, pipe:1 is not acceptable. For Windows, CON, and for linux, /dev/stdout, as you confirmed, is required.






    share|improve this answer



























      2














      You need to specify stdout for the filter logging data, not the transcoded output from ffmpeg, which is what your current -f null pipe:1 does.



      However, the vidstabdetect filter uses the POSIX fopen to open the destination for the transform data, unlike most other filters which use the internal avio_open. For fopen, pipe:1 is not acceptable. For Windows, CON, and for linux, /dev/stdout, as you confirmed, is required.






      share|improve this answer

























        2












        2








        2







        You need to specify stdout for the filter logging data, not the transcoded output from ffmpeg, which is what your current -f null pipe:1 does.



        However, the vidstabdetect filter uses the POSIX fopen to open the destination for the transform data, unlike most other filters which use the internal avio_open. For fopen, pipe:1 is not acceptable. For Windows, CON, and for linux, /dev/stdout, as you confirmed, is required.






        share|improve this answer













        You need to specify stdout for the filter logging data, not the transcoded output from ffmpeg, which is what your current -f null pipe:1 does.



        However, the vidstabdetect filter uses the POSIX fopen to open the destination for the transform data, unlike most other filters which use the internal avio_open. For fopen, pipe:1 is not acceptable. For Windows, CON, and for linux, /dev/stdout, as you confirmed, is required.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Mar 24 at 16:55









        GyanGyan

        36.2k23374




        36.2k23374





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55323852%2fcapturing-output-file-of-ffmpeg-with-vid-stab-in-python-into-a-variable%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

            SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

            은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현