VLCJ Output audio/video modules - vmware

Is there any abillity to change "Audio output module" and "Video output" in my java program?
My linux doesn't play video files when these options are set to "automatic". So in VLC Player I have chosen "ALSA" and "OpenGL GLX (XCB)", now my files are playing.
But when I use EmbeddedMediaPlayerComponent in my program, I think it chooses "automatic" mode for a/v threads. Then I'm getting a green screen (instead of my video) and an error in terminal:
[00007f691c112ac8] pulse audio output error: stream connection failure: Timeout
[00007f691c112ac8] core audio output error: module not functional
[00007f69081b6168] core decoder error: failed to create audio output
Failed to open VDPAU backend libvdpau_nvidia.so: cannot open shared object file: No such file or directory
Strange, but audio is playing...
Please, help! ;)

Change the MediaPlayerFactory initialisation arguments to specify the name of the audio/video output module that you want to use.
Something like:
String[] args = {"--vout=xcb", "--aout=alsa"});
From a command-line, vlc --list will give you the available module names.

Related

PlatformIO cannot open ftdi device (Arduino with esp32)

I am new to Arduino and using the esp32 and I am using PlatformIO to command my project in C++ through VSCode. I just downloaded my project folder and opened it in PlatformIO and attempted to run the existing code (over 1000 lines) which is meant to command an exoskeleton. When I run the program, however, I get error messages, as follows:
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6010, description '', serial '' at bus location ''
Error: no device found
Error: unable to open ftdi device with vid 0403, pid 6014, description '', serial '' at bus location ''
I feel like I am missing something very basic, but everything I search for gives me very advanced problems, and I am hoping someone could dumb this down for me.
Any help is appreciated, thank you.
By the way, I am actually using Mac, and the output when I enter the ls -ls /dev/tty.usbserial-1410 is:
0 crw-rw-rw- 1 root wheel 18, 2 7 Dec 14:13 /dev/tty.usbserial-1410
You may used a different type of esp32 module (there're lots of variants in the market) from the original design. You have 2 options,
If the software works and you don't want to modify it, then try to find the same type of esp32 module specified by design.
Find out vid/pid from your current esp32 module and update software to connect. Refer to below procedure.
The procedures to update usb serial binding,
Run lsusb to find out vid/pid
lsusb commands
update the existing rule specified with vid 0403 and pid 6010 to your current vid/pid, usually the rule file is under /etc/udev/rules.d/.
Run sudo udevadm control --reload-rules to activate.

How to transfer realsense data via ROS to other Device(s)

I want to make the program under
" catkin_ws/src/realsense-ros-3.2.13/realsense2_camera "
directory from the "ros wrapper site" transfer realsense data to other devices.
I've chosen to use ".cpp file" since I've already made the program which uses C++ and realsense camera.
I want to know the relationships of the files inside " realsense2_camera/src " directory
and how and where the executable files appears after catkin_make etc., because I want to remodel that file(s),if it's able to transfer the realsense data to other Devices to do it.
I think it's related with roscpp_tutorials, rospy_tutorials and beginner_tutorials' Publisher and Subscriber Programs and I was able to make Publisher and Subscriber Programs communicating with different Devices, though I don't know about the theory of why they run. (how and where the executable files appears)
Environment
Device OS: ubuntu 18.04
Device HW: Jetson nano
rosdistro: melodic
python: Python 2.7.17
Realsense ROS Wrapper: 2.2.13
Realsense Viewer Version: 2.34.0
Camera: D435
D435 Firmware: 5.12.03.00
Thank you for your information.
I've been wandering why I couldn't get the D435's Data, but I solved it.
Starting "realsense-viewer" when "roslaunch" the ".launch file" and restarting the "Terminal" SEVERAL TIME can make "default .launch file" launch, so re-writing the "launch file" might be able to move the C++/Python file(s).
And I think your " include 'ing method" will make the problem simple to solve.

mplayer doesn't like popen suddenly?

Been stumped over a problem with popen for a few days.
The code:
int main(){
FILE *fp = popen("mplayer /home/linaro/Music/cp.mp3", "r");
char buffer[1028];
while (fgets(buffer, 1028, fp) != NULL)
{
std::cerr<<buffer;
}
pclose(fp);
fp = 0;
return 0;
}
was run at the shop on a linaro embedded controller. Ran fine, no errors. Even though the code is simple (Just plays a coldplay song on execution and then quits) it seems to be causing me more grief than one would think.
If I copy and paste the command itself into a normal bash shell, it runs fine. And what's worse, is it ran fine up until it got plugged in somewhere else. I'm not sure if it is now being connected to via a headphone jack versus before it was in a line out jack.
Regardless, the error I get when I run it is (summarized down to the relevant part)
MPlayer svn r34540 (Ubuntu), built with gcc-4.6 (C) 2000-2012 MPlaye4
Team mplayer: could not connect to socket mplayer: No such file or
directory Failed to open LIRC support. You will not be able to use
your remote control.
Playing /home/linaro/Music/cp.mp3 libavformat version 53.21.1
(external) Mismatching header version 53.19.0 Audio only file format
detected. Clip info: Title: The Scientist Artist: Coldplay Album: A
Rush Of Blood To The Head Year: 2002 Comment: Genre: Unknown Load
subtitles in /home/linaro/Music/ Requested audio codec family [mpg123]
(afm=mpg123) not available. Enable it at compilation. Opening audio
decoder: [ffmpeg] FFmpeg/libavcodec audio decoders libavcodec version
53.35.0 (external) Mismatching header version 53.32.2 AUDIO: 44100 Hz, 2
ch, floatle, 256.0 kbit/9.07% (ratio: 32002->352800) Selected audio
codec: [ffmp3float] afm: ffmpeg (FFmpeg MPEG layer-3 audio) Home
directory not accessible: Permission denied AO: [pulse] Init failed:
Connection refused Failed to initialize audio driver 'pulse' Home
directory not accessible: Permission denied [AO_ALSA] alsa-lib:
pcm_hw.c:1293:(snd_pcm_hw_open) open '/dev/snd/pcmC1D0p' failed (-22):
Invalid argument [AO_ALSA] Playback open error: Invalid argument
Failed to initialize audio driver 'alsa' [AO SDL] Samplerate: 44100Hz
Channels: Stereo Format floatle [AO SDL] using aalib audio driver. [AO
SDL] Unsupported audio format: 0x1d. [AO SDL] Unable to open audio: No
available audio device Failed to initialize audio driver 'sdl:aalib'
Could not open/initialize audio device -> no sound. Audio: no sound
Video: no video
Again, if I copy and paste the exact command it executes via popen into the console, it begins playing. It fails if pass -ao alsa, -ao pulse, -ao oss as well, which has me completely stumped. Any help would be appreciated!
Edit:
Linux is linaro, based on Ubuntu 12.04 using arm CPU
Issue wound up being as Jonas and alk suggested -- permissions. Something along the way changed how it ran, but at the end of the day the dirty fix was to just include
su - user -c ' mplayer ... '
To the line being called.

Reading video files with OpenCV VideoCapture

I am having trouble being able top open any video files in OpenCV besides those encoded in MJPEG.
I have installed OpenCV using this script (which should compile OpenCV with support for ffmpeg) and an testing using the sample provided here.
When running with a h264 encoded video I get:
[mov,mp4,m4a,3gp,3g2,mj2 # 0x123ed80] multiple edit list entries, a/v desync might occur, patch welcome
[h264 # 0x12465e0] A non-intra slice in an IDR NAL unit.
[h264 # 0x12465e0] decode_slice_header error
Could not open the output video for write: test.mp4
When running with an MPEG-2 encoded video I get:
[mpegts # 0x1e92d80] PES packet size mismatch
[mpegts # 0x1e92d80] PES packet size mismatch
[mpegts # 0x1e92d80] max_analyze_duration reached
[mpegts # 0x1e92d80] PES packet size mismatch
Could not open the output video for write: test.mpeg
I am running x64 Ubuntu 12.04.
EDIT: I tried OpenCV 2.4.8 on a Ubuntu 13.10 x86 VM, ffmpeg works fine, however the sample code still fails, this time with the following error:
[h264 # 0x849ff40] A non-intra slice in an IDR NAL unit.
[h264 # 0x849ff40] decode_slice_header error
Could not find encoder for codec id 28: Encoder not foundOpenCV Error: Unsupported format or combination of formats (Gstreamer Opencv backend doesn't support this codec acutally.) in CvVideoWriter_GStreamer::open, file /home/dan/Install-OpenCV/Ubuntu/2.4/OpenCV/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp, line 505
terminate called after throwing an instance of 'cv::Exception'
what(): /home/dan/Install-OpenCV/Ubuntu/2.4/OpenCV/opencv-2.4.8/modules/highgui/src/cap_gstreamer.cpp:505: error: (-210) Gstreamer Opencv backend doesn't support this codec acutally. in function CvVideoWriter_GStreamer::open
I am not sure about the main reason for this. But I guess this problem is relate to the decoder installed on your system. According to the install script from github, it removes your ffmpg and x264 then rebuilds them from source code. Before testing your OpenCV code, try simple "ffmpeg" command on your test video.
Such as: ffmpeg -i inputfile.avi -f image2 image-%3d.jpeg
The script you have used is quite old and installs old version of OpenCV (2.4.2, while the latest stable is 2.4.8), try to use this script - https://github.com/jayrambhia/Install-OpenCV/blob/master/Ubuntu/2.4/opencv2_4_8.sh or install OpenCV and ffmpeg on you own.
As rookiepig mentioned - check whether ffmpeg is working.
Try to use different codec - here http://www.fourcc.org/ is full list of options, of course testing all of them is useless - jsut try the most popular codecs.
I know that it's stupid, but on Windows some codecs works only in release mode(okay, probably they are working in both modes, but on my machine they used to work only in release mode). Try to compile you program in both modes and check whether there is some difference.
And show us you code, maybe there is something wrong in it.

opencv highgui error

I installed the library opencv in my ubuntu pc and i wrote a program that takes a video from a webcam and it works.
Yesterday I installed the driver for video capture "media_build" to take a video from a video grabber, but the same program doesn't work, while if I open "video for linux 2" on VLC it works.
This is the error:
libv4l2: error set_fmt gave us a different result then try_fmt!
HIGHGUI ERROR: libv4l unable convert to requested pixfmt
HIGHGUI ERROR: V4L: device /dev/video0: Unable to query number of channels
ERROR: capture is NULL
The instruction is:
CvCapture* capture = cvCaptureFromCAM( CV_CAP_ANY );
any suggestion?
thanks
I think your program is crashing. If so you can add if(capture!=NULL)
{// your normal code here}else{// display some error message}. In this case the program wont crash. Probably your video driver isn't providing a interface known to openCv.
Maybe you can use this command:
sudo chmod 666 /dev/video0