Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.010 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'subject:command': 0.09; 'subject:module': 0.09; 'subject:using': 0.09; 'cc:addr:python- list': 0.11; 'attribute,': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'job!': 0.16; 'written.': 0.16; 'subject:python': 0.16; 'sat,': 0.16; 'wrote:': 0.18; 'all,': 0.19; "skip:' 30": 0.19; 'otherwise,': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'points': 0.29; 'dec': 0.30; 'message-id:@mail.gmail.com': 0.30; 'getting': 0.31; 'file': 0.32; 'open': 0.33; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'skip:f 40': 0.36; 'even': 0.60; 'skip:n 10': 0.64; 'close': 0.67; '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=XMDM2uVVTi/xp0v86Uqoh1P37o3cC1NpKsIskSOiVzU=; b=s8JXU2xYFuptXvYdOA7d6UnjLG9y4C7aCs3jO6rPtqtp5rGgOvaeqBfmu5qIGZKpzU NWFvOU1BnhQ4yanvJjLPmGDURW/DepbbVnB0T1l7g9ymTHNZhX8aGX3yZ+AdYFIjKEfG ufB14vIHm+PrCC6HKHVotUr7D4kUd+c1s+3y0jsqrxI+X3tSHRsWBE0a94FCHJbbqA52 6WUboZYyFBrMRFvpJkAIa2TTnlUS9ZJAwFwXv28mM2CrVjQK7130GC3nhbffGXRCXcBC Bnx7BRwjk6YhHuIGC+A1p7sHhRhmCG5r+ysWLg4BDBx8jpb/X1mDfGGHIvSsddtZldIG 0cMA== MIME-Version: 1.0 X-Received: by 10.68.236.133 with SMTP id uu5mr4673878pbc.153.1386341983441; Fri, 06 Dec 2013 06:59:43 -0800 (PST) In-Reply-To: <60f2e393-658c-4e18-85b1-fc7d0b07ddb4@googlegroups.com> References: <3104d38f-3fca-43b0-b6a4-b600684f765e@googlegroups.com> <6fb2b162-cf9b-4c1c-bf5f-f14baf5baac4@googlegroups.com> <35c86484-d0dd-4954-adee-cde3a2fd7ac1@googlegroups.com> <20131204103827.6c5332c6@Hof> <60f2e393-658c-4e18-85b1-fc7d0b07ddb4@googlegroups.com> Date: Sat, 7 Dec 2013 01:59:43 +1100 Subject: Re: using ffmpeg command line with python's subprocess module From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386341991 news.xs4all.nl 2877 [2001:888:2000:d::a6]:57977 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61155 On Sat, Dec 7, 2013 at 1:54 AM, iMath wrote: > fp=tempfile.NamedTemporaryFile(delete=False) > fp.write(("file '"+fileName1+"'\n").encode('utf-8')) > fp.write(("file '"+fileName2+"'\n").encode('utf-8')) > > > subprocess.call(['ffmpeg', '-f', 'concat','-i',fp.name, '-c', 'copy', fileName]) > fp.close() You need to close the file before getting the other process to use it. Otherwise, it may not be able to open the file at all, and even if it can, you might find that not all the data has been written. But congrats! You have successfully found the points I was directing you to. Yes, I was hinting that you need NamedTemporaryFile, the .name attribute, and delete=False. Good job! ChrisA