Results from os.system() different from execution at prompt

E

Enno Middelberg

Hi all,

I am using mpeg_encode under Linux to generate little movies. The
parameter file is generated by a Python script, the last line of which is

os.system('mpeg_encode mpeg.par')

When I execute the same command at the bash prompt, the resulting movie
is longer, i.e., it has more frames.

I have piped the outpout from both the Python-executed and
prompt-executed mpeg_encode into files and found a difference, although
the parameter files were the same file in both runs:

Prompt-executed:

MPEG ENCODER STATS (1.5b)
------------------------
TIME STARTED: Mon Dec 29 16:33:08 2003
MACHINE: PC227
FIRST FILE: /homes/emiddelb/local/pics/eberg_movie/webcam/title.jpg
LAST FILE: /homes/emiddelb/local/pics/eberg_movie/webcam/eff_1975
PATTERN: ibbbpbbbpbbb
GOP_SIZE: 30
SLICES PER FRAME: 1
(...)

Python's os.system():

MPEG ENCODER STATS (1.5b)
------------------------
TIME STARTED: Mon Dec 29 16:28:05 2003
MACHINE: PC227
FIRST FILE: /homes/emiddelb/local/pics/eberg_movie/webcam/title.jpg
LAST FILE: /homes/emiddelb/local/pics/eberg_movie/webcam/eff_1
PATTERN: ibbbpbbbpbbb ^^^^^^^^^^^^
GOP_SIZE: 30
SLICES PER FRAME: 1
(...)


So, the Python-executed mpeg_encode reports fewer input files. Any clues
why this could happen? Is there a limit on the command length or so? I
see no reason why the results from the two ways of calling mpeg_encode
should be different.


Kind regards,

Enno
 
M

Mathias Waack

Enno said:
So, the Python-executed mpeg_encode reports fewer input files. Any
clues why this could happen? Is there a limit on the command length
or so?

Why do you think the reason for this behaviour could be truncated
command line? You just call 'mpeg_encode mpeg.par', this line
shouldn't be too long neither for python nor for the shell.

Mathias
 
J

Jeff Epler

Why do you think the reason for this behaviour could be truncated
command line? You just call 'mpeg_encode mpeg.par', this line
shouldn't be too long neither for python nor for the shell.
.... and a commandline that is too long should cause a non-zero return
status, not run the program with an incorrect argument list:32512
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top