AlexInntekt / vlc_play

playing with vlc development kit
0 stars 0 forks source link

mac test #2

Open ionescu77 opened 4 years ago

ionescu77 commented 4 years ago

Test 1

 razvansky@RaziMac  ~/myProjects/vlc_play   master ●  ./manage.py                                 ✔  9278
Version: ImageMagick 7.0.10-14 Q16 x86_64 2020-05-23 https://imagemagick.org
Copyright: © 1999-2020 ImageMagick Studio LLC
License: https://imagemagick.org/script/license.php
Features: Cipher DPC HDRI Modules OpenMP(3.1)
Delegates (built-in): bzlib freetype gslib heic jng jp2 jpeg lcms ltdl lzma openexr png ps tiff webp xml zlib
Usage: import [options ...] [ file ]

By default, 'file' is written in the MIFF image format.  To
specify a particular image format, precede the filename with an image
format name and a colon (i.e. ps:image) or specify the image type as
the filename suffix (i.e. image.ps).  Specify 'file' as '-' for
standard input or output.
import: delegate library support not built-in '' (X11) @ error/import.c/ImportImageCommand/1282.
./manage.py: line 3: filepath: command not found
./manage.py: line 5: syntax error near unexpected token `('
./manage.py: line 5: `def f1():'

Test 2

 razvansky@RaziMac  ~/myProjects/vlc_play   razVLCMac  python manage.py     ✔  9297  3.7.7 (vlc_play) Py
[00007fe49e8b9530] videotoolbox decoder: Using Video Toolbox to decode 'h264'
[00007fe49e8b9530] videotoolbox decoder: vt cvpx chroma: 420v
[00007fe49e8d92e0] macosx vout display error: No drawable-nsobject nor vout_window_t found, passing over.
[00007fe49dbdaaf0] main video output error: video output creation failed
[00007fe49e8b9530] main decoder error: failed to create video output
[00007fe49e8b9530] videotoolbox decoder error: decoder failure, Abort.
[00007fe49cc83e90] macosx vout display error: No drawable-nsobject nor vout_window_t found, passing over.
[00007fe49dbdfaf0] main video output error: video output creation failed
[00007fe49e8b9530] main decoder error: failed to create video output
[h264 @ 0x7fe49d044a00] get_buffer() failed
[h264 @ 0x7fe49d044a00] thread_get_buffer() failed
[h264 @ 0x7fe49d044a00] decode_slice_header error
[h264 @ 0x7fe49d044a00] no frame!

and repeats forever.

ionescu77 commented 4 years ago

https://github.com/oaubert/python-vlc/issues/91

python vlc.py --version
/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/Resources/Python.app/Contents/MacOS/Python: can't open file 'vlc.py': [Errno 2] No such file or directory

So do it like this because it is here:

find . -name vlc.py
./lib/python3.7/site-packages/vlc.py

python -m vlc --version
vlc.py: 3.0.9113 (Wed Apr 29 13:13:52 2020 3.0.9)
LibVLC version: 3.0.8 Vetinari (0x3000800)
LibVLC compiler: clang: warning: argument unused during compilation: '-mmacosx-version-min=10.7' [-Wunused-command-line-argument]
Plugin path: /Applications/VLC.app/Contents/MacOS/plugins
Python: 3.7.7 (64bit) macOS 10.15.5
ionescu77 commented 4 years ago

La ei este un proiect demo pt python bindings care imi porneste o fereastra VLC player goala, cand apas play ma intreaba ce fisier sa aleg (file select OS window).

In python-vlc repo este un director examples si acolo tkvlc.py https://raw.githubusercontent.com/oaubert/python-vlc/master/examples/tkvlc.py

Interesanta partea asta:

# import external libraries
import vlc
# import standard libraries
import sys
if sys.version_info[0] < 3:
    import Tkinter as Tk
    from Tkinter import ttk
    from Tkinter.filedialog import askopenfilename
    from Tkinter.tkMessageBox import showerror
else:
    import tkinter as Tk
    from tkinter import ttk
    from tkinter.filedialog import askopenfilename
    from tkinter.messagebox import showerror
from os.path import basename, expanduser, isfile, join as joined
from pathlib import Path
import time

_isMacOS   = sys.platform.startswith('darwin')
_isWindows = sys.platform.startswith('win')
_isLinux   = sys.platform.startswith('linux')
ionescu77 commented 4 years ago

Am mai incercat o adaptare ca aici.

But it does not work.

def f4():
    vlc_options = "--no-audio -f"
    vlc_instance = vlc.Instance(vlc_options)
    # vlc.Instance.url = filepath

    found = False
    # Test if url is a local file or remote
    if url[:4] == 'file':
        if os.path.isfile(url[7:]):
            found = True
        else:
            print ('Error: File ', url[7:], ' Not found')
            continue
    else:
        try:
            r = requests.get(url, stream=True)
            found = r.ok
        except ConnectionError as e:
            print('failed to get stream: {e}'.format(e=e))
            continue
    if found:

        player = vlc_instance.media_player_new()
        Media = vlc_instance.media_new(url)
        Media.get_mrl()
        player.set_media(Media)
        if player.play() == -1:
            print ("\nError playing Stream")

def run():
    f4()

run()

Si a trebuit sa scot continue, da nu am folosit niciodata chestia asta in python

python manage.py
  File "manage.py", line 57
    continue
    ^
SyntaxError: 'continue' not properly in loop

dupa aia nimic no error nada:

python manage.py
AlexInntekt commented 4 years ago

Componetele de python le-am scos din uz din proiect. Vor fi sterse curand. O sa pregatesc un readme ceva cu instructiuni cu rularea din bash.

ionescu77 commented 4 years ago

Merci Alex

Tu ești și membru și admin la meetmetrics pe github. Ai încercat să creezi repo?

Ms

On 23. Jun 2020, at 21:57, Manolescu Mihai Alexandru notifications@github.com wrote:

 Componetele de python le-am scos din uz din proiect. Vor fi sterse curand. O sa pregatesc un readme ceva cu instructiuni cu rularea din bash.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.