VLC loop/repeat not seamless when running in remote command mode - raspberry-pi

I have a Raspberry Pi 4 running Raspbian and run VLC from a command prompt with the following parameters
vlc --intf rc --rc-host localhost:65513 --fullscreen
I have successfully gotten VLC to play a video by issuing remote commands through a Socket and have issued a repeat/loop command.
The looping doesn't have to be seamless but it momentarily cuts back to the command prompt before it replays the video and looks unprofessional.
Is there any solution to this? I cannot find anything that works. I can live with the screen staying black for a moment but can't have work presentations playing continously on a screen that shows Linux in the background every 30 seconds.

I had the same issue, here is how I "fixed it" :
set desktop background to a black jpeg.
Told the panel not to appear at launch by editing /home/pi/.config/lxsession/LXDE-pi/autostart as follow (first line that launchs the panel is commented to do so) :
##lxpanel --profile LXDE-pi
#pcmanfm --desktop --profile LXDE-pi
#xscreensaver -no -splash
Prevent the pi to blank screen or go to sleep by editing file /etc/lightdm/lightdm.conf and adding in the [SeatDefaults] section :
xserver-command=X -s 0 -dpms
Now when VLC is looping, it still cuts back to the desktop but as everything is blacked out (no panel, black background), the cut becomes invisible.
Et voilà :)
My best.
S.Y.

I solved this by using two instances of VLC, whereby one instance streams the video to the other using the --sout-keep flag. This way the VLC instance actually producing an image shows a continuous stream, as the streaming instance tries to keep one stream instance open across multiple(or one looped) file.
For example:
vlc rtp://127.0.0.1 --intf dummy --fullscreen --no-video-title-show --alsa-audio-device hw:1,0 &
cvlc file.mp4 --sout "#rtp{mux=ts,dst=127.0.0.1,sdp=sap,name='somename'}" --sout-keep --loop

The same happened to me some month ago, it looks that the only one solution is to wait for the release of vlc 4.0 for raspbian too, and no plans about it.

Related

Why doesn't unity audio work with 4 channels

I'm trying to figure out how to do multi channel audio in unity, and it looks like something isn't working correctly.
Here is my setup:
Blank unity project (unity 2020.3.0f1)
Set project settings > audio > default speaker mode to "Quad"
Create a 4-channel audio clip with audacity (1 "click" on each channel, one at a time)
Import the clip into unity with default settings
I don't have an external sound card (yet) so I'm using VB-Cable as a virtual 4-channel output
VB-Cable provides a Control panel where I can see the levels for each channel.
Playing back the source file with quicktime, I can see the channel 1,2,3 and 4 levels moving as I expect.
However, playing back the imported audio clip in unity's asset preview merges channel 1 with 3, and 2 with 4. The same thing happens when playing the audio in-game.
Another setup I've tried is the same as above, but setting up my computer to use an "aggregate audio device":
2 outputs from my built-in output
2 outputs from VB-Cable
(I also changed the VB-Cable settings to make it a 2-channel output, so that when combined with the built-in output, I get a 4-channel output device)
With this setup, playing back the clip in Quicktime or in the unity asset preview works as expected (I hear the channels 1 and 2 through the Built-in output and "see" the channels 3 and 4 on the VB-Cable control panel).
Playing the clip in-game however, only the channels 1,2 and 3 seem to work. Nothing happens on channel 4 (Using a unity audio mixer, I can see channels 1,2 and 3 "lighting up" but 4 stays silent)
I know changing audio config with unity opened is not guaranteed to work, so for every test I do, I quit and restart Unity.
I hope I've explained the issue properly. If not, here is a zip file containing the test unity project (including the 4 channel audio track), and screen recording of different tests I've made.
System:
MacBook Pro (Retina, 13-inch, Late 2013)
MacOS 11.6.2
16GB RAM
2,8 GHz Dual-Core Intel Core i7

SwiftUI Preview turns on microphone

Does anyone know how to stop swiftUI previews from turning the microphone on? I wear bluetooth headphones while I work and every time a preview boots up it enables the mic. This degrades my audio quality since the headphones then split their bandwidth between playback and input.
My workaround has been to go into sound settings and just switch my default input to either my webcam or the macbook itself. It's so weird that the preview in xcode would turn on the mic every time it is enabled though.
Context: I have a MBP 2019 Xcode 12.4 Catalina
Thanks!
I've found that the Xcode Previews like to fuss around with the coreaudiod deamon, causing all sorts of issues (mics going on, audio stuttering, duplicated output). Try to manually kill all of those deamons from the terminal level. Apps that need this daemon to work should automatically restart needed deamon instances on their own, while Xcode won't do this.
sudo kill -9 `ps ax|grep 'coreaudio[a-z]' | awk '{print $1}'`

How to turn off USB Power completely on RPi B3+?

What I am trying to do is:
Programatically I want to switch on and off the USB power of the RPi B3+ or 4 models.
I know that I can put 0 in /sys/devices/platform/soc/3f980000.usb/buspower but seems like it does not work as expected.
Let me show you what all things I have tried:
Check 1:
Connect USB device (In my case, its camera) to the Rpi
Fire command "lsusb" In the list,
I get my camera listed properly
Check 2:
The camera is connected and lsusb is showing the device
sudo vi /sys/devices/platform/soc/3f980000.usb/buspower and put 0 in it and save the file
again lsusb
All the connected devices list is gone. Looks like its working
BUT:
When I put voltage meeter on the usb port(As showin in screenshot) , it shows same current flowing through the USB ports.
Refer attached screenshot below to understand this issue.
Looking for the solution if anyone knows.

Why can’t VLC go in to fullscreen mode?

I’m working on a Matlab application that uses a VLC class to control a VLC-instance. One of the features is to set the VLC player to fullscreen. This feature works perfectly fine.
The VLC player is downloaded from Matlab’s File Exchange: https://se.mathworks.com/matlabcentral/fileexchange/56215-vlc (Thanks a lot Léa Strobino)
However, one particular clip insists on resizing the player to a smaller size.
I have done some research and it turns out that this is a common problem in some VLC versions.
Normal workarounds are to uncheck the “adapt interface to video size” (something like that) and to check the “Fullscreen” box.
This ought to make the player open in fullscreen and not resize the screen to video size. The video still resizes the player to a smaller size.
All the specs of the clips are the same: Same file extension (.vob), formats and were made the same way (I did some video trimming and such using ffmpeg – but the same way every time).
I have noticed one difference and that is that this particular video has a lower Data and bitrate (~1000-1500kbps) where as the others are higher (<4000kbps). Also when showing the properties of the clip the frame height and width are blank as opposed to the others that have specific values.
This should however not have an effect of the fullscreen command from Matlab called after loading the video into the playlist. The command has no effect on this video, but does on all other.
It is possible to set the player to fullscreen manually by clicking the window, so it is not caused by some restriction in the video not allowing it to fullscreen.
Why does the video refuse to go in to fullscreen?
Hope somebody is able to help.
Okay so I seem to have solved the problem now. Without being completely sure why - the problem was in the lowered data/framerate.
I tried to add -crf 18 when converting my .mp4 to a .vob file:
ffmpeg -i input.mp4 -vcodec copy -acodec ac3 -crf 18 output.vob
The -crf stands for Constant Rate Factor and is a way to ensure a specific Data rate. The values goes from 0-51 and 18 seems to be the lowest 'sane' value (highest data rate). A good explanation can be found here: https://superuser.com/questions/677576/what-is-crf-used-for-in-ffmpeg
With this higher data rate the video opens up in fullscreen everytime :=)

Is a webcam feed inside of emacs possible?

I want to live stream me coding on TwitchTV. Back in my vim days, I would open up several terminals and leave a small hole in the corner to put a quicktime webcam display so that my screen recorder would capture my face. What I would like is the ability to embed a webcam feed into a buffer of emacs so that it will be integrated with emacs tiling ability. Is this possible? If so, how would I go about doing it?
Take my answer with a grain of salt, it's untested and I'm not sure if it works, and it certainly won't do audio.
Create a live-streaming .gif file from your video stream:
git clone https://github.com/jbochi/gifstreaming
cd gifstreaming
mkdir input
mkdir parts
ffmpeg -re -i rtmp:///dev/video0 -pix_fmt pal8 -s 159x97 -r 10 input/in%d.gif &
python transform.py
node server.js
https://github.com/jbochi/gifstreaming
Open a buffer with the image displayed inline using the emacs web browser:
M-x eww RET http://localhost:8080/ RET
Alternatively, you could try streaming directly from your webcam without the gif step, but I doubt eww can display video files inline.
http://www.area536.com/projects/streaming-video/