Stream a DV-camera using vlc: Difference between revisions

From Alpine Linux
(→‎Configure vlc: Finetuning x264 parameters)
(replace /etc/init.d with rc-service)
 
(9 intermediate revisions by 5 users not shown)
Line 10: Line 10:
== Install programs ==
== Install programs ==
{{Cmd| apk add vlc-daemon vlc-dev }}
{{Cmd| apk add vlc-daemon vlc-dev }}
{{todo| I haven't figured out why vlc-dev is needed. Manually adding all vlc-dev dependencies does not work}}
{{note|If you intend to use a desktop environment with vlc you will need to install {{pkg|vlc-qt}} in order to get that working.<BR>{{pkg|vlc-dev}} or {{pkg|vlc}} package does not contain the graphical part of vlc ''(menus etc.)''.}}
{{todo| I haven't figured out why vlc-dev is needed. Manually adding all vlc-dev dependencies does not work.<BR>
The 'require vlc-dev' thing is reported at {{Issue|1051}} and might be solved soon ''(or 'vlc-dev' really is needed as a dependency)''.}}


== Using ACF to control vlc ==
== Using ACF to control vlc ==
{{todo|Create Makefiles and test acf-vlc-daemon and remove this note when it works}}
{{tip|A easy way to control vlc-daemon would be through [[Alpine Configuration Framework Design|ACF]]. Consider following these simple steps.<BR>
{{tip|A easy way to control vlc-daemon would be through [[ACF]]. Consider following these simple steps.<BR>
But as it is ''optional'' you could just skip this [[Alpine Configuration Framework Design|ACF]] section.}}
But as it is ''optional'' you could just skip this [[ACF]] section.}}
Setup/install acf ''(unless it's not already done)''.
Setup/install acf ''(unless it's not already done)''.
{{cmd| setup-acf}}
{{cmd| setup-acf}}
Install acf-package for vlc
Install acf-package for vlc
{{cmd| apk add acf-vlc-daemon}}
{{cmd| apk add acf-vlc-daemon}}
We won't describe in this tutorial how you would use [[ACF]] to control vlc-daemon ''(basically because it's so simple it does not need any describing)''.<BR>
We won't describe in this tutorial how you would use [[Alpine Configuration Framework Design|ACF]] to control vlc-daemon ''(basically because it's so simple it does not need any describing)''.<BR>
If you installed [[ACF]], just browse https://ip.of.your.box and you would from this tutorial understand what to do.<BR>  
If you installed [[Alpine Configuration Framework Design|ACF]], just browse <nowiki>https://ip.of.your.box</nowiki> and you would from this tutorial understand what to do.<BR>


= Configure vlc =
= Configure vlc =
Line 33: Line 34:


###############
###############
# Transcoder
# Chose one of the following 'preset' values depending on how fast your CPU is:
#  ultrafast,superfast,veryfast,faster,fast,medium,slow,slower,veryslow,placebo
TVIDEO="venc=x264{preset=ultrafast,vbv-maxrate=${BITRATE},vbv-bufsize=256,keyint=250,min-keyint=25},vcodec=h264,vb=${BITRATE},scale=1,width=${XRES},height=${YRES}"
TVIDEO="venc=x264{preset=ultrafast,vbv-maxrate=${BITRATE},vbv-bufsize=256,keyint=250,min-keyint=25},vcodec=h264,vb=${BITRATE},scale=1,width=${XRES},height=${YRES}"
# Chose one of the following 'preset' values depending on how fast your CPU is: ultrafast,superfast,veryfast,faster,fast,medium,slow,slower,veryslow,placebo
TAUDIO="acodec=mp4a,ab=96,channels=2,samplerate=44100"
TAUDIO="acodec=mp4a,ab=64,channels=1,samplerate=32000"
TMISC="deinterlace,audio-sync"
TMISC="deinterlace,audio-sync"


###############
###############
TRANSPORT="std{access=http,mux=ts,dst=0.0.0.0:2012}"
TRANSPORT="std{access=http,mux=ts,dst=:8080}"


VLC_OPTS="--daemon -I dummy dv:///dev/fw0 --rawdv-hurry-up --sout-keep --sout-transcode-audio-sync \
VLC_OPTS="--daemon -I dummy dv:///dev/fw0 --rawdv-hurry-up --sout-keep --sout-transcode-audio-sync \
Line 54: Line 55:
== Manual start ==
== Manual start ==
Start vlc-daemon either from terminal:
Start vlc-daemon either from terminal:
{{cmd|/etc/init.d/vlc start}}
{{cmd|rc-service vlc start}}
or using ACF and just klick [Start].
or using ACF and just klick [Start].


Line 65: Line 66:
{{cmd|less -I /var/log/vlc/vlc.log}}
{{cmd|less -I /var/log/vlc/vlc.log}}
If you don't find any useful information you could add verbosity by adding '-v' or '-vv' to /etc/conf.d/vlc and restart vlc ''(you would need to restart vlc-daemon to see more information in the logs)''.
If you don't find any useful information you could add verbosity by adding '-v' or '-vv' to /etc/conf.d/vlc and restart vlc ''(you would need to restart vlc-daemon to see more information in the logs)''.
[[Category:Multimedia]]

Latest revision as of 10:40, 17 November 2023

This material is work-in-progress ...

Do not follow instructions here until this notice is removed.
(Last edited by Sertonix on 17 Nov 2023.)

In this howto we are going to stream the video coming from a DV-camera connected through ie1394 (firewire).
vlc is used to stream the content.
We will be using h264 and AAC to transcode the stream (should be fairly easy to change to whatever suits your needs).

Setup Alpine

Initial Setup

Follow Installing_Alpine to setup Alpine Linux.

Install programs

apk add vlc-daemon vlc-dev

Note: If you intend to use a desktop environment with vlc you will need to install vlc-qt in order to get that working.
vlc-dev or vlc package does not contain the graphical part of vlc (menus etc.).
Todo: I haven't figured out why vlc-dev is needed. Manually adding all vlc-dev dependencies does not work.
The 'require vlc-dev' thing is reported at #1051 and might be solved soon (or 'vlc-dev' really is needed as a dependency).


Using ACF to control vlc

Tip: A easy way to control vlc-daemon would be through ACF. Consider following these simple steps.
But as it is optional you could just skip this ACF section.

Setup/install acf (unless it's not already done).

setup-acf

Install acf-package for vlc

apk add acf-vlc-daemon

We won't describe in this tutorial how you would use ACF to control vlc-daemon (basically because it's so simple it does not need any describing).
If you installed ACF, just browse https://ip.of.your.box and you would from this tutorial understand what to do.

Configure vlc

Configuration is done by modifying '/etc/conf.d/vlc'.
Here comes the actual configuration that makes vlc stream the DV-camera.

###############
BITRATE=500
XRES=720
YRES=576

###############
# Chose one of the following 'preset' values depending on how fast your CPU is:
#   ultrafast,superfast,veryfast,faster,fast,medium,slow,slower,veryslow,placebo
TVIDEO="venc=x264{preset=ultrafast,vbv-maxrate=${BITRATE},vbv-bufsize=256,keyint=250,min-keyint=25},vcodec=h264,vb=${BITRATE},scale=1,width=${XRES},height=${YRES}"
TAUDIO="acodec=mp4a,ab=96,channels=2,samplerate=44100"
TMISC="deinterlace,audio-sync"

###############
TRANSPORT="std{access=http,mux=ts,dst=:8080}"

VLC_OPTS="--daemon -I dummy dv:///dev/fw0 --rawdv-hurry-up --sout-keep --sout-transcode-audio-sync \
--file-logging --logfile /var/log/vlc/vlc.log \
--sout #transcode{$TVIDEO,$TAUDIO,$TMISC}:$TRANSPORT"

Start it up

Prepare the hardware

Here comes the hardest part in this tutorial... Attach the DV-camera to your ie1394/firewire port.
Well... that wasn't too hard! :-)

Manual start

Start vlc-daemon either from terminal:

rc-service vlc start

or using ACF and just klick [Start].

Make it start at next reboot

You might want to make it automatically start at next reboot

rc-update add vlc-daemon default

Debug

In case something goes wrong, consider looking at the logfiles.

less -I /var/log/vlc/vlc.log

If you don't find any useful information you could add verbosity by adding '-v' or '-vv' to /etc/conf.d/vlc and restart vlc (you would need to restart vlc-daemon to see more information in the logs).