Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61008

Re: using ffmpeg command line with python's subprocess module

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.008
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'arguments': 0.09; 'solution,': 0.09; 'subject:command': 0.09; 'subject:module': 0.09; 'subject:using': 0.09; 'cc:addr:python-list': 0.11; '*name*': 0.16; 'andreas': 0.16; 'argument.': 0.16; 'closed.': 0.16; 'expecting': 0.16; 'expects': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'tempfile': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'wed,': 0.18; 'all,': 0.19; 'bit': 0.19; 'module': 0.19; 'cc:addr:python.org': 0.22; 'exists': 0.24; 'file.': 0.24; 'cc:2**0': 0.24; 'header:In-Reply- To:1': 0.27; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'file': 0.32; 'another': 0.32; 'open': 0.33; 'url:python': 0.33; 'subject:with': 0.35; "can't": 0.35; 'one,': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'object,': 0.36; "i'll": 0.36; 'url:org': 0.36; 'list': 0.37; 'url:library': 0.38; 'pm,': 0.38; 'rather': 0.38; 'that,': 0.38; 'url:3': 0.61; "you're": 0.61; 'first': 0.61; 'here:': 0.62; "you'll": 0.62; 'more': 0.64; 'fact,': 0.69; 'guaranteed': 0.75; 'to:none': 0.92; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=ncxXrplNQqqzjQ0iXPzsstVxyesfbn+Bu6JolvSzgiQ=; b=YR1WTk88XITq12ooXCgMKj/lhX16cIvbHHwvrqzwvPriyXdqMuVLT1AXSXNaUXvPfi +I/XZ5uLDY8uMqm3ZPgPWdZSR2R/dN3TW8tj99V/J1crVZqqZstzuJwcJ7Ffyf2o9rN5 X6A+pwZoWrsvcB5veaI03zbasHjRXG5mLLGhilub+GPdlB/CbMWWRdH7IFjxwvQk29sx hWudak7xtI3b1hQ/Q0+UduNYHMi1MvRrbOjds0C44vFSRh9N31EbGbBt+65CwHrUwg0S ceiiZ70K80FEptNqUdQUgA3nhcolUD4oWv3lHtzVp8AaIZJ8kdl3YxYAcpW7HEJMxHT6 nn7A==
MIME-Version 1.0
X-Received by 10.68.248.33 with SMTP id yj1mr44370576pbc.45.1386154309220; Wed, 04 Dec 2013 02:51:49 -0800 (PST)
In-Reply-To <20131204103827.6c5332c6@Hof>
References <d344154e-1de9-4016-b1fc-d1e9d989529d@googlegroups.com> <CAPTjJmrG+ik5=kOxC5AYg2BFe2F3CzWmAREReuw9-w=TuDuPuQ@mail.gmail.com> <mailman.3478.1386019175.18130.python-list@python.org> <3104d38f-3fca-43b0-b6a4-b600684f765e@googlegroups.com> <6fb2b162-cf9b-4c1c-bf5f-f14baf5baac4@googlegroups.com> <35c86484-d0dd-4954-adee-cde3a2fd7ac1@googlegroups.com> <20131204103827.6c5332c6@Hof>
Date Wed, 4 Dec 2013 21:51:49 +1100
Subject Re: using ffmpeg command line with python's subprocess module
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.3554.1386154312.18130.python-list@python.org> (permalink)
Lines 18
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1386154312 news.xs4all.nl 2948 [2001:888:2000:d::a6]:33992
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:61008

Show key headers only | View raw


On Wed, Dec 4, 2013 at 8:38 PM, Andreas Perstinger <andipersti@gmail.com> wrote:
> "fp" is a file object, but subprocess expects a list of strings as
> its first argument.

More fundamentally: The subprocess's arguments must include the *name*
of the file. This means you can't use TemporaryFile at all, as it's
not guaranteed to return an object that actually has a file name.

There's another problem, too, and that's that you're not closing the
file before expecting the subprocess to open it. And once you do that,
you'll find that the file no longer exists once it's been closed. In
fact, you'll need to research the tempfile module a bit to be able to
do what you want here; rather than spoon-feed you an exact solution,
I'll just say that there is one, and it can be found here:

http://docs.python.org/3.3/library/tempfile.html

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

using ffmpeg command line with python's subprocess module iMath <redstone-cold@163.com> - 2013-12-02 03:34 -0800
  Re: using ffmpeg command line with python's subprocess module Chris Angelico <rosuav@gmail.com> - 2013-12-02 22:40 +1100
  Re: using ffmpeg command line with python's subprocess module Ben Finney <ben+python@benfinney.id.au> - 2013-12-03 08:19 +1100
    Re: using ffmpeg command line with python's subprocess module iMath <redstone-cold@163.com> - 2013-12-02 17:15 -0800
      Re: using ffmpeg command line with python's subprocess module rusi <rustompmody@gmail.com> - 2013-12-02 17:42 -0800
        Re: using ffmpeg command line with python's subprocess module iMath <redstone-cold@163.com> - 2013-12-03 17:42 -0800
        Re: using ffmpeg command line with python's subprocess module iMath <redstone-cold@163.com> - 2013-12-03 17:42 -0800
          Re: using ffmpeg command line with python's subprocess module Andreas Perstinger <andipersti@gmail.com> - 2013-12-04 10:38 +0100
            Re: using ffmpeg command line with python's subprocess module iMath <redstone-cold@163.com> - 2013-12-05 22:23 -0800
              Re: using ffmpeg command line with python's subprocess module Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-06 09:23 +0000
                Re: using ffmpeg command line with python's subprocess module iMath <redstone-cold@163.com> - 2013-12-06 06:52 -0800
                Re: using ffmpeg command line with python's subprocess module Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-06 15:12 +0000
                Re: using ffmpeg command line with python's subprocess module rusi <rustompmody@gmail.com> - 2013-12-06 07:15 -0800
                Re: using ffmpeg command line with python's subprocess module rusi <rustompmody@gmail.com> - 2013-12-06 07:13 -0800
                Re: using ffmpeg command line with python's subprocess module Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2013-12-06 15:34 +0000
                Re: using ffmpeg command line with python's subprocess module Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-06 15:53 +0000
                Re: using ffmpeg command line with python's subprocess module rusi <rustompmody@gmail.com> - 2013-12-06 08:19 -0800
                Re: using ffmpeg command line with python's subprocess module Mark Lawrence <breamoreboy@yahoo.co.uk> - 2013-12-06 16:25 +0000
                Re: using ffmpeg command line with python's subprocess module rusi <rustompmody@gmail.com> - 2013-12-06 08:45 -0800
                Re: using ffmpeg command line with python's subprocess module MRAB <python@mrabarnett.plus.com> - 2013-12-06 16:41 +0000
                Re: using ffmpeg command line with python's subprocess module rusi <rustompmody@gmail.com> - 2013-12-06 08:53 -0800
                Re: using ffmpeg command line with python's subprocess module Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2013-12-07 13:01 +1300
              Re: using ffmpeg command line with python's subprocess module Ned Batchelder <ned@nedbatchelder.com> - 2013-12-06 06:31 -0500
          Re: using ffmpeg command line with python's subprocess module Chris Angelico <rosuav@gmail.com> - 2013-12-04 21:51 +1100
            Re: using ffmpeg command line with python's subprocess module iMath <redstone-cold@163.com> - 2013-12-06 06:54 -0800
              Re: using ffmpeg command line with python's subprocess module Chris Angelico <rosuav@gmail.com> - 2013-12-07 01:59 +1100
                Re: using ffmpeg command line with python's subprocess module iMath <redstone-cold@163.com> - 2013-12-09 01:04 -0800
                Re: using ffmpeg command line with python's subprocess module Andreas Perstinger <andipersti@gmail.com> - 2013-12-10 13:59 +0100
    Re: using ffmpeg command line with python's subprocess module Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2013-12-03 10:33 +0100
      Re: using ffmpeg command line with python's subprocess module iMath <redstone-cold@163.com> - 2013-12-03 05:59 -0800
  Re: using ffmpeg command line with python's subprocess module Chris Angelico <rosuav@gmail.com> - 2013-12-03 08:25 +1100

csiph-web