Problems Starting VLC HTTP Stream with Servlet - http

I'm working on a VLC project for myself. My goal is to create an HTML front end to start a stream. I am doing this through the use of Java Servlets.
Overview:
Ubuntu 13.04,
Java 7-21 : IcedTea 2.3.9,
Eclipse JAVAEE IDE,
Tomcat 7
I am trying to start a VLC HTTP video stream using this call.
vlc -vvv /home/jca310ms/Videos/test.avi.flv \
--sout '#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}:std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'
Now, this call does work from the command line. However, when it is run using :
String args = "vlc -vvv /home/jca310ms/Videos/test.avi.flv --sout '#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}:std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'";
Runtime runtime = Runtime.getRuntime();
Process p = runtime.exec(args);
I get these errors from the output:
err: [0x7ff2d8000b78] main input debug: Creating an input for 'test.avi.flv'
err: [0x7ff2ac001108] main stream output debug: using sout chain=`standard{mux="",access="'#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}",dst="std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv }'"}'
err: [0x7ff2ac001108] main stream output debug: stream=`standard'
err: [0x7ff2ac0014f8] main stream out debug: looking for sout stream module: 1 candidate
err: [0x7ff2ac0014f8] main stream out warning: missing value for option mux
err: [0x7ff2ac0014f8] main stream out debug: set config option: sout-standard-access to '#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}
err: [0x7ff2ac0014f8] main stream out debug: set config option: sout-standard-dst to std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'
err: [0x7ff2ac0014f8] stream_out_standard stream out error: no mux specified or found by extension
err: [0x7ff2ac0014f8] main stream out debug: no sout stream module matching "standard" could be loaded
err: [0x7ff2ac0014f8] main stream out debug: TIMER module_need() : 1.743 ms - Total 1.743 ms / 1 intvls (Avg 1.743 ms)
err: [0x7ff2ac0014f8] main stream out debug: destroying chain... (name=(null))
err: [0x7ff2ac0014f8] main stream out debug: destroying chain done
err: [0x7ff2ac001108] main stream output error: stream chain failed for `standard{mux="",access="'#transcode{vcodec=FLV1,vb=4096,fps=25,scale=1,acodec=mp3,ab=512,samplerate=44100,channels=2}",dst="std{access=http,mux=flv,dst=0.0.0.0:8081/stream.flv}'"}'
err: [0x20dd928] main playlist debug: finished input
err: [0x7ff2d8000b78] main input error: cannot start stream output instance, aborting
err: [0x20dd928] main playlist debug: dead input
err: [0x20dd928] main playlist debug: changing item without a request (current 0/1)
err: [0x20dd928] main playlist debug: nothing to play
Any ideas what might be causing the difference between vlc ability to start the stream through console, but not being able to start the stream using runtime.exec()?
Any and all help is well appreciated!!!

Related

Odd error when attempting net_put via Ansible

Looking for assistance with an odd error I am troubleshooting with a playbook.
I have a working SSH session to a switch, but having difficulty with transferring files via SCP on Ansible. I can start a SCP session directly from the same server with no issues and can transfer a text file (the same one references below) but it does not seem to work in Ansible.
I enabled verbose logging via Ansible and this is what I am seeing in the logfile generated.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/ansible/utils/jsonrpc.py", line 46, in handle_request
result = rpc_method(*args, **kwargs)
File "/root/.ansible/collections/ansible_collections/ansible/netcommon/plugins/connection/network_cli.py", line 1282, in copy_file
self.ssh_type_conn.put_file(source, destination, proto=proto)
File "/root/.ansible/collections/ansible_collections/ansible/netcommon/plugins/connection/libssh.py", line 498, in put_file
raise AnsibleError(
ansible.errors.AnsibleError: Error transferring file to flash:test.txt: Initializing SCP session of remote file [flash:test.txt] for w>
2022-10-06 11:58:35,671 p=535932 u=root n=ansible | fatal: [%remoteSwitch%]: FAILED! => {
"changed": false,
"destination": "flash:test.txt",
"msg": "Exception received: Error transferring file to flash:test.txt: Initializing SCP session of remote file [flash:test.txt] fo>
}
Afraid Google is not helping me too much with this one. If it helps, this is on Ubuntu 22.04, with Ansible 2.10.8.
Play attempting to be ran is:
- hosts: %remoteSwitch%
vars:
- firmware_image_name: "test.txt"
tasks:
- name: Copying image to the switch... This can take time, please wait...
net_put:
src: "/etc/ansible/firmware_images/C2960X/{{ firmware_image_name }}"
dest: "flash:{{ firmware_image_name }}"
vars:
ansible_command_timeout: 20
protocol: scp
I ran into this same error. I was able to fix it by switching back to Paramiko SSH. This can be accomplished by either pip uninstall ansible-pylibssh (note, this very likely has other side-effects).
Alternatively, you can force Paramiko usage at the Ansible play level:
---
- name: Test putting a file onto Cisco IOS/IOS-XE device
hosts: cisco1
# ansible-pylibssh errors out here (force paramiko usage)
vars:
ansible_network_cli_ssh_type: paramiko
tasks:
- name: Copy file
ansible.netcommon.net_put:
src: my_file1.txt
dest : flash:/my_file1.txt
protocol: scp
It would be helpful to know what type of connection it is and what platform.
I see from the file that it is a Cisco IOS device. Do you have the following settings?
ansible_connection: ansible.netcommon.network_cli
ansible_network_os: cisco.ios.ios
The following documentation mentions the need for paramiko. Will it work if you change the ssh_type to paramiko?
https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/net_put_module.html
ssh_type can be set as follows:
configuration:
INI entry:
[persistent_connection]
ssh_type = paramiko
Environment variable: ANSIBLE_NETWORK_CLI_SSH_TYPE
Variable: ansible_network_cli_ssh_type
Variable: ansible_network_cli_ssh_type

I cannot stream through network using vlc

I can't stream a video over network using vlc. When I look logfile I see these lines
What is the problem and how can I solve it? My operating system is windows 10 64 bit. Also I need to make a script to stream a video over network with vlc. I could not find any helpful document about this. Can somebody help me about this issue?
main debug: toggling resume
main debug: auto hiding mouse cursor
main debug: auto hiding mouse cursor
main debug: exiting
main debug: exiting
main debug: no exit handler
main debug: removing all interfaces
main debug: removing module "qt"
main debug: deactivating the playlist
main debug: incoming request - stopping current input
main debug: killing decoder fourcc `h264'
main debug: removing module "h264"
main debug: incoming request - stopping current input
main debug: removing a sout input (sout_input: 0000026d28625c20)
main debug: incoming request - stopping current input
main debug: killing decoder fourcc `h264'
main debug: removing module "avcodec"
main debug: incoming request - stopping current input
main debug: saving a free vout
main debug: incoming request - stopping current input
main debug: reusing provided vout
main debug: incoming request - stopping current input
mux_ts debug: removing input pid=100
mux_ts debug: freeing video PID 100
main debug: incoming request - stopping current input
main warning: no more input streams for this mux
main debug: incoming request - stopping current input
main debug: removing module "mp4"
mp4 debug: freeing all memory
main debug: incoming request - stopping current input
main debug: Program doesn't contain anymore ES
main debug: removing module "record"
main debug: incoming request - stopping current input
main debug: removing module "cache_read"
main debug: incoming request - stopping current input
main debug: removing module "filesystem"
main debug: incoming request - stopping current input
main debug: dead input
qt debug: IM: Deleting the input
main debug: nothing to play
main debug: destroying useless sout
main debug: destroying chain... (name=duplicate)
main debug: removing module "duplicate"
duplicate debug: closing a duplication
main debug: destroying chain... (name=display)
main debug: removing module "display"
main debug: destroying useless vout
main debug: removing module "direct3d11"
direct3d11 debug: Direct3D11 resources destroyed
direct3d11 debug: Direct3D11 device adapter closed
direct3d11 error: SetThumbNailClip failed: 0x800706f4
direct3d11 debug: Win32 Vout EventThread terminating
direct3d11 debug: Win32VoutCloseWindow
direct3d11 debug: WinProc WM_DESTROY
main debug: removing module "inhibit"
qt debug: releasing video...
qt debug: Video is not needed anymore
main debug: removing module "freetype"
main debug: removing module "yuvp"
main debug: removing module "swscale"
main debug: destroying chain done
main debug: destroying chain... (name=standard)
main debug: removing module "stream_out_standard"
main debug: removing module "mux_ts"
main debug: removing module "udp"
main debug: destroying chain done
main debug: destroying chain done
main debug: removing module "mmdevice"
qt debug: requesting exit...
qt debug: waiting for UI thread...
qt debug: QApp exec() finished
qt debug: Video is not needed anymore
qt debug: Killing extension dialog provider
qt debug: ExtensionsDialogProvider is quitting...
main debug: removing module "lua"
main debug: removing module "win32"
main debug: removing module "hotkeys"
main debug: removing module "win_msg"
main debug: destroying
main debug: saving media library to file C:\Users\gulbe\AppData\Roaming\vlc\ml.xspf.tmp30208
main debug: looking for playlist export module matching "export-xspf": 4 candidates
main debug: using playlist export module "export"
main debug: removing module "export"
main debug: deleting item `Media Library'
main debug: deleting item `videoOo.mp4'
main debug: deleting item `Playlist'
main debug: removing module "memory"
-- logger module stopped --
-- logger module started --
main: one instance mode ENABLED

How to make HTTP stream from RTSP

I have LRP camera which produces RTSP stream in rtsp://172.16.4.6. I use VLC to see this streaming. Then I need to use ALPR Daemon for passing stream in http:// to recognize registration plates captured by camera. According to documentation in should be only http://. So using VLC I am trying to convert/transcode it to proper format. What is the problem, that I am not familiar with this field and have no time to study basic.
I installed apache2 on ubuntu that has port 80 and http://127.0.0.1 address. Then I tried to use some of approaches from documentation https://wiki.videolan.org/Documentation:Streaming_HowTo/Command_Line_Examples/ , then I tried $vlc -I http rtsp://172.16.4.6:554/HighResolutionVideo :sout='#transcode{vcodec=MJPG,vb=800,fps=5}:std{access=http{mime=multipart/x-mixed-repace},mux=mpjpeg,dst=127.0.0.1:80/go.mjpg,delay=0}'
But then I have this error log:
[00007f5fb0001268] core access out error: socket bind error: Permission denied
[00007f5fb0001268] core access out error: cannot create socket(s) for HTTP host
[00007f5fb0001268] access_output_http access out error: cannot start HTTP server
[00007f5fb0003388] stream_out_standard stream out error: no suitable sout access module for `http{mine=multipart/x-mixed-repace}/mpjpeg://172.0.0.1:80/go.mjpg'
[00007f5fb0000b18] core stream output error: stream chain failed for `transcode{vcodec=MJPG,vb=800,fps=5}:std{access=http{mine=multipart/x-mixed-repace},mux=mpjpeg,dst=172.0.0.1:80/go.mjpg,delay=0}'
[00007f5fb42929f8] core input error: cannot start stream output instance, aborting
[00007f5fb0003388] access_output_http access out: Consider passing --http-host=IP on the command line instead.
[00007f5fb0003388] core access out error: socket bind error: Permission denied
[00007f5fb0003388] core access out error: cannot create socket(s) for HTTP host
[00007f5fb0003388] access_output_http access out error: cannot start HTTP server
[00007f5fb0001268] stream_out_standard stream out error: no suitable sout access module for `http{mine=multipart/x-mixed-repace}/mpjpeg://172.0.0.1:80/go.mjpg'
[00007f5fb0000b18] core stream output error: stream chain failed for `transcode{vcodec=MJPG,vb=800,fps=5}:std{access=http{mine=multipart/x-mixed-repace},mux=mpjpeg,dst=172.0.0.1:80/go.mjpg,delay=0}'
[00007f5fb42929f8] core input error: cannot start stream output instance, aborting
I think you have a typo in repace, Try this:
--sout #transcode{vcodec=MJPG,venc=ffmpeg{strict=1}}:standard{access=http{mime=multipart/x-mixed-replace;boundary=--7b3cc56e5f51db803f790dad720ed50a},mux=mpjpeg,dst=:80/go.mjpg}

Spring XD - Could not find module with name 'ftphdfs' and type 'source'

I running spring-xd-1.3.1.RELEASE run-time container, when I tried to module file with the source from ftp to hdfs, I get an exception in the shell command which is given below.
xd:>module info --name source:ftphdfs
Command failed org.springframework.xd.rest.client.impl.SpringXDException: Could
not find module with name 'ftphdfs' and type 'source'
Also when I tried to use source as http endpoint, I get an exception like this in shell command which is given below.
xd:>module info --name source:http
Information about source module 'http':
Injects data from http endpoint.
Option Name Description
Default
Type
--------------------- -------------------------------------------------------
--------------------------------------------------------------------------------
--------- -------------------------------------------------------------------
---------------------------------
https true for https://
false
boolean
maxContentLength the maximum allowed content length
1048576
int
messageConverterClass the name of a custom MessageConverter class, to convert
HttpRequest to Message; must have a constructor with a 'MessageBuilderFactory'
parameter org.springframework.integration.x.http.NettyInboundMessageConverter
java.lang.String
port the port to listen to
9000
int
sslPropertiesLocation location (resource) of properties containing the locati
on of the pkcs12 keyStore and pass phrase
classpath:httpSSL.properties
java.lang.String
outputType how this module should emit messages it produces
<none>
org.springframework.util.MimeType
Tech stack which I'm currently using is given below.
1) Hadoop 2.7.2
2) Spring-XD-1.3.1.RELEASE
3) Redis 2.6 (Windows Version) - I use this as a transport
4) Zoo-Keeper 3.8
Any help would be appreciated.
It's a job not a stream source...
xd:>module info job:ftphdfs
Information about job module 'ftphdfs':
...
I don't see an exception for source:http above - just a description of the source.

Chef::Exceptions::ChecksumMismatch when installing nginx-1.4.4 from source

I am having the error described here:
Chef::Exceptions::ChecksumMismatch when installing nginx-1.7.8 from source
However, that fix does not work for me.
Following the suggestions on that page, I created a shasum:
shasum -a 256 nginx-1.4.4.tar
ed744d916a19e426fd6885e14036d64156f4b6f6aca1d22a1b9307de8d46e8d3 nginx-1.4.4.tar
then I opened this file:
vi /opt/chef/cookbooks/nginx/recipes/source.rb
and I found this block:
remote_file nginx_url do
source nginx_url
checksum node['nginx']['source']['checksum']
path src_filepath
backup false
end
which I changed to this:
remote_file nginx_url do
source nginx_url
checksum 'ed744d916a19e426fd6885e14036d64156f4b6f6aca1d22a1b9307de8d46e8d3'
path src_filepath
backup false
end
but I continue to get this error:
Recipe: nginx::source
* yum_package[pcre-devel] action install (up to date)
* yum_package[openssl-devel] action install (up to date)
* remote_file[http://nginx.org/download/nginx-1.4.4.tar.gz] action create
================================================================================
Error executing action `create` on resource 'remote_file[http://nginx.org/download/nginx-1.4.4.tar.gz]'
================================================================================
Chef::Exceptions::ChecksumMismatch
----------------------------------
Checksum on resource (ed744d) does not match checksum on content (7c989a)
Resource Declaration:
---------------------
# In /opt/chef/cookbooks/nginx/recipes/source.rb
58: remote_file nginx_url do
59: source nginx_url
60: checksum 'ed744d916a19e426fd6885e14036d64156f4b6f6aca1d22a1b9307de8d46e8d3'
61: path src_filepath
62: backup false
63: end
64:
Compiled Resource:
------------------
# Declared in /opt/chef/cookbooks/nginx/recipes/source.rb:58:in `from_file'
remote_file("http://nginx.org/download/nginx-1.4.4.tar.gz") do
provider Chef::Provider::RemoteFile
action [:create]
retries 0
retry_delay 2
default_guard_interpreter :default
source ["http://nginx.org/download/nginx-1.4.4.tar.gz"]
use_etag true
use_last_modified true
declared_type :remote_file
cookbook_name :nginx
recipe_name "source"
checksum "ed744d916a19e426fd6885e14036d64156f4b6f6aca1d22a1b9307de8d46e8d3"
path "/var/chef/cache/nginx-1.4.4.tar.gz"
atomic_update true
end
Running handlers:
[2016-02-16T15:40:44+00:00] ERROR: Running exception handlers
Running handlers complete
[2016-02-16T15:40:44+00:00] ERROR: Exception handlers complete
Chef Client failed. 5 resources updated in 19 seconds
[2016-02-16T15:40:44+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2016-02-16T15:40:44+00:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
[2016-02-16T15:40:44+00:00] ERROR: remote_file[http://nginx.org/download/nginx-1.4.4.tar.gz] (nginx::source line 58) had an error: Chef::Exceptions::ChecksumMismatch: Checksum on resource (ed744d) does not match checksum on content (7c989a)
[2016-02-16T15:40:44+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Does anyone have any advice?
I am running this inside of vagrant, on my local machine (a Mac).
It sounds like this was resolved in comments above, but for the record you need to make sure the checksum exactly the file being downloaded. This can be confusing in cases with gzip compression.
Run sha256sum command against the file and use the output as checksum. Seems like you're using md5 or sha1 hash algorithm as checksum

Resources