Popular New Releases in Media Player
Radarr
4.1.0.6175
AV_Data_Capture
4.7.2
ampache
5.3.1
javsdt
V1.1.5 21年2月7日
javsdt
V1.1.5 20年2月7日
Popular Libraries in Media Player
by daniulive java
9647
业内为数不多致力于极致体验的超强全自研跨平台(windows/android/iOS)流媒体内核,通过模块化自由组合,支持实时RTMP推流、RTSP推流、RTMP播放器、RTSP播放器、录像、多路流媒体转发、音视频导播、动态视频合成、音频混音、直播互动、内置轻量级RTSP服务等,比快更快,业界真正靠谱的超低延迟直播SDK(1秒内,低延迟模式下200~400ms)。
by Radarr csharp
6161 GPL-3.0
A fork of Sonarr to work with movies à la Couchpotato.
by anyrtcIO-Community c++
3772 GPL-3.0
RTMP 推流器,RTMP(HLS)秒开播放器,跨平台(Win,IOS,Android)开源代码
by yoshiko2 python
3122 GPL-3.0
本地电影刮削与整理一体化解决方案
by ampache php
3028 AGPL-3.0
A web based audio/video streaming application and file manager allowing you to access your music & videos from anywhere, using almost any internet enabled device.
by taxigps python
2762 GPL-2.0
Addon scripts, plugins, and skins for XBMC Media Center. Special for chinese laguage.
by JustMachiavelli python
2725 MIT
影片信息整理工具,抓取元数据nfo,自定义重命名文件(夹),下载fanart裁剪poster,为emby、kodi、极影派铺路。
by mbebenita c
2433 NOASSERTION
A JavaScript H.264 decoder.
by javsdt python
2399 MIT
影片信息整理工具,抓取元数据nfo,自定义重命名文件(夹),下载fanart裁剪poster,为emby、kodi、极影派铺路。
Trending New libraries in Media Player
by maykbrito typescript
1019 MIT
📹 A small webcam player focused on providing an easy way to add and control your webcam during recordings.
by woopen typescript
767 MIT
🚀 支持移动端、支持 SSR、支持直播,可以接入任何流媒体。高性能的弹幕系统。高度可定制,所有图标、主题色等都可以替换,并且提供了内置组件方便二次开发。无第三方运行时依赖。
by jellyfin python
680 NOASSERTION
MPV Cast Client for Jellyfin
by jellyfin python
580 NOASSERTION
MPV-based desktop and cast client for Jellyfin
by Free-TV python
478
M3U Playlist for free TV channels
by iwalton3 python
474 NOASSERTION
MPV-based desktop and cast client for Jellyfin (Unofficial)
by zhengfan2014 python
278 MIT
个人开发的xbmc/kodi 插件 欢迎各位大神提意见。
by smplayer-dev c++
189 NOASSERTION
Free Media Player for Windows, Linux and Mac OS with YouTube support.
by darktohka csharp
187 MIT
FlashPatch! Play Adobe Flash Player games in the browser after January 12th, 2021.
Top Authors in Media Player
1
25 Libraries
1076
2
12 Libraries
301
3
5 Libraries
381
4
5 Libraries
18
5
4 Libraries
509
6
4 Libraries
21
7
4 Libraries
44
8
4 Libraries
242
9
4 Libraries
456
10
4 Libraries
271
1
25 Libraries
1076
2
12 Libraries
301
3
5 Libraries
381
4
5 Libraries
18
5
4 Libraries
509
6
4 Libraries
21
7
4 Libraries
44
8
4 Libraries
242
9
4 Libraries
456
10
4 Libraries
271
Trending Kits in Media Player
Python is a high-level programming language. It is easy to learn and use, and it is one of the most popular programming languages. Python Media Player libraries are the open source libraries that provide with the facilities to develop applications that deal with multimedia. These libraries are written in Python and they allow to play video and audio files, they help to manipulate images, extract information from images and videos, create new media formats and many other things. Python is a popular programming language for media players. It is used by a number of open source media player projects, such as VLC and MPV. Popular Python Media Player open source libraries include: python-mpv - Python interface to the awesome mpv media player; gmusicproxy - Google Play Music Proxy "Let's stream Google Play Music using; python-omxplayer-wrapper - Control OMXPlayer, the Raspberry Pi media player.
Ruby Media Player is a gem that provides an API to play audio and video files in Ruby. The library also supports streaming media content from various sources like YouTube, SoundCloud and Vimeo. Ruby Media Player is a free, open source software that allows to create, play videos and audios. Ruby Media Player can be used by developers as well as non-developers. It is an excellent choice if you want to integrate video support in the web applications. It has a simple API and can be used in many applications from simple audio players to complex music processing software. These libraries provide functionality that is useful for creating applications, such as an interface for viewing images or playing audio files. They may also include more advanced features like cryptography and data compression. Some of the most popular Ruby Media Player Open Source libraries among developers are: jekyll-spaceship - Jekyll plugin to provide powerful supports; seed - a Common Sense CMS from The Media Collective; voctoweb - voctoweb – the frontend and backend software behind media.
JavaScript is a programming language which is used to create web pages and applications. It has become an essential part of the internet and web development. JavaScript media player libraries are the best way to create media player or video player in the website. With these libraries, you can easily add video or audio to the website and control it with simple codes. Media Player is a must have for any web application or website. It allows users to play audio and video files without having to download them. JavaScript Media Player is a very popular and widely used open source library. It is a powerful media player built entirely in JavaScript that can be easily integrated into any website or web application. They can be used in many different ways, from displaying images to displaying videos and audio files. They are also useful for playing back audio clips in games or other interactive applications. There are several popular JavaScript Media Player open source libraries available for developers: popcorn-desktop - Popcorn Time is a multiplatform, free software BitTorrent client; jwplayer - JW Player is the world's most popular embeddable media player; mini-media-player - Minimalistic media card for Home Assistant Lovelace UI.
C# is a multi-paradigm programming language encompassing strong typing, imperative, declarative, functional, generic, object-oriented (class-based), and component-oriented programming disciplines that was developed by Microsoft. C# is one of the most popular programming languages used for developing software applications. C# Media Player is a library that can be used to play media files such as audio, video and images. C# Media Player Open Source libraries are the best for C# developers to use in their projects. It is a cross-platform library that can be used on Windows Phone, Windows Store, Windows 8 and Xbox One. C# is a great language for creating media players. Its strong typing and object-oriented nature make it easy to create a media player that can be customized to your needs. Some of the most widely used open source libraries for C# Media Player among developers include: mpv.net - mpv.net is a modern media player; Rise-Media-Player - One media player for everything you own or stream; whether it's music or videos, online or offline R; BreadPlayer - Bread Player, a free and open source music player powered.
PHP Media Player is a library that allows to create your own custom media player. It's available on Github and has a MIT license, so it can be used for free by anyone. It is cross-platform and runs on Windows, Linux, OS X, Android and iOS. PHP Media Player is an open source media player library written in PHP. It can be used to create a custom video and audio player for the website, or as a starting point for a new project. PHP Media Player library is an easy-to-use and lightweight media player for websites and mobile apps. It has many features like playing video and audio files, supporting all common video formats, support for sub-titles, supports playlist and much more. Developers tend to use some of the following PHP Media Player open source libraries are: PHP-FFmpeg-video-streaming - Package media content for online streaming using FFmpeg; xbmc-video-server - Web interface for streaming or downloading media; media-embed - PHP library to deal with all those media services around.
Go Media Player is an open source media player built with the Go programming language. Go Media Player is a free media player for all platforms, Mac OS X, Windows and Linux. It is designed to play any media format, including FLV, MKV and MP4 videos. Go Mediaplayer supports playback for most popular video formats, including VP9 and H265/HEVC. It has also support for WebVTT subtitles, which can be embedded in a file or loaded from an external file using HTTP. Go Media Player is a media player written in Google's Go language. It uses the HTML5 Video tag, so it's compatible with all modern browsers, including Safari and Internet Explorer 9+. Popular Go Media Player open source libraries for developers include: exatorrent - Easy to Use Torrent Client Can be hosted in Cloud Files can be streamed in Browser/Media Player; libvlc-go - Go bindings for libVLC and highlevel media player interface; vlc-portable - VLC Media Player portable for Windows.
C++ Media Player Open Source libraries are free and open source software libraries that developers can use to build media player applications. A library is a collection of related software components that can be used together to develop software applications. C++ Media Player libraries are used to create media players in C and C++ languages. The libraries provide various functions such as player control, playlist management and streaming services integration. C++ Media Player Open Source libraries are open-source projects that provides a user interface to control the playback of audio and video files. These libraries are used in the development of applications that use audio and video files. A few of the most popular C++ Media Player open source libraries for developers are: musikcube - a crossplatform, terminalbased music player, audio engine, metadata indexer, and server in c; shaka-player-embedded - Shaka Player in a C++ Framework; kaffeine - Media player with support for digital television.
Trending Discussions on Media Player
Python VLC Instance Fullscreen not working
Is it possible to trace my shell(bash, fish, zsh)?
Sveltejs/SvelteKit with Vimejs showing an error
Godot: Rename application name used by file explorer in "open with" menu
Error in python script using python-vlc and pafy
Read only reference variable in a lambda expression
How to open animated plots (gif/mp4) in RStudio?
VLC silent install over Powershell
Get Video Width and Height from Azure Media Player
cvlc cannot play rtsp (omxplayer instead can)
QUESTION
Python VLC Instance Fullscreen not working
Asked 2022-Mar-29 at 17:51I'm a bit new to Python and I'm developping an application for a Raspberry Pi where a motion sensor is connected. The idea is to place this Raspberry in a room and on motion detection a video starts playing fullscreen. After the video is done playing I want to let the device sleep for 10 minutes and than activate the motion sensor again to play the same video again. The screen also should stay black after the video so not quiting the vlc application and see the Raspberry Pi Desktop.
So far I tried some code where in one file the fullscreen works, and in the other file the loop works, but bringing the 2 files togheter is giving errors.
As I said I'm very new to coding so it could be the problem is very stupid and the solution very simple. Thanks in advance for the help. Down below my 2 code-files.
Option 1 (fullscreen not working)
1from gpiozero import MotionSensor, LED
2from time import sleep
3import vlc
4
5
6# creating Instance class object
7player = vlc.Instance()
8
9# creating a new media list
10media_list = player.media_list_new()
11
12# creating a media player object
13media_player = player.media_list_player_new()
14
15# creating a new media
16media = player.media_new("/home/pi/MOSA25.mp4")
17
18# adding media to media list
19media_list.add_media(media)
20
21# setting media list to the mediaplayer
22media_player.set_media_list(media_list)
23
24# setting loop
25player.vlm_set_loop("1", True)
26
27#fullscreen
28#media_player.set_fullscreen(True)
29
30#Motion Sensor
31pir = MotionSensor(4)
32
33#Led
34led = LED(26)
35
36
37led.off()
38print("Sensor loading.")
39pir.wait_for_no_motion()
40sleep(5)
41
42while True:
43
44 print("Ready")
45 pir.wait_for_motion()
46 print("Motion detected")
47 led.on()
48 sleep(5)
49 led.off()
50 media_player.play()
51 sleep(30)
52
OPTION 2 (Loop not working)
1from gpiozero import MotionSensor, LED
2from time import sleep
3import vlc
4
5
6# creating Instance class object
7player = vlc.Instance()
8
9# creating a new media list
10media_list = player.media_list_new()
11
12# creating a media player object
13media_player = player.media_list_player_new()
14
15# creating a new media
16media = player.media_new("/home/pi/MOSA25.mp4")
17
18# adding media to media list
19media_list.add_media(media)
20
21# setting media list to the mediaplayer
22media_player.set_media_list(media_list)
23
24# setting loop
25player.vlm_set_loop("1", True)
26
27#fullscreen
28#media_player.set_fullscreen(True)
29
30#Motion Sensor
31pir = MotionSensor(4)
32
33#Led
34led = LED(26)
35
36
37led.off()
38print("Sensor loading.")
39pir.wait_for_no_motion()
40sleep(5)
41
42while True:
43
44 print("Ready")
45 pir.wait_for_motion()
46 print("Motion detected")
47 led.on()
48 sleep(5)
49 led.off()
50 media_player.play()
51 sleep(30)
52from gpiozero import MotionSensor, LED
53from time import sleep
54import vlc
55
56
57# creating Instance class object
58vlc_instance = vlc.Instance()
59
60player = vlc_instance.media_player_new()
61
62player.set_mrl("/home/pi/MOSA25.mp4")
63
64player.set_fullscreen(True)
65
66# setting loop
67#player.vlm_set_loop("1", True)
68
69
70#Motion Sensor
71pir = MotionSensor(4)
72
73#Led
74led = LED(26)
75
76
77led.off()
78print("Sensor wordt geladen.")
79pir.wait_for_no_motion()
80sleep(5)
81
82while True:
83
84 print("Ready")
85 pir.wait_for_motion()
86 print("Motion detected")
87 led.on()
88 sleep(5)
89 led.off()
90 player.play()
91 sleep(20)
92
ANSWER
Answered 2022-Mar-29 at 17:51Keep track of the video playing in another while
loop and reload before starting again.
Here's your code (adjusted as I don't have your kit)
1from gpiozero import MotionSensor, LED
2from time import sleep
3import vlc
4
5
6# creating Instance class object
7player = vlc.Instance()
8
9# creating a new media list
10media_list = player.media_list_new()
11
12# creating a media player object
13media_player = player.media_list_player_new()
14
15# creating a new media
16media = player.media_new("/home/pi/MOSA25.mp4")
17
18# adding media to media list
19media_list.add_media(media)
20
21# setting media list to the mediaplayer
22media_player.set_media_list(media_list)
23
24# setting loop
25player.vlm_set_loop("1", True)
26
27#fullscreen
28#media_player.set_fullscreen(True)
29
30#Motion Sensor
31pir = MotionSensor(4)
32
33#Led
34led = LED(26)
35
36
37led.off()
38print("Sensor loading.")
39pir.wait_for_no_motion()
40sleep(5)
41
42while True:
43
44 print("Ready")
45 pir.wait_for_motion()
46 print("Motion detected")
47 led.on()
48 sleep(5)
49 led.off()
50 media_player.play()
51 sleep(30)
52from gpiozero import MotionSensor, LED
53from time import sleep
54import vlc
55
56
57# creating Instance class object
58vlc_instance = vlc.Instance()
59
60player = vlc_instance.media_player_new()
61
62player.set_mrl("/home/pi/MOSA25.mp4")
63
64player.set_fullscreen(True)
65
66# setting loop
67#player.vlm_set_loop("1", True)
68
69
70#Motion Sensor
71pir = MotionSensor(4)
72
73#Led
74led = LED(26)
75
76
77led.off()
78print("Sensor wordt geladen.")
79pir.wait_for_no_motion()
80sleep(5)
81
82while True:
83
84 print("Ready")
85 pir.wait_for_motion()
86 print("Motion detected")
87 led.on()
88 sleep(5)
89 led.off()
90 player.play()
91 sleep(20)
92from time import sleep
93import vlc
94playing = set([1,2,3,4])
95
96# creating Instance class object
97vlc_instance = vlc.Instance()
98
99player = vlc_instance.media_player_new()
100player.set_fullscreen(True)
101
102#Motion Sensor
103#pir = MotionSensor(4)
104#Led
105#led = LED(26)
106#led.off()
107print("Sensor wordt geladen.")
108#pir.wait_for_no_motion()
109sleep(5)
110
111while True:
112 print("Ready")
113 # pir.wait_for_motion()
114 sleep(1)
115 print("Motion detected")
116 # led.on()
117 sleep(1)
118 # led.off()
119 player.set_mrl("/home/pi/MOSA25.mp4")
120 player.play()
121 sleep(1)
122 while player.get_state() in playing:
123 sleep(1)
124 continue
125 print("Finished")
126 sleep(5)
127 continue
128
QUESTION
Is it possible to trace my shell(bash, fish, zsh)?
Asked 2022-Mar-01 at 22:44I am running archlinux(arcolinux distro to be specific) everything is fine but one little tiny problem which annoys me the problem is every time i open a terminal this pops us at the top of the terminal
"Linux pengu 5.15.25-1-lts x86_64 unknown"
I know this is a uname command with custom flags however I don't have that in my config.fish(I use fish shell(I run fish with bash i), I am aware that every time I open a my fish shell the stuff in my config.fish run, is there anything I am missing or what? here is my config.fish:
{
1fish_vi_key_bindings
2set VIRTUAL_ENV_DISABLE_PROMPT "1"
3set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
4## Export variable need for qt-theme
5if type "qtile" >> /dev/null 2>&1
6 set -x QT_QPA_PLATFORMTHEME "qt5ct"
7end
8
9# Set settings for https://github.com/franciscolourenco/done
10set -U __done_min_cmd_duration 10000
11set -U __done_notification_urgency_level low
12
13
14## Environment setup
15# Apply .profile: use this to put fish compatible .profile stuff in
16if test -f ~/.fish_profile
17 source ~/.fish_profile
18end
19
20# Add ~/.local/bin to PATH
21if test -d ~/.local/bin
22 if not contains -- ~/.local/bin $PATH
23 set -p PATH ~/.local/bin
24 end
25end
26
27# Add depot_tools to PATH
28if test -d ~/Applications/depot_tools
29 if not contains -- ~/Applications/depot_tools $PATH
30 set -p PATH ~/Applications/depot_tools
31 end
32end
33
34set -p PATH ~/.scripts
35set -p PATH /home/omar/eclipse/java-2021-12/eclipse
36set -p PATH ~/bin
37
38
39
40## Starship prompt
41if status --is-interactive
42 source ("/usr/bin/starship" init fish --print-full-init | psub)
43end
44
45## Advanced command-not-found hook
46#source /usr/share/doc/find-the-command/ftc.fish
47
48## Functions
49# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
50function __history_previous_command
51 switch (commandline -t)
52 case "!"
53 commandline -t $history[1]; commandline -f repaint
54 case "*"
55 commandline -i !
56 end
57end
58
59function __history_previous_command_arguments
60 switch (commandline -t)
61 case "!"
62 commandline -t ""
63 commandline -f history-token-search-backward
64 case "*"
65 commandline -i '$'
66 end
67end
68
69if [ "$fish_key_bindings" = fish_vi_key_bindings ];
70 bind -Minsert ! __history_previous_command
71 bind -Minsert '$' __history_previous_command_arguments
72else
73 bind ! __history_previous_command
74 bind '$' __history_previous_command_arguments
75end
76
77# Fish command history
78function history
79 builtin history --show-time='%F %T '
80end
81
82function backup --argument filename
83 cp $filename $filename.bak
84end
85
86# Copy DIR1 DIR2
87function copy
88 set count (count $argv | tr -d \n)
89 if test "$count" = 2; and test -d "$argv[1]"
90 set from (echo $argv[1] | trim-right /)
91 set to (echo $argv[2])
92 command cp -r $from $to
93 else
94 command cp $argv
95 end
96end
97
98## Useful aliases
99#Aliases to setbrightness
100alias setbright1='xrandr --output HDMI-0 --brightness 1.00' #Sets the brightness to 1.00
101alias setbright75='xrandr --output HDMI-0 --brightness 0.75' #Sets the brightness to 0.75
102alias setbright50='xrandr --output HDMI-0 --brightness 0.50' #Sets the brightness to 0.50
103alias setbright40='xrandr --output HDMI-0 --brightness 0.40' #Sets the brightness to 0.40
104alias setbright30='xrandr --output HDMI-0 --brightness 0.30' #Sets the brightness to 0.30
105
106# Replace ls with exa
107alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing
108alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs
109alias ll='exa -l --color=always --group-directories-first --icons' # long format
110alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing
111alias l.="exa -a | egrep '^\.'" # show only dotfiles
112
113# Aliases for quickly accessing config files(fish, bash, alacritty,etc..)
114alias cf='vim ~/.config/fish/config.fish' # for quickly accessing fish config file
115alias cb='vim .bashrc' # for quickly accessing bash config file
116alias ca='vim ~/.config/alacritty/alacritty.yml' # for quickly acssesing alacritty config file
117alias ck='vim ~/.config/kitty/kitty.conf'
118alias cw='vim ~/.config/awesome/rc.lua'
119
120# Replace some more things with better alternatives
121alias cat='bat --style header --style rules --style snip --style changes --style header'
122[ ! -x /usr/bin/yay ] && [ -x /usr/bin/paru ] && alias yay='paru'
123
124#Media player utilities
125alias pause='playerctl -p spotify pause'
126alias play='playerctl -p spotify play'
127# Common use
128alias book='/home/omar/.scripts/books.sh'
129alias poweroff='systemctl poweroff'
130alias reboot='systemctl reboot'
131alias grubup="sudo update-grub"
132alias fixpacman="sudo rm /var/lib/pacman/db.lck"
133alias tarnow='tar -acf '
134alias untar='tar -zxvf '
135alias wget='wget -c '
136alias rmpkg="sudo pacman -Rdd"
137alias psmem='ps auxf | sort -nr -k 4'
138alias psmem10='ps auxf | sort -nr -k 4 | head -10'
139alias upd='/usr/bin/update'
140alias ..='cd ..'
141alias ...='cd ../..'
142alias ....='cd ../../..'
143alias .....='cd ../../../..'
144alias ......='cd ../../../../..'
145alias dir='dir --color=auto'
146alias vdir='vdir --color=auto'
147alias grep='grep --color=auto'
148alias fgrep='fgrep --color=auto'
149alias egrep='egrep --color=auto'
150alias hw='hwinfo --short' # Hardware Info
151alias big="expac -H M '%m\t%n' | sort -h | nl" # Sort installed packages according to size in MB
152alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages
153
154# Get fastest mirrors
155alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
156alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
157alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
158alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
159
160# Help people new to Arch
161alias apt='man pacman'
162alias apt-get='man pacman'
163alias please='sudo'
164alias tb='nc termbin.com 9999'
165
166# Cleanup orphaned packages
167alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
168
169# Get the error messages from journalctl
170alias jctl="journalctl -p 3 -xb"
171
172# Recent installed packages
173alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
174
175#Cool terminal stuff(pipes, convo, etc...)
176alias pipes='cd pipes.sh;./pipes.sh';cd
177
178## Run paleofetch if session is interactive
179#if status --is-interactive
180 #colorscript random
181#end
182
I tried to debug the problem by calling something like strace on my fish shell but it just restarts my fish shell, I also wrote a little script where i made a while loop and excuted this command: ps -ax | grep uname; sleep 0.1 which should give me any instanced of the uname command and kept running my fish shell over and over but there was no uname instances I am really puzzled with this
ANSWER
Answered 2022-Mar-01 at 19:17strace
can attach to a process using -p
:
1fish_vi_key_bindings
2set VIRTUAL_ENV_DISABLE_PROMPT "1"
3set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
4## Export variable need for qt-theme
5if type "qtile" >> /dev/null 2>&1
6 set -x QT_QPA_PLATFORMTHEME "qt5ct"
7end
8
9# Set settings for https://github.com/franciscolourenco/done
10set -U __done_min_cmd_duration 10000
11set -U __done_notification_urgency_level low
12
13
14## Environment setup
15# Apply .profile: use this to put fish compatible .profile stuff in
16if test -f ~/.fish_profile
17 source ~/.fish_profile
18end
19
20# Add ~/.local/bin to PATH
21if test -d ~/.local/bin
22 if not contains -- ~/.local/bin $PATH
23 set -p PATH ~/.local/bin
24 end
25end
26
27# Add depot_tools to PATH
28if test -d ~/Applications/depot_tools
29 if not contains -- ~/Applications/depot_tools $PATH
30 set -p PATH ~/Applications/depot_tools
31 end
32end
33
34set -p PATH ~/.scripts
35set -p PATH /home/omar/eclipse/java-2021-12/eclipse
36set -p PATH ~/bin
37
38
39
40## Starship prompt
41if status --is-interactive
42 source ("/usr/bin/starship" init fish --print-full-init | psub)
43end
44
45## Advanced command-not-found hook
46#source /usr/share/doc/find-the-command/ftc.fish
47
48## Functions
49# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
50function __history_previous_command
51 switch (commandline -t)
52 case "!"
53 commandline -t $history[1]; commandline -f repaint
54 case "*"
55 commandline -i !
56 end
57end
58
59function __history_previous_command_arguments
60 switch (commandline -t)
61 case "!"
62 commandline -t ""
63 commandline -f history-token-search-backward
64 case "*"
65 commandline -i '$'
66 end
67end
68
69if [ "$fish_key_bindings" = fish_vi_key_bindings ];
70 bind -Minsert ! __history_previous_command
71 bind -Minsert '$' __history_previous_command_arguments
72else
73 bind ! __history_previous_command
74 bind '$' __history_previous_command_arguments
75end
76
77# Fish command history
78function history
79 builtin history --show-time='%F %T '
80end
81
82function backup --argument filename
83 cp $filename $filename.bak
84end
85
86# Copy DIR1 DIR2
87function copy
88 set count (count $argv | tr -d \n)
89 if test "$count" = 2; and test -d "$argv[1]"
90 set from (echo $argv[1] | trim-right /)
91 set to (echo $argv[2])
92 command cp -r $from $to
93 else
94 command cp $argv
95 end
96end
97
98## Useful aliases
99#Aliases to setbrightness
100alias setbright1='xrandr --output HDMI-0 --brightness 1.00' #Sets the brightness to 1.00
101alias setbright75='xrandr --output HDMI-0 --brightness 0.75' #Sets the brightness to 0.75
102alias setbright50='xrandr --output HDMI-0 --brightness 0.50' #Sets the brightness to 0.50
103alias setbright40='xrandr --output HDMI-0 --brightness 0.40' #Sets the brightness to 0.40
104alias setbright30='xrandr --output HDMI-0 --brightness 0.30' #Sets the brightness to 0.30
105
106# Replace ls with exa
107alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing
108alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs
109alias ll='exa -l --color=always --group-directories-first --icons' # long format
110alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing
111alias l.="exa -a | egrep '^\.'" # show only dotfiles
112
113# Aliases for quickly accessing config files(fish, bash, alacritty,etc..)
114alias cf='vim ~/.config/fish/config.fish' # for quickly accessing fish config file
115alias cb='vim .bashrc' # for quickly accessing bash config file
116alias ca='vim ~/.config/alacritty/alacritty.yml' # for quickly acssesing alacritty config file
117alias ck='vim ~/.config/kitty/kitty.conf'
118alias cw='vim ~/.config/awesome/rc.lua'
119
120# Replace some more things with better alternatives
121alias cat='bat --style header --style rules --style snip --style changes --style header'
122[ ! -x /usr/bin/yay ] && [ -x /usr/bin/paru ] && alias yay='paru'
123
124#Media player utilities
125alias pause='playerctl -p spotify pause'
126alias play='playerctl -p spotify play'
127# Common use
128alias book='/home/omar/.scripts/books.sh'
129alias poweroff='systemctl poweroff'
130alias reboot='systemctl reboot'
131alias grubup="sudo update-grub"
132alias fixpacman="sudo rm /var/lib/pacman/db.lck"
133alias tarnow='tar -acf '
134alias untar='tar -zxvf '
135alias wget='wget -c '
136alias rmpkg="sudo pacman -Rdd"
137alias psmem='ps auxf | sort -nr -k 4'
138alias psmem10='ps auxf | sort -nr -k 4 | head -10'
139alias upd='/usr/bin/update'
140alias ..='cd ..'
141alias ...='cd ../..'
142alias ....='cd ../../..'
143alias .....='cd ../../../..'
144alias ......='cd ../../../../..'
145alias dir='dir --color=auto'
146alias vdir='vdir --color=auto'
147alias grep='grep --color=auto'
148alias fgrep='fgrep --color=auto'
149alias egrep='egrep --color=auto'
150alias hw='hwinfo --short' # Hardware Info
151alias big="expac -H M '%m\t%n' | sort -h | nl" # Sort installed packages according to size in MB
152alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages
153
154# Get fastest mirrors
155alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
156alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
157alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
158alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
159
160# Help people new to Arch
161alias apt='man pacman'
162alias apt-get='man pacman'
163alias please='sudo'
164alias tb='nc termbin.com 9999'
165
166# Cleanup orphaned packages
167alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
168
169# Get the error messages from journalctl
170alias jctl="journalctl -p 3 -xb"
171
172# Recent installed packages
173alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
174
175#Cool terminal stuff(pipes, convo, etc...)
176alias pipes='cd pipes.sh;./pipes.sh';cd
177
178## Run paleofetch if session is interactive
179#if status --is-interactive
180 #colorscript random
181#end
182-p pid trace process with process id PID, may be repeated
183
this way you would be able to attach to your running process.
You may also find useful
1fish_vi_key_bindings
2set VIRTUAL_ENV_DISABLE_PROMPT "1"
3set -x MANPAGER "sh -c 'col -bx | bat -l man -p'"
4## Export variable need for qt-theme
5if type "qtile" >> /dev/null 2>&1
6 set -x QT_QPA_PLATFORMTHEME "qt5ct"
7end
8
9# Set settings for https://github.com/franciscolourenco/done
10set -U __done_min_cmd_duration 10000
11set -U __done_notification_urgency_level low
12
13
14## Environment setup
15# Apply .profile: use this to put fish compatible .profile stuff in
16if test -f ~/.fish_profile
17 source ~/.fish_profile
18end
19
20# Add ~/.local/bin to PATH
21if test -d ~/.local/bin
22 if not contains -- ~/.local/bin $PATH
23 set -p PATH ~/.local/bin
24 end
25end
26
27# Add depot_tools to PATH
28if test -d ~/Applications/depot_tools
29 if not contains -- ~/Applications/depot_tools $PATH
30 set -p PATH ~/Applications/depot_tools
31 end
32end
33
34set -p PATH ~/.scripts
35set -p PATH /home/omar/eclipse/java-2021-12/eclipse
36set -p PATH ~/bin
37
38
39
40## Starship prompt
41if status --is-interactive
42 source ("/usr/bin/starship" init fish --print-full-init | psub)
43end
44
45## Advanced command-not-found hook
46#source /usr/share/doc/find-the-command/ftc.fish
47
48## Functions
49# Functions needed for !! and !$ https://github.com/oh-my-fish/plugin-bang-bang
50function __history_previous_command
51 switch (commandline -t)
52 case "!"
53 commandline -t $history[1]; commandline -f repaint
54 case "*"
55 commandline -i !
56 end
57end
58
59function __history_previous_command_arguments
60 switch (commandline -t)
61 case "!"
62 commandline -t ""
63 commandline -f history-token-search-backward
64 case "*"
65 commandline -i '$'
66 end
67end
68
69if [ "$fish_key_bindings" = fish_vi_key_bindings ];
70 bind -Minsert ! __history_previous_command
71 bind -Minsert '$' __history_previous_command_arguments
72else
73 bind ! __history_previous_command
74 bind '$' __history_previous_command_arguments
75end
76
77# Fish command history
78function history
79 builtin history --show-time='%F %T '
80end
81
82function backup --argument filename
83 cp $filename $filename.bak
84end
85
86# Copy DIR1 DIR2
87function copy
88 set count (count $argv | tr -d \n)
89 if test "$count" = 2; and test -d "$argv[1]"
90 set from (echo $argv[1] | trim-right /)
91 set to (echo $argv[2])
92 command cp -r $from $to
93 else
94 command cp $argv
95 end
96end
97
98## Useful aliases
99#Aliases to setbrightness
100alias setbright1='xrandr --output HDMI-0 --brightness 1.00' #Sets the brightness to 1.00
101alias setbright75='xrandr --output HDMI-0 --brightness 0.75' #Sets the brightness to 0.75
102alias setbright50='xrandr --output HDMI-0 --brightness 0.50' #Sets the brightness to 0.50
103alias setbright40='xrandr --output HDMI-0 --brightness 0.40' #Sets the brightness to 0.40
104alias setbright30='xrandr --output HDMI-0 --brightness 0.30' #Sets the brightness to 0.30
105
106# Replace ls with exa
107alias ls='exa -al --color=always --group-directories-first --icons' # preferred listing
108alias la='exa -a --color=always --group-directories-first --icons' # all files and dirs
109alias ll='exa -l --color=always --group-directories-first --icons' # long format
110alias lt='exa -aT --color=always --group-directories-first --icons' # tree listing
111alias l.="exa -a | egrep '^\.'" # show only dotfiles
112
113# Aliases for quickly accessing config files(fish, bash, alacritty,etc..)
114alias cf='vim ~/.config/fish/config.fish' # for quickly accessing fish config file
115alias cb='vim .bashrc' # for quickly accessing bash config file
116alias ca='vim ~/.config/alacritty/alacritty.yml' # for quickly acssesing alacritty config file
117alias ck='vim ~/.config/kitty/kitty.conf'
118alias cw='vim ~/.config/awesome/rc.lua'
119
120# Replace some more things with better alternatives
121alias cat='bat --style header --style rules --style snip --style changes --style header'
122[ ! -x /usr/bin/yay ] && [ -x /usr/bin/paru ] && alias yay='paru'
123
124#Media player utilities
125alias pause='playerctl -p spotify pause'
126alias play='playerctl -p spotify play'
127# Common use
128alias book='/home/omar/.scripts/books.sh'
129alias poweroff='systemctl poweroff'
130alias reboot='systemctl reboot'
131alias grubup="sudo update-grub"
132alias fixpacman="sudo rm /var/lib/pacman/db.lck"
133alias tarnow='tar -acf '
134alias untar='tar -zxvf '
135alias wget='wget -c '
136alias rmpkg="sudo pacman -Rdd"
137alias psmem='ps auxf | sort -nr -k 4'
138alias psmem10='ps auxf | sort -nr -k 4 | head -10'
139alias upd='/usr/bin/update'
140alias ..='cd ..'
141alias ...='cd ../..'
142alias ....='cd ../../..'
143alias .....='cd ../../../..'
144alias ......='cd ../../../../..'
145alias dir='dir --color=auto'
146alias vdir='vdir --color=auto'
147alias grep='grep --color=auto'
148alias fgrep='fgrep --color=auto'
149alias egrep='egrep --color=auto'
150alias hw='hwinfo --short' # Hardware Info
151alias big="expac -H M '%m\t%n' | sort -h | nl" # Sort installed packages according to size in MB
152alias gitpkg='pacman -Q | grep -i "\-git" | wc -l' # List amount of -git packages
153
154# Get fastest mirrors
155alias mirror="sudo reflector -f 30 -l 30 --number 10 --verbose --save /etc/pacman.d/mirrorlist"
156alias mirrord="sudo reflector --latest 50 --number 20 --sort delay --save /etc/pacman.d/mirrorlist"
157alias mirrors="sudo reflector --latest 50 --number 20 --sort score --save /etc/pacman.d/mirrorlist"
158alias mirrora="sudo reflector --latest 50 --number 20 --sort age --save /etc/pacman.d/mirrorlist"
159
160# Help people new to Arch
161alias apt='man pacman'
162alias apt-get='man pacman'
163alias please='sudo'
164alias tb='nc termbin.com 9999'
165
166# Cleanup orphaned packages
167alias cleanup='sudo pacman -Rns (pacman -Qtdq)'
168
169# Get the error messages from journalctl
170alias jctl="journalctl -p 3 -xb"
171
172# Recent installed packages
173alias rip="expac --timefmt='%Y-%m-%d %T' '%l\t%n %v' | sort | tail -200 | nl"
174
175#Cool terminal stuff(pipes, convo, etc...)
176alias pipes='cd pipes.sh;./pipes.sh';cd
177
178## Run paleofetch if session is interactive
179#if status --is-interactive
180 #colorscript random
181#end
182-p pid trace process with process id PID, may be repeated
183 -f follow forks
184 -ff follow forks with output into separate files
185
if you attach to the parent process.
QUESTION
Sveltejs/SvelteKit with Vimejs showing an error
Asked 2022-Jan-18 at 04:55I was trying to add a video player inside a svelte project. so I choose VimeJS but how much I try, it's giving an error. I am using SvelteKit beta and VimeJs v5 . I am not sure if it's an official bug of VimeJS or not. if the fix is not possible please suggest me a good media player for Svelte
12725| return module[exportName];
22726| }
32727| return import(
4 | ^
52728| /* webpackInclude: /\.entry\.js$/ */
62729| /* webpackExclude: /\.system\.entry\.js$/ */
7The above dynamic import cannot be analyzed by vite.
8See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
9
10 Plugin: vite:import-analysis
11
package.json
12725| return module[exportName];
22726| }
32727| return import(
4 | ^
52728| /* webpackInclude: /\.entry\.js$/ */
62729| /* webpackExclude: /\.system\.entry\.js$/ */
7The above dynamic import cannot be analyzed by vite.
8See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
9
10 Plugin: vite:import-analysis
11{
12 "name": "s8vime",
13 "version": "0.0.1",
14 "scripts": {
15 "dev": "svelte-kit dev",
16 "build": "svelte-kit build",
17 "package": "svelte-kit package",
18 "preview": "svelte-kit preview",
19 "check": "svelte-check --tsconfig ./tsconfig.json",
20 "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
21 "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
22 "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
23 },
24 "devDependencies": {
25 "@sveltejs/adapter-auto": "next",
26 "@sveltejs/kit": "next",
27 "@typescript-eslint/eslint-plugin": "^4.31.1",
28 "@typescript-eslint/parser": "^4.31.1",
29 "autoprefixer": "^10.4.2",
30 "eslint": "^7.32.0",
31 "eslint-config-prettier": "^8.3.0",
32 "eslint-plugin-svelte3": "^3.2.1",
33 "postcss": "^8.4.5",
34 "prettier": "^2.4.1",
35 "prettier-plugin-svelte": "^2.4.0",
36 "svelte": "^3.44.0",
37 "svelte-check": "^2.2.6",
38 "svelte-preprocess": "^4.10.1",
39 "tailwindcss": "^3.0.15",
40 "tslib": "^2.3.1",
41 "typescript": "^4.4.3"
42 },
43 "type": "module",
44 "dependencies": {
45 "@vime/core": "^5.3.1",
46 "@vime/svelte": "^5.3.1",
47 "webpack": "^5.66.0"
48 }
49}
50
51
Player.svelte
12725| return module[exportName];
22726| }
32727| return import(
4 | ^
52728| /* webpackInclude: /\.entry\.js$/ */
62729| /* webpackExclude: /\.system\.entry\.js$/ */
7The above dynamic import cannot be analyzed by vite.
8See https://github.com/rollup/plugins/tree/master/packages/dynamic-import-vars#limitations for supported dynamic import formats. If this is intended to be left as-is, you can use the /* @vite-ignore */ comment inside the import() call to suppress this warning.
9
10 Plugin: vite:import-analysis
11{
12 "name": "s8vime",
13 "version": "0.0.1",
14 "scripts": {
15 "dev": "svelte-kit dev",
16 "build": "svelte-kit build",
17 "package": "svelte-kit package",
18 "preview": "svelte-kit preview",
19 "check": "svelte-check --tsconfig ./tsconfig.json",
20 "check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
21 "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. . && eslint --ignore-path .gitignore .",
22 "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. ."
23 },
24 "devDependencies": {
25 "@sveltejs/adapter-auto": "next",
26 "@sveltejs/kit": "next",
27 "@typescript-eslint/eslint-plugin": "^4.31.1",
28 "@typescript-eslint/parser": "^4.31.1",
29 "autoprefixer": "^10.4.2",
30 "eslint": "^7.32.0",
31 "eslint-config-prettier": "^8.3.0",
32 "eslint-plugin-svelte3": "^3.2.1",
33 "postcss": "^8.4.5",
34 "prettier": "^2.4.1",
35 "prettier-plugin-svelte": "^2.4.0",
36 "svelte": "^3.44.0",
37 "svelte-check": "^2.2.6",
38 "svelte-preprocess": "^4.10.1",
39 "tailwindcss": "^3.0.15",
40 "tslib": "^2.3.1",
41 "typescript": "^4.4.3"
42 },
43 "type": "module",
44 "dependencies": {
45 "@vime/core": "^5.3.1",
46 "@vime/svelte": "^5.3.1",
47 "webpack": "^5.66.0"
48 }
49}
50
51<Player
52 theme="dark"
53 style="--vm-player-theme: #e86c8b;"
54>
55 <Video poster="https://media.vimejs.com/poster.png"
56 >
57 <source
58 data-src="https://media.vimejs.com/720p.mp4"
59 type="video/mp4"
60 />
61 <track
62 default
63 kind="subtitles"
64 src="https://media.vimejs.com/subs/english.vtt"
65 srclang="en"
66 label="English"
67 />
68 </Video>
69
70 <DefaultUi />
71</Player>
72
73<script>
74import { Player, Video, DefaultUi } from '@vime/svelte';
75</script>
76
ANSWER
Answered 2022-Jan-18 at 04:55This is a official bug of Stencil,I Hope it will be fixed soon https://github.com/ionic-team/stencil/issues/3157
QUESTION
Godot: Rename application name used by file explorer in "open with" menu
Asked 2022-Jan-11 at 17:52I'm creating a media player using Godot. The application is already able to play .mp3 files by using the open with option in the file explorer. The name of the project is "Media player" and the executable is called "Media Player.exe" yet when presented in the open with menu it is displayed as "Godot Engine".
So my question: Is it possible to change this? If so, how?
Note: The option is only visible after first opening a .mp3 file by manually navigating to the executable. The .mp3 file is thus not opened with the Godot game engine but by an application made with it.
Here is an example.
ANSWER
Answered 2022-Jan-11 at 16:24Found the solution.
By editing the .exe file using resourcehacker you can adjust the file description and icon. By editing the product name will give the correct name.
Thanks to cybereality from the Godot forum to enlighten me on this solution.
QUESTION
Error in python script using python-vlc and pafy
Asked 2021-Dec-14 at 07:15Recently I have created a python script to play youtube videos using pafy and python-vlc. The below code is the script:
1# importing vlc module
2import vlc
3
4# importing pafy module
5import pafy
6
7# url of the video
8url = "https://www.youtube.com/watchv=il_t1WVLNxk&list=PLqM7alHXFySGqCvcwfqqMrteqWukz9ZoE"
9
10# creating pafy object of the video
11video = pafy.new(url)
12
13# getting stream at index 0
14best = video.streams[0]
15
16# creating vlc media player object
17media = vlc.MediaPlayer(best.url)
18
19# start playing video
20media.play()
21
And after running it I get this error:
1# importing vlc module
2import vlc
3
4# importing pafy module
5import pafy
6
7# url of the video
8url = "https://www.youtube.com/watchv=il_t1WVLNxk&list=PLqM7alHXFySGqCvcwfqqMrteqWukz9ZoE"
9
10# creating pafy object of the video
11video = pafy.new(url)
12
13# getting stream at index 0
14best = video.streams[0]
15
16# creating vlc media player object
17media = vlc.MediaPlayer(best.url)
18
19# start playing video
20media.play()
21Traceback (most recent call last):
22File "C:\Users\harsh\Desktop\don't.py", line 11, in <module>
23video = pafy.new(url)
24File "C:\Users\harsh\AppData\Local\Programs\Python\Python310\lib\site-
25packages\pafy\pafy.py", line 124, in new
26return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts)
27File "C:\Users\harsh\AppData\Local\Programs\Python\Python310\lib\site-
28packages\pafy\backend_youtube_dl.py", line 31, in __init__
29super(YtdlPafy, self).__init__(*args, **kwargs)
30File "C:\Users\harsh\AppData\Local\Programs\Python\Python310\lib\site-
31packages\pafy\backend_shared.py", line 97, in __init__
32self._fetch_basic()
33File "C:\Users\harsh\AppData\Local\Programs\Python\Python310\lib\site-
34packages\pafy\backend_youtube_dl.py", line 54, in _fetch_basic
35self._dislikes = self._ydl_info['dislike_count']
36KeyError: 'dislike_count'
37
Please help me with this error. If you have any questions please ask.
ANSWER
Answered 2021-Dec-01 at 09:14Pafy its very usefull tool if you want to extract information about youtube video like, retrieve metadata such as viewcount, duration, rating, author, thumbnail, keywords or Download video or audio at requested resolution. But it doesnt work(at least untill now) to play a video. If you want to play a Yt video inside your code use it:
1# importing vlc module
2import vlc
3
4# importing pafy module
5import pafy
6
7# url of the video
8url = "https://www.youtube.com/watchv=il_t1WVLNxk&list=PLqM7alHXFySGqCvcwfqqMrteqWukz9ZoE"
9
10# creating pafy object of the video
11video = pafy.new(url)
12
13# getting stream at index 0
14best = video.streams[0]
15
16# creating vlc media player object
17media = vlc.MediaPlayer(best.url)
18
19# start playing video
20media.play()
21Traceback (most recent call last):
22File "C:\Users\harsh\Desktop\don't.py", line 11, in <module>
23video = pafy.new(url)
24File "C:\Users\harsh\AppData\Local\Programs\Python\Python310\lib\site-
25packages\pafy\pafy.py", line 124, in new
26return Pafy(url, basic, gdata, size, callback, ydl_opts=ydl_opts)
27File "C:\Users\harsh\AppData\Local\Programs\Python\Python310\lib\site-
28packages\pafy\backend_youtube_dl.py", line 31, in __init__
29super(YtdlPafy, self).__init__(*args, **kwargs)
30File "C:\Users\harsh\AppData\Local\Programs\Python\Python310\lib\site-
31packages\pafy\backend_shared.py", line 97, in __init__
32self._fetch_basic()
33File "C:\Users\harsh\AppData\Local\Programs\Python\Python310\lib\site-
34packages\pafy\backend_youtube_dl.py", line 54, in _fetch_basic
35self._dislikes = self._ydl_info['dislike_count']
36KeyError: 'dislike_count'
37 import webbrowser
38
39 url = "https://www.youtube.com/watch?v=dQw4w9WgXcQ"
40 webbrowser.open(url)
41
QUESTION
Read only reference variable in a lambda expression
Asked 2021-Dec-13 at 20:06This is my first question here. If I do anything wrong regarding asking or formatting, please tell me!
My program must play something in a Windows Media Player control, wait until it is done playing, then continue with another item.
Below is the entire function:
1 public void Play(AxWindowsMediaPlayer player, ref bool audioFileFinished)
2 {
3 int numberOfIntro = rnd.Next(songIntros.Count); //Randomly select an intro from the list
4 string introFilePath = songIntros.ElementAt(numberOfIntro).fullPath;
5 player.URL = introFilePath;
6
7 //This task is necessary because the while (!audioFileFinished) will otherwise run in the UI and hang the app.
8 Task f = Task.Factory.StartNew(() =>
9 {
10 while (!audioFileFinished)
11 {
12 }
13
14 player.URL = fullPath;
15 });
16 }
17
Of course, Visual Studio complains that I may not use a reference variable in the lambda expression. This is logical, as modifying reference variables in asynchronous tasks would be bad, let's keep it at that.
But, I don't have the need to modify it, as it is modified somewhere else in the program. That's why it is a reference variable.
Is there a way to read this variable in a way that Visual Studio accepts? Maybe make it a read only variable? If so, how?
Thanks in advance, Liam
ANSWER
Answered 2021-Dec-13 at 20:06Here's one approach, with admittedly poor names that you might want to change:
1 public void Play(AxWindowsMediaPlayer player, ref bool audioFileFinished)
2 {
3 int numberOfIntro = rnd.Next(songIntros.Count); //Randomly select an intro from the list
4 string introFilePath = songIntros.ElementAt(numberOfIntro).fullPath;
5 player.URL = introFilePath;
6
7 //This task is necessary because the while (!audioFileFinished) will otherwise run in the UI and hang the app.
8 Task f = Task.Factory.StartNew(() =>
9 {
10 while (!audioFileFinished)
11 {
12 }
13
14 player.URL = fullPath;
15 });
16 }
17public class Completion : ICompletionNotification
18{
19 public bool IsCompleted { get; private set; }
20
21 public void Complete() => IsCompleted = true;
22}
23
24public interface ICompletionNotification
25{
26 bool IsCompleted { get; }
27}
28
Calling code creates a new Completion
, but your Play
method takes an argument of type ICompletionNotification
1 public void Play(AxWindowsMediaPlayer player, ref bool audioFileFinished)
2 {
3 int numberOfIntro = rnd.Next(songIntros.Count); //Randomly select an intro from the list
4 string introFilePath = songIntros.ElementAt(numberOfIntro).fullPath;
5 player.URL = introFilePath;
6
7 //This task is necessary because the while (!audioFileFinished) will otherwise run in the UI and hang the app.
8 Task f = Task.Factory.StartNew(() =>
9 {
10 while (!audioFileFinished)
11 {
12 }
13
14 player.URL = fullPath;
15 });
16 }
17public class Completion : ICompletionNotification
18{
19 public bool IsCompleted { get; private set; }
20
21 public void Complete() => IsCompleted = true;
22}
23
24public interface ICompletionNotification
25{
26 bool IsCompleted { get; }
27}
28public void Play(AxWindowsMediaPlayer player, ICompletionNotification completion)
29
...and checks its IsCompleted
property.
That way the caller can create a Completion
and pass it to the Play()
method which casts it as ICompletionNotification
.
1 public void Play(AxWindowsMediaPlayer player, ref bool audioFileFinished)
2 {
3 int numberOfIntro = rnd.Next(songIntros.Count); //Randomly select an intro from the list
4 string introFilePath = songIntros.ElementAt(numberOfIntro).fullPath;
5 player.URL = introFilePath;
6
7 //This task is necessary because the while (!audioFileFinished) will otherwise run in the UI and hang the app.
8 Task f = Task.Factory.StartNew(() =>
9 {
10 while (!audioFileFinished)
11 {
12 }
13
14 player.URL = fullPath;
15 });
16 }
17public class Completion : ICompletionNotification
18{
19 public bool IsCompleted { get; private set; }
20
21 public void Complete() => IsCompleted = true;
22}
23
24public interface ICompletionNotification
25{
26 bool IsCompleted { get; }
27}
28public void Play(AxWindowsMediaPlayer player, ICompletionNotification completion)
29var completion = new Completion();
30Play(player, completion);
31
The caller can call Complete()
to indicate that it's done, but the receiver can't set that property. It can only read it.
CancellationToken
and CancellationTokenSource
work pretty much the same way. As the docs say,
A CancellationToken enables cooperative cancellation between threads, thread pool work items, or Task objects.
1 public void Play(AxWindowsMediaPlayer player, ref bool audioFileFinished)
2 {
3 int numberOfIntro = rnd.Next(songIntros.Count); //Randomly select an intro from the list
4 string introFilePath = songIntros.ElementAt(numberOfIntro).fullPath;
5 player.URL = introFilePath;
6
7 //This task is necessary because the while (!audioFileFinished) will otherwise run in the UI and hang the app.
8 Task f = Task.Factory.StartNew(() =>
9 {
10 while (!audioFileFinished)
11 {
12 }
13
14 player.URL = fullPath;
15 });
16 }
17public class Completion : ICompletionNotification
18{
19 public bool IsCompleted { get; private set; }
20
21 public void Complete() => IsCompleted = true;
22}
23
24public interface ICompletionNotification
25{
26 bool IsCompleted { get; }
27}
28public void Play(AxWindowsMediaPlayer player, ICompletionNotification completion)
29var completion = new Completion();
30Play(player, completion);
31using CancellationTokenSource source = new CancellationTokenSource();
32CancellationToken token = source.Token;
33
34// pass the token to some method, and then when it's done call
35source.Cancel();
36
It's the same idea. The creator can cancel it, but it passes the token which can only be used to see if the operation has been canceled.
I didn't initially recommend it because technically you're not "cancelling" anything. But it's the same concept and doesn't require defining a new type. Someone who sees it will understand what you're doing or can look up the existing documentation.
QUESTION
How to open animated plots (gif/mp4) in RStudio?
Asked 2021-Dec-13 at 13:11I'm using RStudio with the {gganimate}
package in a restricted research environment (a Windows 10 VM with several modifications) to create animated graphs in .gif
and .mp4
formats - when they are rendered within RStudio they display fine, but if I save the files using anim_save()
I can't open the resulting files in either the provided Windows Image Viewer or web browser (or the media player in case of .mp4
) - it always says the file is broken or cannot be displayed.
There is a lengthy process involved in exporting these files out of the restricted environment, so I'd like to check if they are actually broken, or just cannot be displayed in this particular OS for whatever reason. Can RStudio open/display .gif
files or videos? Note: I know how to display an animation using print()
/plot()
methods - this is about opening/displaying an external animated file after it's been exported.
Example code to generate animated plot and save as .gif
/.mp4
below:
1library(ggplot2)
2library(gganimate) # package {av} also required to save as mp4
3
4animated_plot <-
5 ggplot(mtcars, aes(x = wt, y = hp, colour = as.factor(cyl))) +
6 geom_point() +
7 transition_states(cyl, transition_length = 3, state_length = 1) +
8 enter_fade() +
9 exit_fade() +
10 labs(title = "Cyl: {closest_state}")
11
12## save as gif
13anim_save(
14 filename = "animation.gif",
15 animation = animate(animated_plot)
16 )
17
18## save as mp4
19anim_save(
20 filename = "animation.mp4",
21 animation = animate(animated_plot,
22 renderer = av_renderer())
23)
24
(My backup plan is to use file_renderer()
to export the individual frames as images and animate them later, as in e.g. Convert multiple png to gif as an animation in R)
ANSWER
Answered 2021-Dec-13 at 13:11I corrected your code a little, now it works right.
1library(ggplot2)
2library(gganimate) # package {av} also required to save as mp4
3
4animated_plot <-
5 ggplot(mtcars, aes(x = wt, y = hp, colour = as.factor(cyl))) +
6 geom_point() +
7 transition_states(cyl, transition_length = 3, state_length = 1) +
8 enter_fade() +
9 exit_fade() +
10 labs(title = "Cyl: {closest_state}")
11
12## save as gif
13anim_save(
14 filename = "animation.gif",
15 animation = animate(animated_plot)
16 )
17
18## save as mp4
19anim_save(
20 filename = "animation.mp4",
21 animation = animate(animated_plot,
22 renderer = av_renderer())
23)
24library(ggplot2)
25library(gganimate) # package {av} also required to save as mp4
26
27animated_plot <-
28 ggplot(mtcars, aes(x = wt, y = hp, colour = as.factor(cyl))) +
29 geom_point() +
30 transition_states(cyl, transition_length = 3, state_length = 1) +
31 enter_fade() +
32 exit_fade() +
33 labs(title = "Cyl: {closest_state}")
34
35## save as gif
36animation = animate(animated_plot)
37anim_save(
38 filename = "animation.gif")
39
40## save as mp4
41animation1 = animate(animated_plot,
42 renderer = av_renderer())
43anim_save(
44 filename = "animation.mp4")
45
46animation1 #to display a video in the RStudio's viewer
47animation #to display a gif in the RStudio's viewer
48
An example:
An addition:
If you want, you can open your gifs or mp4 in the internal RStudio browser:
Make a simple Rmarkdown-file and knit to html:
1library(ggplot2)
2library(gganimate) # package {av} also required to save as mp4
3
4animated_plot <-
5 ggplot(mtcars, aes(x = wt, y = hp, colour = as.factor(cyl))) +
6 geom_point() +
7 transition_states(cyl, transition_length = 3, state_length = 1) +
8 enter_fade() +
9 exit_fade() +
10 labs(title = "Cyl: {closest_state}")
11
12## save as gif
13anim_save(
14 filename = "animation.gif",
15 animation = animate(animated_plot)
16 )
17
18## save as mp4
19anim_save(
20 filename = "animation.mp4",
21 animation = animate(animated_plot,
22 renderer = av_renderer())
23)
24library(ggplot2)
25library(gganimate) # package {av} also required to save as mp4
26
27animated_plot <-
28 ggplot(mtcars, aes(x = wt, y = hp, colour = as.factor(cyl))) +
29 geom_point() +
30 transition_states(cyl, transition_length = 3, state_length = 1) +
31 enter_fade() +
32 exit_fade() +
33 labs(title = "Cyl: {closest_state}")
34
35## save as gif
36animation = animate(animated_plot)
37anim_save(
38 filename = "animation.gif")
39
40## save as mp4
41animation1 = animate(animated_plot,
42 renderer = av_renderer())
43anim_save(
44 filename = "animation.mp4")
45
46animation1 #to display a video in the RStudio's viewer
47animation #to display a gif in the RStudio's viewer
48---
49title: "Untitled"
50output:
51 html_document
52---
53
54<img src="animation.gif"/>
55
56<video controls autoplay>
57 <source src="animation.mp4" type="video/mp4">
58</video>
59
An another addition.
You should install library(rstudioapi)
After look this link: https://rstudio.github.io/rstudioapi/reference/viewer.html
Make a simple html file with img / video tag, e.g. animation.html
and open via viewer:
1library(ggplot2)
2library(gganimate) # package {av} also required to save as mp4
3
4animated_plot <-
5 ggplot(mtcars, aes(x = wt, y = hp, colour = as.factor(cyl))) +
6 geom_point() +
7 transition_states(cyl, transition_length = 3, state_length = 1) +
8 enter_fade() +
9 exit_fade() +
10 labs(title = "Cyl: {closest_state}")
11
12## save as gif
13anim_save(
14 filename = "animation.gif",
15 animation = animate(animated_plot)
16 )
17
18## save as mp4
19anim_save(
20 filename = "animation.mp4",
21 animation = animate(animated_plot,
22 renderer = av_renderer())
23)
24library(ggplot2)
25library(gganimate) # package {av} also required to save as mp4
26
27animated_plot <-
28 ggplot(mtcars, aes(x = wt, y = hp, colour = as.factor(cyl))) +
29 geom_point() +
30 transition_states(cyl, transition_length = 3, state_length = 1) +
31 enter_fade() +
32 exit_fade() +
33 labs(title = "Cyl: {closest_state}")
34
35## save as gif
36animation = animate(animated_plot)
37anim_save(
38 filename = "animation.gif")
39
40## save as mp4
41animation1 = animate(animated_plot,
42 renderer = av_renderer())
43anim_save(
44 filename = "animation.mp4")
45
46animation1 #to display a video in the RStudio's viewer
47animation #to display a gif in the RStudio's viewer
48---
49title: "Untitled"
50output:
51 html_document
52---
53
54<img src="animation.gif"/>
55
56<video controls autoplay>
57 <source src="animation.mp4" type="video/mp4">
58</video>
59<!doctype html>
60<html lang=en>
61<head>
62<meta charset=utf-8>
63<title>blah</title>
64</head>
65<body>
66
67<img src="animation.gif"/>
68
69<video controls autoplay>
70 <source src="animation.mp4" type="video/mp4">
71
72</video>
73</body>
74</html>
75
1library(ggplot2)
2library(gganimate) # package {av} also required to save as mp4
3
4animated_plot <-
5 ggplot(mtcars, aes(x = wt, y = hp, colour = as.factor(cyl))) +
6 geom_point() +
7 transition_states(cyl, transition_length = 3, state_length = 1) +
8 enter_fade() +
9 exit_fade() +
10 labs(title = "Cyl: {closest_state}")
11
12## save as gif
13anim_save(
14 filename = "animation.gif",
15 animation = animate(animated_plot)
16 )
17
18## save as mp4
19anim_save(
20 filename = "animation.mp4",
21 animation = animate(animated_plot,
22 renderer = av_renderer())
23)
24library(ggplot2)
25library(gganimate) # package {av} also required to save as mp4
26
27animated_plot <-
28 ggplot(mtcars, aes(x = wt, y = hp, colour = as.factor(cyl))) +
29 geom_point() +
30 transition_states(cyl, transition_length = 3, state_length = 1) +
31 enter_fade() +
32 exit_fade() +
33 labs(title = "Cyl: {closest_state}")
34
35## save as gif
36animation = animate(animated_plot)
37anim_save(
38 filename = "animation.gif")
39
40## save as mp4
41animation1 = animate(animated_plot,
42 renderer = av_renderer())
43anim_save(
44 filename = "animation.mp4")
45
46animation1 #to display a video in the RStudio's viewer
47animation #to display a gif in the RStudio's viewer
48---
49title: "Untitled"
50output:
51 html_document
52---
53
54<img src="animation.gif"/>
55
56<video controls autoplay>
57 <source src="animation.mp4" type="video/mp4">
58</video>
59<!doctype html>
60<html lang=en>
61<head>
62<meta charset=utf-8>
63<title>blah</title>
64</head>
65<body>
66
67<img src="animation.gif"/>
68
69<video controls autoplay>
70 <source src="animation.mp4" type="video/mp4">
71
72</video>
73</body>
74</html>
75rstudioapi::viewer("animation.html")
76
A fallback :) library(ricomisc)
with command: rstudio_viewer("xxx.html")
Good luck ;)
QUESTION
VLC silent install over Powershell
Asked 2021-Dec-08 at 14:11I'm trying to install the VLC media player using a PowerShell script.
I opened the VLC wiki and found this (that's the only help I found online):
Start process -FilePath "C: \ Temp \ VLC.exe" -ArgumentList "/ L = 1033 / S"
When I run this command I don't get an error, but I have to accept the Windows admin thing and that's it. VLC cannot be installed.
ANSWER
Answered 2021-Dec-08 at 14:10I would suggest to install software using Chocolatey. This is very simple, it's PowerShell based and consists in only 1 command line (but first you need to install Chocolatey):
1choco install vlc
2
And it's very easy to update installed software as well.
QUESTION
Get Video Width and Height from Azure Media Player
Asked 2021-Nov-24 at 21:02I have video's I'm streaming from Azure Media Services and are being rendered in my web page using Azure Media Player API.
I don't know ahead of time what the videos dimensions are (and they will vary). My issue is that when I play the video there is a black border (either at top/bottom or at left/right) around the video if I don't create the video element with the correct ratio to match the video. See for example the image below, notice the large black borders on the left and right of the video. I'd like to get the video size so I can correct the dimensions and get rid of the border.
The Azure Media Player API seems to say I can get the videoWidth and videoHeight. But I'm not sure (in Javascript) what object to get those values from.
In my script below, when I console.log
the player
object I don't see videoWidth
or videoHeight
as part of the player object.
1let myOptions = {
2 controls: true,
3 autoplay: true,
4 logo: { enabled: false }
5};
6myPlayer = amp(video, myOptions, () => {
7 console.log(myPlayer);
8});
9myPlayer.src([{
10 src: "<manifestURL>",
11 type: "<type>"
12}]);
13
The following screenshot is what gets logged. Unless I'm missing something, I don't see the videoWidth
or videoHeight
values.
Any assistance is greatly appreciated.
ANSWER
Answered 2021-Nov-24 at 21:02Actually videoWidth/videoHeight are functions.
Also you should use the this
keyword inside the ready handler.
For example :
1let myOptions = {
2 controls: true,
3 autoplay: true,
4 logo: { enabled: false }
5};
6myPlayer = amp(video, myOptions, () => {
7 console.log(myPlayer);
8});
9myPlayer.src([{
10 src: "<manifestURL>",
11 type: "<type>"
12}]);
13amp(video, options, () => console.log(this.videoWidth())
14
QUESTION
cvlc cannot play rtsp (omxplayer instead can)
Asked 2021-Nov-23 at 10:48Got this Dahua vto stream link: that works with omxplayer, but vlc won't play it:
1rtsp://user:pass@ipadd:554/cam/realmonitor/channel=1&subtype=1
2
This is the output of vlc:
1rtsp://user:pass@ipadd:554/cam/realmonitor/channel=1&subtype=1
2VLC media player 3.0.16 Vetinari (revision 3.0.13-8-g41878ff4f2)
3[000055b9be2245b0] main libvlc debug: VLC media player - 3.0.16 Vetinari
4[000055b9be2245b0] main libvlc debug: Copyright © 1996-2021 the VideoLAN team
5[000055b9be2245b0] main libvlc debug: revision 3.0.13-8-g41878ff4f2
6[000055b9be2245b0] main libvlc debug: configured with ./configure '--build=x86_64-linux-gnu' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--disable-option-checking' '--disable-silent-rules' '--libdir=${prefix}/lib/x86_64-linux-gnu' '--runstatedir=/run' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-debug' '--config-cache' '--disable-update-check' '--enable-fast-install' '--docdir=/usr/share/doc/vlc' '--with-binary-version=3.0.16-1' '--enable-a52' '--enable-aa' '--enable-aribsub' '--enable-avahi' '--enable-bluray' '--enable-caca' '--enable-chromaprint' '--enable-chromecast' '--enable-dav1d' '--enable-dbus' '--enable-dca' '--enable-dvbpsi' '--enable-dvdnav' '--enable-faad' '--enable-flac' '--enable-fluidsynth' '--enable-freetype' '--enable-fribidi' '--enable-gles2' '--enable-gnutls' '--enable-harfbuzz' '--enable-jack' '--enable-kate' '--enable-libass' '--enable-libmpeg2' '--enable-libxml2' '--enable-lirc' '--enable-mad' '--enable-matroska' '--enable-mod' '--enable-mpc' '--enable-mpg123' '--enable-mtp' '--enable-ncurses' '--enable-notify' '--enable-ogg' '--enable-opus' '--enable-pulse' '--enable-qt' '--enable-realrtsp' '--enable-samplerate' '--enable-sdl-image' '--enable-sftp' '--enable-shine' '--enable-shout' '--enable-skins2' '--enable-sndio' '--enable-soxr' '--enable-spatialaudio' '--enable-speex' '--enable-svg' '--enable-svgdec' '--enable-taglib' '--enable-theora' '--enable-twolame' '--enable-upnp' '--enable-vdpau' '--enable-vnc' '--enable-vorbis' '--enable-x264' '--enable-x265' '--enable-zvbi' '--with-kde-solid=/usr/share/solid/actions/' '--disable-aom' '--disable-crystalhd' '--disable-d3d11va' '--disable-decklink' '--disable-directx' '--disable-dsm' '--disable-dxva2' '--disable-fdkaac' '--disable-fluidlite' '--disable-freerdp' '--disable-goom' '--disable-gst-decode' '--disable-libtar' '--disable-live555' '--disable-macosx' '--disable-macosx-avfoundation' '--disable-macosx-qtkit' '--disable-mfx' '--disable-microdns' '--disable-opencv' '--disable-projectm' '--disable-schroedinger' '--disable-sparkle' '--disable-srt' '--disable-telx' '--disable-vpx' '--disable-vsxu' '--disable-wasapi' '--enable-alsa' '--enable-dc1394' '--enable-dv1394' '--enable-libplacebo' '--enable-linsys' '--enable-nfs' '--enable-udev' '--enable-v4l2' '--enable-wayland' '--enable-libva' '--enable-vcd' '--enable-smbclient' '--disable-oss' '--enable-mmx' '--enable-sse' '--disable-neon' '--disable-altivec' '--disable-omxil' 'build_alias=x86_64-linux-gnu' 'CFLAGS=-g -O2 -ffile-prefix-map=/build/vlc-0rjD9V/vlc-3.0.16=. -fstack-protector-strong -Wformat -Werror=format-security ' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -ffile-prefix-map=/build/vlc-0rjD9V/vlc-3.0.16=. -fstack-protector-strong -Wformat -Werror=format-security ' 'OBJCFLAGS=-g -O2 -ffile-prefix-map=/build/vlc-0rjD9V/vlc-3.0.16=. -fstack-protector-strong -Wformat -Werror=format-security'
7[000055b9be2e1700] main audio output debug: looking for audio output module matching "any": 6 candidates
8[000055b9be2e1700] vlcpulse audio output debug: using library version 14.2.0
9[000055b9be2e1700] vlcpulse audio output debug: (compiled with version 14.2.0, protocol 34)
10[000055b9be2e1700] vlcpulse audio output debug: connected locally to /run/user/1000/pulse/native as client #10650
11[000055b9be2e1700] vlcpulse audio output debug: using protocol 34, server protocol 34
12[000055b9be2e1700] pulse audio output debug: adding sink 1: alsa_output.pci-0000_00_1f.3.analog-stereo (Built-in Audio Analog Stereo)
13[000055b9be2e1700] pulse audio output debug: adding sink 2: ec_ref (Built-in Audio Analog Stereo (echo cancelled with Built-in Audio Analog Stereo))
14[000055b9be2e1700] pulse audio output debug: adding sink 16: alsa_output.pci-0000_01_00.1.hdmi-stereo-extra3 (GM107 High Definition Audio Controller [GeForce 940MX] Digital Stereo (HDMI 4))
15[000055b9be2e1700] main audio output debug: using audio output module "pulse"
16[000055b9be2caff0] main playlist debug: keeping audio output
17[000055b9be310c40] main interface debug: looking for interface module matching "dbus,none": 19 candidates
18[000055b9be310c40] dbus interface debug: listening on dbus as: org.mpris.MediaPlayer2.vlc
19[000055b9be310c40] main interface debug: using interface module "dbus"
20[000055b9be3154c0] main interface debug: looking for interface module matching "hotkeys,none": 19 candidates
21[000055b9be3154c0] main interface debug: using interface module "hotkeys"
22[000055b9be315e90] main interface debug: looking for interface module matching "globalhotkeys,none": 19 candidates
23[000055b9be310c40] dbus interface debug: Getting All properties
24[000055b9be310c40] dbus interface debug: Getting All properties
25[000055b9be315e90] main interface debug: using interface module "xcb_hotkeys"
26[000055b9be3177f0] main interface debug: looking for interface module matching "dummy": 19 candidates
27[000055b9be3177f0] dummy interface: using the dummy interface module...
28[000055b9be3177f0] main interface debug: using interface module "dummy"
29[000055b9be2caff0] main playlist debug: processing request item: null, node: Scaletta, skip: 0
30[000055b9be2caff0] main playlist debug: rebuilding array of current - root Scaletta
31[000055b9be2caff0] main playlist debug: rebuild done - 1 items, index -1
32[000055b9be2caff0] main playlist debug: starting playback of new item
33[000055b9be2caff0] main playlist debug: resyncing on rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1
34[000055b9be2caff0] main playlist debug: rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1 is at 0
35[000055b9be2caff0] main playlist debug: creating new input thread
36[00007ff0bc000c80] main input debug: Creating an input for 'rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1'
37[000055b9be2caff0] main playlist debug: requesting art for new input thread
38[00007ff0bc000c80] main input debug: using timeshift granularity of 50 MiB
39[00007ff0bc000c80] main input debug: using default timeshift path
40[00007ff0bc000c80] main input debug: `rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1' gives access `rtsp' demux `any' path `user:pass@address:554/cam/realmonitor/channel=1&subtype=1'
41[00007ff0b0000fa0] main input source debug: creating demux: access='rtsp' demux='any' location='user:pass@address:554/cam/realmonitor/channel=1&subtype=1' file='(null)'
42[00007ff0b0001160] main demux debug: looking for access_demux module matching "rtsp": 16 candidates
43[00007ff0a8000c20] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
44[000055b9be2caff0] main playlist debug: processing request item: null, node: Scaletta, skip: 0
45[000055b9be2caff0] main playlist debug: rebuilding array of current - root Scaletta
46[000055b9be2caff0] main playlist debug: rebuild done - 1 items, index -1
47[000055b9be2caff0] main playlist debug: starting playback of new item
48[000055b9be2caff0] main playlist debug: resyncing on rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1
49[000055b9be2caff0] main playlist debug: rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1 is at 0
50[000055b9be2caff0] main playlist debug: creating new input thread
51[00007ff0bc000c80] main input debug: Creating an input for 'rtsp://10.168.5.138:554/cam/realmonitor/channel=1&subtype=1'
52[000055b9be2caff0] main playlist debug: requesting art for new input thread
53[00007ff0bc000c80] main input debug: using timeshift granularity of 50 MiB
54[00007ff0bc000c80] main input debug: using default timeshift path
55[00007ff0bc000c80] main input debug: `rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1' gives access `rtsp' demux `any' path `user:pass@address:554/cam/realmonitor/channel=1&subtype=1'
56[00007ff0b0000fa0] main input source debug: creating demux: access='rtsp' demux='any' location='user:pass@address:554/cam/realmonitor/channel=1&subtype=1' file='(null)'
57[00007ff0b0001160] main demux debug: looking for access_demux module matching "rtsp": 16 candidates
58[00007ff0a8000c20] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
59[00007ff0a8000c20] lua meta fetcher debug: Trying Lua scripts in /home/tec1/.local/share/vlc/lua/meta/fetcher
60[00007ff0a8000c20] lua meta fetcher debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/fetcher
61[00007ff0a8000c20] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
62[00007ff0b0001160] main demux debug: no access_demux modules matched
63[00007ff0a8000c20] main meta fetcher debug: no meta fetcher modules matched
64[00007ff0b0001630] main stream debug: creating access: rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1
65[00007ff0a8000c20] main art finder debug: looking for art finder module matching "any": 2 candidates
66[00007ff0b0001630] main stream debug: looking for access module matching "rtsp": 29 candidates
67[00007ff0a8000c20] lua art finder debug: Trying Lua scripts in /home/tec1/.local/share/vlc/lua/meta/art
68[00007ff0a8000c20] lua art finder debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art
69[00007ff0a8000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
70[00007ff0b0001630] satip stream debug: try to open 'rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1'
71[00007ff0b0001630] satip stream debug: connect to host '10.168.5.138'
72[00007ff0b0001630] main stream debug: net: connecting to 10.168.5.138 port 554
73[00007ff0a8000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
74[00007ff0a8000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
75[00007ff0a8000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
76[00007ff0a8000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
77[00007ff0a8000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
78[00007ff0a8000c20] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
79[00007ff0a8000c20] lua art finder debug: skipping script (unmatched scope) /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
80[00007ff0a8000c20] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
81[00007ff0a8000c20] main art finder debug: no art finder modules matched
82[00007ff0b0001630] main stream debug: connection succeeded (socket = 11)
83[00007ff0ac000e80] main meta fetcher debug: looking for meta fetcher module matching "any": 1 candidates
84[00007ff0b0001630] main stream debug: net: opening 0.0.0.0 datagram port 9164
85[00007ff0ac000e80] lua meta fetcher debug: Trying Lua scripts in /home/tec1/.local/share/vlc/lua/meta/fetcher
86[00007ff0b0001630] main stream debug: net: opening 0.0.0.0 datagram port 9165
87[00007ff0ac000e80] lua meta fetcher debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/fetcher
88[00007ff0ac000e80] lua meta fetcher debug: Trying Lua scripts in /usr/share/vlc/lua/meta/fetcher
89[00007ff0ac000e80] main meta fetcher debug: no meta fetcher modules matched
90[00007ff0ac000e80] main art finder debug: looking for art finder module matching "any": 2 candidates
91[00007ff0ac000e80] lua art finder debug: Trying Lua scripts in /home/tec1/.local/share/vlc/lua/meta/art
92[00007ff0ac000e80] lua art finder debug: Trying Lua scripts in /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art
93[00007ff0ac000e80] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/00_musicbrainz.luac
94[00007ff0ac000e80] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/01_googleimage.luac
95[00007ff0ac000e80] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/02_frenchtv.luac
96[00007ff0ac000e80] lua art finder debug: Trying Lua playlist script /usr/lib/x86_64-linux-gnu/vlc/lua/meta/art/03_lastfm.luac
97[00007ff0ac000e80] lua art finder debug: Trying Lua scripts in /usr/share/vlc/lua/meta/art
98[00007ff0ac000e80] main art finder debug: no art finder modules matched
99[00007ff0b0001630] satip stream error: Failed to setup RTSP session
100[00007ff0b0001630] main stream debug: net: connecting to 10.168.5.138 port 554
101[00007ff0b0001630] main stream debug: connection succeeded (socket = 11)
102[00007ff0b0001630] access_realrtsp stream warning: Cseq mismatch, got 1, assumed 0
103[00007ff0b0001630] access_realrtsp stream debug: rtsp connected
104[00007ff0b0001630] access_realrtsp stream warning: only real/helix rtsp servers supported for now
105[00007ff0b0001630] main stream debug: no access modules matched
106[00007ff0bc000c80] main input error: L'ingresso non può essere aperto
107[00007ff0bc000c80] main input error: VLC non è in grado di aprire il MRL 'rtsp://user:pass@address:554/cam/realmonitor/channel=1&subtype=1'. Controlla il registro per i dettagli.
108[000055b9be2caff0] main playlist debug: dead input
109[000055b9be2caff0] main playlist debug: changing item without a request (current 0/1)
110[000055b9be2caff0] main playlist debug: nothing to play
111
Main problem is omxplayer is deprecated but it play it fine, after 10 seconds of loading. Can someone let me understand why vlc doesn't at all?
ANSWER
Answered 2021-Nov-10 at 05:29So what happened is that the library in Debian providing support for live555 was removed in February of this year, this affects all downstream distros including but not limited to RPi OS and Ubuntu:
https://askubuntu.com/a/1363113
The 2 active versions were 2020.01.19-1 and 2018.11.26-1.1, Live555 has since added GPL license headers to the offending files, however the RFC issue remains.
Now you may be tempted to just download the latest Live555 source code and compile it... it does not work. There have been changes to function names and structures referenced by VLC, and as such VLC will not compile against the source. You need to get an older version, I specifically used this one, which is a tweaked snapshot from 2020 prior to the modifications that prevent VLC compilation:
https://github.com/rgaufman/live555
The configuration you want is ./genMakefiles linux-with-shared-libraries
, I do not know if it is required but since my system is x86-64-bit I added -m64 to the compiler options first
After compilation and install, I went on to compile VLC, adding '--enable-live555'
and '--with-live555-tree=extras/live555-master'
after placing the root Live555 folder in the VLC extras folder, however VLC failed to compile, it turns out the Live555's make install does not copy all the header files needed to where VLC is looking. They were dropped as 4 subfolders into /usr/local/include/, and the actual libs into /usr/local/lib/. Adding the correct CXX/CPP flags will make it look where they were put, however I put them all in a single folder and used 1 flag.
I also had to '--disable-mod'
to work around a dependency version issue that I had no interest in fixing, since I do not use modplug or any mod files.
50 minutes later... VLC successfully compiled! However it was expecting the libraries for Live555 to be in /usr/lib/ not /usr/local/lib/, since it took so long to compile I was just fine with linking or copying the libraries into the expected folder, and after that VLC works with RTSP when linked to the new file. Or you can choose to maintain the original VLC and run the new file directly if you need to load the camera feeds.
Community Discussions contain sources that include Stack Exchange Network
Tutorials and Learning Resources in Media Player
Tutorials and Learning Resources are not available at this moment for Media Player