OSProcess Exit Status 256

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

OSProcess Exit Status 256

JohnReed Maffeo
I have an application that has been running for many months which uses OSProcess to run a program to record an audio stream. The content is available in two flavors, an mps stream that is recorded in real time and an flv which is recorded in less than a minute. I am working to 
refactor the working method to use the faster recording option.
 
I have a methods to create a command line string which I execute using OS process. The command to record the mp3 is simple,
the command to record the flv stream is more complex and this may be the source of my problem, but I am not sure and I don't know how to debug it.
 
If I copy either command to a terminal screen and run them there, the programs execute as expected.
When I run them in Squeak, the mp3 produces results, the flv dies.
The biggest difference between the two command lines is the use of semi-colon command separators  and double quotes in the flv example.
 
The command line for the mp3 is : (exitStatus 0)
 
/opt/local/bin/ffmpeg -i mmsh://wm.bbc.co.uk/wms/prod_rb2_wm_wma_low_intl/p025mlpk_b007gwqn_1410010018428.wma -y -map_metadata -1 -acodec libmp3lame -ab 128k /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp3
 
The command line for the flv is: (exitStatus 256)
 
/opt/local/bin/rtmpdump -r "rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc445173a649286ea33b76018f14be91bebdc361b035283304013" -a "a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc445173a649286ea33b76018f14be91bebdc361b035283304013" -y "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4" -o /Volumes/MediaVault/BBC/490947196.flv ; ffmpeg -loglevel quiet  -i /Volumes/MediaVault/BBC/490947196.flv -c copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm /Volumes/MediaVault/BBC/490947196.flv
 
The command generated by OSProcess may be:

/bin/sh -c rtmpdump -r "rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c6d083b34cdc49d43bb94c0a0e536bf9a14fbea2857d4d3" -a "a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c6d083b34cdc49d43bb94c0a0e536bf9a14fbea2857d4d3" -y "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4" -o /Volumes/MediaVault/BBC/960136998.flv ; ffmpeg -loglevel quiet  -i /Volumes/MediaVault/BBC/960136998.flv -c copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm /Volumes/MediaVault/BBC/960136998.flv

if this is correct, when I run it at the command line, I get an error:

RTMPDump 2.4
(c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL
ERROR: You must specify a hostname (--host) or url (-r "rtmp://host[:port]/playpath") containing a hostname
rm: /Volumes/MediaVault/BBC/960136998.flv: No such file or directory

 

but when I inspect the instance of ExternalUnixOSProcess > osp2 := ExternalUnixOSProcess command: cmdLine. I don't see anything in
the stdout or stderror.
 
Thanks for any suggestions,
jrm
 
 
 

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess Exit Status 256

carlo.t
Hi

I think it's to do with your quoting in the command.
e.g.
/bin/sh -c echo test
or
/bin/sh -c echo "test"
Will not print out test as expected.
But
/bin/sh -c "echo \"test\""
will print test.

My suggesting would be to try quote the whole command string and escape out the current quotes in the command.

Cheers
Carlo
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess Exit Status 256

Levente Uzonyi-2
In reply to this post by JohnReed Maffeo
The semicolon between commands is only meaningful in a shell. It tells
the shell to run the three programs sequentially. With OSProcess the
semicolon and the rest of the line is passed to the first program, which
gives you the error.
So the easiest way to fix it is to run the three programs separately. Just
execute the first, wait till it exits, then start the second, etc.


Levente

On Thu, 11 Sep 2014, JohnReed Maffeo wrote:

> I have an application that has been running for many months which uses OSProcess to run a program to record an audio stream. The content is available in two flavors, an mps stream that is recorded in real
> time and an flv which is recorded in less than a minute. I am working to 
> refactor the working method to use the faster recording option.
>  
> I have a methods to create a command line string which I execute using OS process. The command to record the mp3 is simple,
> the command to record the flv stream is more complex and this may be the source of my problem, but I am not sure and I don't know how to debug it.
>  
> If I copy either command to a terminal screen and run them there, the programs execute as expected.
> When I run them in Squeak, the mp3 produces results, the flv dies.
> The biggest difference between the two command lines is the use of semi-colon command separators  and double quotes in the flv example.
>  
> The command line for the mp3 is : (exitStatus 0)
>  
> /opt/local/bin/ffmpeg -i mmsh://wm.bbc.co.uk/wms/prod_rb2_wm_wma_low_intl/p025mlpk_b007gwqn_1410010018428.wma -y -map_metadata -1 -acodec libmp3lame -ab 128k /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp3
>  
> The command line for the flv is: (exitStatus 256)
>  
> /opt/local/bin/rtmpdump -r"rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc44517
> 3a649286ea33b76018f14be91bebdc361b035283304013" -a"a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc445173a649286ea33b76018f14be91bebdc361b0352
> 83304013" -y "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4" -o /Volumes/MediaVault/BBC/490947196.flv ; ffmpeg -loglevel quiet  -i /Volumes/MediaVault/BBC/490947196.flv -c
> copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm /Volumes/MediaVault/BBC/490947196.flv
>  
> The command generated by OSProcess may be:
>
> /bin/sh -c rtmpdump -r"rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c
> 6d083b34cdc49d43bb94c0a0e536bf9a14fbea2857d4d3" -a"a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c6d083b34cdc49d43bb94c0a0e536bf9a14fbea
> 2857d4d3" -y "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4" -o /Volumes/MediaVault/BBC/960136998.flv ; ffmpeg -loglevel quiet  -i /Volumes/MediaVault/BBC/960136998.flv -c
> copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm /Volumes/MediaVault/BBC/960136998.flv
>
> if this is correct, when I run it at the command line, I get an error:
>
> RTMPDump 2.4 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer Team; license: GPL ERROR: You must specify a hostname (--host) or url (-r "rtmp://host[:port]/playpath") containing a hostname rm:
> /Volumes/MediaVault/BBC/960136998.flv: No such file or directory
>
>  
>
> but when I inspect the instance of ExternalUnixOSProcess > osp2 := ExternalUnixOSProcess command: cmdLine. I don't see anything in
> the stdout or stderror.
>  
> Thanks for any suggestions,
> jrm
>  
>  
>  
>
>
_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess Exit Status 256

David T. Lewis
Yes, that's right.

An even easier way to do this is to use ProxyPipeline class>>command: to
run the command line. This will do all of the Unix shell parsing directly
in Smalltalk rather than passing it to the external shell. It also
arranges a pipeline of connected programs all in one step, very much as
the Unix shell would do for you.

ProxyPipeline is part of the CommandShell package, which is a companion to
OSProcess. I expect that you already have it loaded, but if not please do
give it a try.

Dave

> The semicolon between commands is only meaningful in a shell. It tells
> the shell to run the three programs sequentially. With OSProcess the
> semicolon and the rest of the line is passed to the first program, which
> gives you the error.
> So the easiest way to fix it is to run the three programs separately. Just
> execute the first, wait till it exits, then start the second, etc.
>
>
> Levente
>
> On Thu, 11 Sep 2014, JohnReed Maffeo wrote:
>
>> I have an application that has been running for many months which uses
>> OSProcess to run a program to record an audio stream. The content is
>> available in two flavors, an mps stream that is recorded in real
>> time and an flv which is recorded in less than a minute. I am working
>> to 
>> refactor the working method to use the faster recording option.
>>  
>> I have a methods to create a command line string which I execute using
>> OS process. The command to record the mp3 is simple,
>> the command to record the flv stream is more complex and this may be the
>> source of my problem, but I am not sure and I don't know how to debug
>> it.
>>  
>> If I copy either command to a terminal screen and run them there, the
>> programs execute as expected.
>> When I run them in Squeak, the mp3 produces results, the flv dies.
>> The biggest difference between the two command lines is the use of
>> semi-colon command separators  and double quotes in the flv example.
>>  
>> The command line for the mp3 is : (exitStatus 0)
>>  
>> /opt/local/bin/ffmpeg -i
>> mmsh://wm.bbc.co.uk/wms/prod_rb2_wm_wma_low_intl/p025mlpk_b007gwqn_1410010018428.wma
>> -y -map_metadata -1 -acodec libmp3lame -ab 128k
>> /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp3
>>  
>> The command line for the flv is: (exitStatus 256)
>>  
>> /opt/local/bin/rtmpdump
>> -r"rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc44517
>> 3a649286ea33b76018f14be91bebdc361b035283304013"
>> -a"a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc445173a649286ea33b76018f14be91bebdc361b0352
>> 83304013" -y
>> "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4"
>> -o /Volumes/MediaVault/BBC/490947196.flv ; ffmpeg -loglevel quiet  -i
>> /Volumes/MediaVault/BBC/490947196.flv -c
>> copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm
>> /Volumes/MediaVault/BBC/490947196.flv
>>  
>> The command generated by OSProcess may be:
>>
>> /bin/sh -c rtmpdump
>> -r"rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c
>> 6d083b34cdc49d43bb94c0a0e536bf9a14fbea2857d4d3"
>> -a"a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c6d083b34cdc49d43bb94c0a0e536bf9a14fbea
>> 2857d4d3" -y
>> "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4"
>> -o /Volumes/MediaVault/BBC/960136998.flv ; ffmpeg -loglevel quiet  -i
>> /Volumes/MediaVault/BBC/960136998.flv -c
>> copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm
>> /Volumes/MediaVault/BBC/960136998.flv
>>
>> if this is correct, when I run it at the command line, I get an error:
>>
>> RTMPDump 2.4 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer
>> Team; license: GPL ERROR: You must specify a hostname (--host) or url
>> (-r "rtmp://host[:port]/playpath") containing a hostname rm:
>> /Volumes/MediaVault/BBC/960136998.flv: No such file or directory
>>
>>  
>>
>> but when I inspect the instance of ExternalUnixOSProcess > osp2 :=
>> ExternalUnixOSProcess command: cmdLine. I don't see anything in
>> the stdout or stderror.
>>  
>> Thanks for any suggestions,
>> jrm
>>  
>>  
>>  
>>
>>_______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess Exit Status 256

David T. Lewis
JohnReed,

In addition to ProxyPipeline, another thing that might be useful for the
kind of work you are doing would be the methods in category "command
scripting" of CommandShell. CommandShell uses ProxyPipeline to do the
work, but it looks to me like some of the things you are doing might be
easier to do with a CommandShell.

Dave

> Yes, that's right.
>
> An even easier way to do this is to use ProxyPipeline class>>command: to
> run the command line. This will do all of the Unix shell parsing directly
> in Smalltalk rather than passing it to the external shell. It also
> arranges a pipeline of connected programs all in one step, very much as
> the Unix shell would do for you.
>
> ProxyPipeline is part of the CommandShell package, which is a companion to
> OSProcess. I expect that you already have it loaded, but if not please do
> give it a try.
>
> Dave
>
>> The semicolon between commands is only meaningful in a shell. It tells
>> the shell to run the three programs sequentially. With OSProcess the
>> semicolon and the rest of the line is passed to the first program, which
>> gives you the error.
>> So the easiest way to fix it is to run the three programs separately.
>> Just
>> execute the first, wait till it exits, then start the second, etc.
>>
>>
>> Levente
>>
>> On Thu, 11 Sep 2014, JohnReed Maffeo wrote:
>>
>>> I have an application that has been running for many months which uses
>>> OSProcess to run a program to record an audio stream. The content is
>>> available in two flavors, an mps stream that is recorded in real
>>> time and an flv which is recorded in less than a minute. I am working
>>> to 
>>> refactor the working method to use the faster recording option.
>>>  
>>> I have a methods to create a command line string which I execute using
>>> OS process. The command to record the mp3 is simple,
>>> the command to record the flv stream is more complex and this may be
>>> the
>>> source of my problem, but I am not sure and I don't know how to debug
>>> it.
>>>  
>>> If I copy either command to a terminal screen and run them there, the
>>> programs execute as expected.
>>> When I run them in Squeak, the mp3 produces results, the flv dies.
>>> The biggest difference between the two command lines is the use of
>>> semi-colon command separators  and double quotes in the flv example.
>>>  
>>> The command line for the mp3 is : (exitStatus 0)
>>>  
>>> /opt/local/bin/ffmpeg -i
>>> mmsh://wm.bbc.co.uk/wms/prod_rb2_wm_wma_low_intl/p025mlpk_b007gwqn_1410010018428.wma
>>> -y -map_metadata -1 -acodec libmp3lame -ab 128k
>>> /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp3
>>>  
>>> The command line for the flv is: (exitStatus 256)
>>>  
>>> /opt/local/bin/rtmpdump
>>> -r"rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc44517
>>> 3a649286ea33b76018f14be91bebdc361b035283304013"
>>> -a"a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc445173a649286ea33b76018f14be91bebdc361b0352
>>> 83304013" -y
>>> "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4"
>>> -o /Volumes/MediaVault/BBC/490947196.flv ; ffmpeg -loglevel quiet  -i
>>> /Volumes/MediaVault/BBC/490947196.flv -c
>>> copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm
>>> /Volumes/MediaVault/BBC/490947196.flv
>>>  
>>> The command generated by OSProcess may be:
>>>
>>> /bin/sh -c rtmpdump
>>> -r"rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c
>>> 6d083b34cdc49d43bb94c0a0e536bf9a14fbea2857d4d3"
>>> -a"a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c6d083b34cdc49d43bb94c0a0e536bf9a14fbea
>>> 2857d4d3" -y
>>> "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4"
>>> -o /Volumes/MediaVault/BBC/960136998.flv ; ffmpeg -loglevel quiet  -i
>>> /Volumes/MediaVault/BBC/960136998.flv -c
>>> copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm
>>> /Volumes/MediaVault/BBC/960136998.flv
>>>
>>> if this is correct, when I run it at the command line, I get an error:
>>>
>>> RTMPDump 2.4 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer
>>> Team; license: GPL ERROR: You must specify a hostname (--host) or url
>>> (-r "rtmp://host[:port]/playpath") containing a hostname rm:
>>> /Volumes/MediaVault/BBC/960136998.flv: No such file or directory
>>>
>>>  
>>>
>>> but when I inspect the instance of ExternalUnixOSProcess > osp2 :=
>>> ExternalUnixOSProcess command: cmdLine. I don't see anything in
>>> the stdout or stderror.
>>>  
>>> Thanks for any suggestions,
>>> jrm
>>>  
>>>  
>>>  
>>>
>>>_______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
>
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess Exit Status 256

JohnReed Maffeo
Dave, thanks
 
It looks like the question mark in the string I am providing is the source of the problem. I tried "CommandShell new open; script: cmdLine." and saw this in the SqueakShell window. sqsh is choking on a question mark which does not happen when I run the command in a terminal window. I will work on this some more over the weekend and see if I can sort it out. 
--- start ---
/opt/local/bin/rtmpdump -r "rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025y8q4_b0082dzb_1410416158999.mp4&et=1410496940&fmta-token=0113a6812ab57b232f8bce347fadaa97fb51eb2b52bdf943d138aa3620ec1dd2" -a "a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025y8q4_b0082dzb_1410416158999.mp4&et=1410496940&fmta-token=0113a6812ab57b232f8bce347fadaa97fb51eb2b52bdf943d138aa3620ec1dd2" -y "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025y8q4_b0082dzb_1410416158999.mp4" -o /Volumes/MediaVault/BBC/693150877.flv
[1] 51130
sqsh: av=1: command not found
[2] 
sqsh: te=connect: command not found
[2] 
sqsh: mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025y8q4_b0082dzb_1410416158999.mp4: command not found
[2] 
sqsh: et=1410496940: command not found
[2] 
sqsh: fmta-token=0113a6812ab57b232f8bce347fadaa97fb51eb2b52bdf943d138aa3620ec1dd2": command not found
--- snip the rest ---
Sent: Thursday, September 11, 2014 at 9:51 AM
From: "David T. Lewis" <[hidden email]>
To: "A friendly place to get answers to even the most basic questions about Squeak." <[hidden email]>
Subject: Re: [Newbies] OSProcess Exit Status 256
JohnReed,

In addition to ProxyPipeline, another thing that might be useful for the
kind of work you are doing would be the methods in category "command
scripting" of CommandShell. CommandShell uses ProxyPipeline to do the
work, but it looks to me like some of the things you are doing might be
easier to do with a CommandShell.

Dave

> Yes, that's right.
>
> An even easier way to do this is to use ProxyPipeline class>>command: to
> run the command line. This will do all of the Unix shell parsing directly
> in Smalltalk rather than passing it to the external shell. It also
> arranges a pipeline of connected programs all in one step, very much as
> the Unix shell would do for you.
>
> ProxyPipeline is part of the CommandShell package, which is a companion to
> OSProcess. I expect that you already have it loaded, but if not please do
> give it a try.
>
> Dave
>
>> The semicolon between commands is only meaningful in a shell. It tells
>> the shell to run the three programs sequentially. With OSProcess the
>> semicolon and the rest of the line is passed to the first program, which
>> gives you the error.
>> So the easiest way to fix it is to run the three programs separately.
>> Just
>> execute the first, wait till it exits, then start the second, etc.
>>
>>
>> Levente
>>
>> On Thu, 11 Sep 2014, JohnReed Maffeo wrote:
>>
>>> I have an application that has been running for many months which uses
>>> OSProcess to run a program to record an audio stream. The content is
>>> available in two flavors, an mps stream that is recorded in real
>>> time and an flv which is recorded in less than a minute. I am working
>>> to 
>>> refactor the working method to use the faster recording option.
>>>  
>>> I have a methods to create a command line string which I execute using
>>> OS process. The command to record the mp3 is simple,
>>> the command to record the flv stream is more complex and this may be
>>> the
>>> source of my problem, but I am not sure and I don't know how to debug
>>> it.
>>>  
>>> If I copy either command to a terminal screen and run them there, the
>>> programs execute as expected.
>>> When I run them in Squeak, the mp3 produces results, the flv dies.
>>> The biggest difference between the two command lines is the use of
>>> semi-colon command separators  and double quotes in the flv example.
>>>  
>>> The command line for the mp3 is : (exitStatus 0)
>>>  
>>> /opt/local/bin/ffmpeg -i
>>> mmsh://wm.bbc.co.uk/wms/prod_rb2_wm_wma_low_intl/p025mlpk_b007gwqn_1410010018428.wma
>>> -y -map_metadata -1 -acodec libmp3lame -ab 128k
>>> /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp3
>>>  
>>> The command line for the flv is: (exitStatus 256)
>>>  
>>> /opt/local/bin/rtmpdump
>>> -r"rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc44517
>>> 3a649286ea33b76018f14be91bebdc361b035283304013"
>>> -a"a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410418602&fmta-token=9e6e9980cc1fc445173a649286ea33b76018f14be91bebdc361b0352
>>> 83304013" -y
>>> "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4"
>>> -o /Volumes/MediaVault/BBC/490947196.flv ; ffmpeg -loglevel quiet  -i
>>> /Volumes/MediaVault/BBC/490947196.flv -c
>>> copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm
>>> /Volumes/MediaVault/BBC/490947196.flv
>>>  
>>> The command generated by OSProcess may be:
>>>
>>> /bin/sh -c rtmpdump
>>> -r"rtmp://bbcodspdns.fcod.llnwd.net:1935/a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c
>>> 6d083b34cdc49d43bb94c0a0e536bf9a14fbea2857d4d3"
>>> -a"a5999/e1?as=adobe-hmac-sha256&av=1&te=connect&mp=prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4&et=1410413706&fmta-token=ccb5e3e42d2288246c6d083b34cdc49d43bb94c0a0e536bf9a14fbea
>>> 2857d4d3" -y
>>> "mp4:prod_rb2_flv_aac_low_intl/iplayerstream/p025mlpk_b007gwqn_1410009892525.mp4"
>>> -o /Volumes/MediaVault/BBC/960136998.flv ; ffmpeg -loglevel quiet  -i
>>> /Volumes/MediaVault/BBC/960136998.flv -c
>>> copy -copyts /Volumes/MediaVault/BBC/Baldi.4.4.6-NoSin.mp4 ; rm
>>> /Volumes/MediaVault/BBC/960136998.flv
>>>
>>> if this is correct, when I run it at the command line, I get an error:
>>>
>>> RTMPDump 2.4 (c) 2010 Andrej Stepanchuk, Howard Chu, The Flvstreamer
>>> Team; license: GPL ERROR: You must specify a hostname (--host) or url
>>> (-r "rtmp://host[:port]/playpath") containing a hostname rm:
>>> /Volumes/MediaVault/BBC/960136998.flv: No such file or directory
>>>
>>>  
>>>
>>> but when I inspect the instance of ExternalUnixOSProcess > osp2 :=
>>> ExternalUnixOSProcess command: cmdLine. I don't see anything in
>>> the stdout or stderror.
>>>  
>>> Thanks for any suggestions,
>>> jrm
>>>  
>>>  
>>>  
>>>
>>>_______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>
>
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: OSProcess Exit Status 256

JohnReed Maffeo
In reply to this post by David T. Lewis
in previous message, the problem is ampersand not question mark.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners