Art S R wrote:
> On Fri, Mar 20, 2009 at 2:32 PM, Art S R <arty94...@gmail.com> wrote:
>> On Fri, Mar 20, 2009 at 12:15 PM, Duncan Webb <dun...@freevo.org> wrote:
>>> Art S R wrote:
>>>> After much befuddlement and frustration, I've finally resolved this
>>>> problem.  I went back to earlier versions of mplayer.py in svn until I
>>>> found the latest version that would work displaying live TV (10609)
>>>> and did a diff with the version I was using from Freevo 1.8.3 to see
>>>> if I could figure out what's causing the recent versions to not work.
>>>> After much more tracing, I located the problem here:
>>>>
>>>> 240        #command = self.sort_filter(command)
>>>> 241
>>>> 242        command += ['%(url)s' % args]
>>>> 243
>>>> 244        _debug_(' '.join(command[1:]))
>>>> 245
>>>> 246        self.mode = mode
>>>>
>>>> Although the debug statement in line 244 was showing the correct
>>>> mplayer command in my log:
>>>>
>>>> /usr/bin/mplayer -slave -vo xv,sdl,x11, -ao oss:/dev/dsp -autosync 100
>>>> -nolirc -nojoystick -autoq 100 -screenw 800 -screenh 600 -fs -nocache
>>>> tv:// -tv 
>>>> driver=v4l2:freq=55.250:device=/dev/video0:input=0:norm=NTSC:width=640:height=480:outfmt=yuy2
>>> Well good work to track down this problem, thanks for this.
>>>
>>> All ' '.join(command[1:] does is to convert the command list to a string
>>> for printing.
>>>
>>> You can change the _debug_ statement to:
>>> _debug_('%r' % (command,))
>>> and this will be printed exactly and represented as a list.
>>>
>>> What is possible is that the arguments are not correct in the list; may
>>> be one has a space in it when it shouldn't have. Would you please make
>>> this change and post the resulting command, thanks?
>>>
>>> The difference between a list and a string when passed to subprocess is
>>> that lists are executed directly and strings are executed through a
>>> sub-shell. With lists there is no need to quote arguments as each
>>> argument is in a list item. With strings arguments with spaces need to
>>> be quoted. Lists will start marginally faster and use a bit less memory
>>> as there is no extra shell being spawned.
>>>
>>> Duncan
>>>
>> Well, this is interesting.  The syntax of the mplayer command is
>> identical whether it's a string or a list:
>>
>> Running (list) '/usr/bin/mplayer -slave -vo xv,sdl,x11, -ao
>> oss:/dev/dsp -autosync 100 -nolirc -nojoystick -autoq 100 -screenw 800
>> -screenh 600 -fs -nocache tv:// -tv
>> driver=v4l2:freq=55.250:device=/dev/video0:input=0:norm=NTSC:width=640:height=480:outfmt=yuy2
>> ' with pid 19221 priority -20
>>
>> Running (str) '/usr/bin/mplayer -slave -vo xv,sdl,x11, -ao
>> oss:/dev/dsp -autosync 100 -nolirc -nojoystick -autoq 100 -screenw 800
>> -screenh 600 -fs -nocache tv:// -tv
>> driver=v4l2:freq=55.250:device=/dev/video0:input=0:norm=NTSC:width=640:height=480:outfmt=yuy2'
>> in shell with pid 21625 priority 0
>>
>> However, running as a list does not work using either the original
>> "_debug_(' '.join(command[1:]))" or the revised "_debug_('%r' %
>> (command,))" statement.  On the other hand, when the string is passed
>> to a shell, the TV program comes in loud and clear.
>>
>> Art S R
>>
> 
> A couple of other observations, this time from mplayer's perspective.
> When the watch TV command is passed as a string (the "good" scenario),
> my mplayer-stdout*.log shows the following entries for the TV program
> being watched:
> 
> Playing tv://.
> TV file format detected.
> Selected driver: v4l2
>  name: Video 4 Linux 2 input
>  author: Martin Olschewski <olschew...@zpr.uni-koeln.de>
>  comment: first try, more to come ;-)
> Selected device: BT878 video (Hauppauge (bt878))
>  Tuner cap:
>  Tuner rxs: MONO
>  Capabilites:  video capture  video overlay  VBI capture device  tuner
>  read/write  streaming
>  supported norms: 0 = NTSC; 1 = NTSC-M; 2 = NTSC-M-JP; 3 = NTSC-M-KR;
> 4 = PAL; 5 = PAL-BG; 6 = PAL-H; 7 = PAL-I; 8 = PAL-DK; 9 = PAL-M; 10 =
> PAL-N; 11 = PAL-Nc; 12 = PAL-60; 13 = SECAM; 14 = SECAM-B; 15 =
> SECAM-G; 16 = SECAM-H; 17 = SECAM-DK; 18 = SECAM-L; 19 = SECAM-Lc;
>  inputs: 0 = Television; 1 = Composite1; 2 = S-Video; 3 = Composite3;
>  Current input: 0
>  Current format: YVU420
> v4l2: current audio mode is : MONO
> ==========================================================================
> Opening video decoder: [raw] RAW Uncompressed Video
> VDec: vo config request - 640 x 480 (preferred colorspace: Packed YUY2)
> VDec: using Packed YUY2 as output csp (no 0)
> Movie-Aspect is undefined - no prescaling applied.
> VO: [xv] 640x480 => 640x480 Packed YUY2  [fs]
> Selected video codec: [rawyuy2] vfm: raw (RAW YUY2)
> ==========================================================================
> 
> Additionally, mplayer-stderr*.log has no log entries.
> 
> However, when the watch TV command is passed as a list (the "bad"
> scenario), the following differences from the above are noted in
> mplayer-stdout*.log:
> 
> Playing tv:// -tv
> driver=v4l2:freq=55.250:device=/dev/video0:input=0:norm=NTSC:width=640:height=480:outfmt=yuy2
> .
> 
> VDec: vo config request - 640 x 480 (preferred colorspace: Planar YV12)
> VDec: using Planar YV12 as output csp (no 0)
> 
> VO: [xv] 640x480 => 640x480 Planar YV12  [fs]
> Selected video codec: [rawyv12] vfm: raw (RAW YV12)
> 
> Additionally, mplayer-stderr*.log has the following entries:
> 
> Option stream url: This URL doesn't have a port part.
> The filename option must be an integer:
> dev/video0:input=0:norm=NTSC:width=640:height=480:outfmt=yuy2
> Struct tv, field filename parsing error:
> dev/video0:input=0:norm=NTSC:width=640:height=480:outfmt=yuy2
> 
> These errors in mplayer-stderr*.log were previously reported in the
> threads entitled, "Problem With Change channel TV" (Sept. 2008) and
> "tv.mplayer can not change channel" (Dec. 2008).
> 
> Hope this additional information is helpful in diagnosing the
> differences in behavior when the command is launched from a list
> instead of from a string in a shell.

Changing the debug to print the list instead of the string will help, it
should show something like this:

['/usr/bin/mplayer', '-slave', '-vo', 'xv,sdl,x11,', '-ao',
'oss:/dev/dsp', '-autosync 100', '-nolirc', '-nojoystick', '-autoq',
'100', '-screenw', '800', '-screenh', '600', '-fs', '-nocache', 'tv://',
'-tv',
'driver=v4l2:freq=55.250:device=/dev/video0:input=0:norm=NTSC:width=640:height=480:outfmt=yuy2'
]

Where each argument is a quoted string separated by a comma. My guess is
that one of the string is like: 'tv:// -tv' so it is treated as a single
argument and so gives a error.

Duncan

------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Freevo-users mailing list
Freevo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freevo-users

Reply via email to