Comments (11)
I didn't get a chance to test on Linux, so the default option is missing in the current version. However, you can pass your own string if you familiar with ffmpeg
via the command line, for example, on Windows you can use
dlna-cast screen --dlna_device BF913C44 --input_opts '-f dshow -i video="screen-capture-recorder":audio="virtual-audio-capturer"'
According to ChatGPT, possible options are:
-f x11grab -i :0.0 -f pulse -ac 2 -i default
-f x11grab -i :0.0 -f alsa -ac 2 -i hw:0,0
You may use arecord -l
to check available devices.
from dlna-cast.
Hello again link89, thanks for your prompt response, the part of the code that generates the empty string error, I think it expects the name of the ffmpeg executable,; I have tried to pass it with:
export FFMPEG_BIN=/usr/bin/ffmpeg and nothing has changed, perhaps due to the difference in the naming between Windows \ / Linux and the slash / and the backslash \ ... And again my thanks in advance.
I'm going to try his suggestions and let him know when I get back from work...
from dlna-cast.
Greetings link89, thanks for your quick response, I tried before going to work:
dlna-cast screen --dlna_device BF913C44 --input_opts '-f x11grab -i :0.0 -f alsa -ac 2 -i hw:0,0'
And this is the result:
HTTP: start to serve at port 35859
Traceback (most recent call last):
File "/home/tugo/.local/bin/dlna-cast", line 8, in
sys.exit(main())
^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 180, in main
Fire(LinuxCast)
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 466, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 112, in screen
self._start_ffmpeg_streaming(framerate, input_opts, segment_size, crf)
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 82, in _start_ffmpeg_streaming
cmd = ' '.join(cmd)
^^^^^^^^^^^^^
TypeError: sequence item 3: expected str instance, bool found
At least now the string is still not found, but there is a boolean ...
from dlna-cast.
It looks like fire
fail to parse the args correctly. Please try this way (add =
)
dlna-cast screen --dlna_device BF913C44 --input_opts='-f x11grab -i :0.0 -f alsa -ac 2 -i hw:0,0'
from dlna-cast.
Sorry but I made a mistake when copying your suggestion, the command without single quotes:
dlna-cast screen --dlna_device BF913C44 --input_opts -f x11grab -i :0.0 -f alsa -ac 2 -i hw:0.0
Returns:
HTTP: start to serve at port 33707
run command: /usr/bin/ffmpeg -framerate alsa hw:0,0 -c:v libx264 -preset fast -tune zerolatency -crf 21 -vf format=yuv420p -keyint_min:v 1 -force_key_frames:v "expr:gte( t,n_forced*2)" -f hls -hls_time 2 -hls_list_size 10 -hls_flags delete_segments /home/tugo/dlna-cast/index.m3u8
Traceback (most recent call last):
File "/home/tugo/.local/bin/dlna-cast", line 8, in
sys.exit(main())
^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 180, in main
Fire(LinuxCast)
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 466, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
component = fn(varargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 112, in screen
self._start_ffmpeg_streaming(framerate, input_opts, segment_size, crf)
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 84, in _start_ffmpeg_streaming
self._ffmpeg_process = sp.Popen(cmd)
^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.12/subprocess.py", line 1950, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/ffmpeg -framerate alsa hw:0,0 -c:v libx264 -preset fast -tune zerolatency -crf 21 -vf format=yuv420p -keyint_min:v 1 -force_key_frames:v "expr:gte(t,n_forced2)" -f hls -hls_time 2 -hls_list_size 10 -hls_flags delete_segments /home/tugo/dlna-cast/index.m3u8'
And effectively monitoring in /home/tugo/dlna-cast/
the file index.m3u8 does not exist...
from dlna-cast.
Trying with the command:
dlna-cast screen --dlna_device BF913C44 --input_opts='-f x11grab -i :0.0 -f alsa -ac 2 -i hw:0,0'
Result:
dlna-cast screen --dlna_device BF913C44 --input_opts='-f x11grab -i :0.0 -f alsa -ac 2 -i hw:0,0'
HTTP: start to serve at port 38979
run command: /usr/bin/ffmpeg -framerate 30 -f x11grab -i :0.0 -f alsa -ac 2 -i hw:0,0 -c:v libx264 -preset fast -tune zerolatency -crf 21 -vf format= yuv420p -keyint_min:v 1 -force_key_frames:v "expr:gte(t,n_forced*2)" -f hls -hls_time 2 -hls_list_size 10 -hls_flags delete_segments /home/tugo/dlna-cast/index.m3u8
Traceback (most recent call last):
File "/home/tugo/.local/bin/dlna-cast", line 8, in
sys.exit(main())
^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 180, in main
Fire(LinuxCast)
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 466, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
component = fn(varargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 112, in screen
self._start_ffmpeg_streaming(framerate, input_opts, segment_size, crf)
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 84, in _start_ffmpeg_streaming
self._ffmpeg_process = sp.Popen(cmd)
^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.12/subprocess.py", line 1950, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
OSError: [Errno 36] File name too long: '/usr/bin/ffmpeg -framerate 30 -f x11grab -i :0.0 -f alsa -ac 2 -i hw:0,0 -c:v libx264 -preset fast - tune zerolatency -crf 21 -vf format=yuv420p -keyint_min:v 1 -force_key_frames:v "expr:gte(t,n_forced2)" -f hls -hls_time 2 -hls_list_size 10 -hls_flags delete_segments /home/tugo/dlna- cast/index.m3u8'
from dlna-cast.
And finally, from the same command above, but without the single quotes:
dlna-cast screen --dlna_device BF913C44 --input_opts=-f x11grab -i :0.0 -f alsa -ac 2 -i hw:0.0
Result:
HTTP: start to serve at port 43937
run command: /usr/bin/ffmpeg -framerate alsa hw:0,0 -c:v libx264 -preset fast -tune zerolatency -crf 21 -vf format=yuv420p -keyint_min:v 1 -force_key_frames:v "expr:gte( t,n_forced*x11grab)" -f hls -hls_time x11grab -hls_list_size 10 -hls_flags delete_segments /home/tugo/dlna-cast/index.m3u8
Traceback (most recent call last):
File "/home/tugo/.local/bin/dlna-cast", line 8, in
sys.exit(main())
^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 180, in main
Fire(LinuxCast)
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 141, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 466, in _Fire
component, remaining_args = _CallAndUpdateTrace(
^^^^^^^^^^^^^^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/fire/core.py", line 681, in _CallAndUpdateTrace
component = fn(varargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 112, in screen
self._start_ffmpeg_streaming(framerate, input_opts, segment_size, crf)
File "/home/tugo/.local/pipx/venvs/dlna-cast/lib/python3.12/site-packages/dlna_cast/main.py", line 84, in _start_ffmpeg_streaming
self._ffmpeg_process = sp.Popen(cmd)
^^^^^^^^^^^^^
File "/usr/lib/python3.12/subprocess.py", line 1026, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.12/subprocess.py", line 1950, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/usr/bin/ffmpeg -framerate alsa hw:0,0 -c:v libx264 -preset fast -tune zerolatency -crf 21 -vf format=yuv420p -keyint_min:v 1 -force_key_frames:v "expr:gte(t,n_forcedx11grab)" -f hls -hls_time x11grab -hls_list_size 10 -hls_flags delete_segments /home/tugo/dlna-cast/index.m3u8'
from dlna-cast.
I am very interested in having this work on linux as well. Unfortunately, I cannot help you with the coding, but if you need a tester, hit me up.
from dlna-cast.
Hello link89, I am not a Python programmer, but if you tell me what to do, to debug your program, I will be happy to undertake the task.
I tell you, I ran your program a while ago, in a super user or root session and the result is the same, the index.m3u8 file is not generated.
I am also very interested in your program running on Linux.
Well, waiting for your response, I greet you sincerely...
from dlna-cast.
I just release a new version 0.1.6 to provide default input options for Linux without audio. I have test this on a Ubuntu 22.04. You may try this new version with pip install -U dlna-cast
and see if it works for you.
from dlna-cast.
Greetings @link89 and I can confirm that the program now works, on Void Linux i686 32 bits.
Thank you so much !!!
from dlna-cast.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dlna-cast.