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

            Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

            Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript