Categories
Uncategorized

Move Git Repository

Short howto move an repository from one remote origin to another.

Step 1, make sure everything is synced before you begin.

git pull
git push

Step 2. Check what your current remote origin is

$ git remote -v
origin  https://old/repository (fetch)
origin  https://old/repository (push)

Step 3. Set your new remote origin

git remote set-url origin ssh://new/repository

Step 4. Verify

$ git remote -v
origin  ssh://new/repository (fetch)
origin  ssh://new/repository (push)
Categories
Uncategorized

Disable dns over https

For Chrome & Edge

chrome://flags/#dns-over-https
Categories
Uncategorized Wowza

Wowza Transcoder options

To view all the encoding parameters you need to add logVideoEncodingParameters and logAudioEncodingParameters in your transcoder configuration as well as enabling debug logging in log4j.properties.

To enable debug add the following to your transcoder profile

<Encode>
	<Name>270p</Name>
	<Enable>true</Enable>
	<Description></Description>
	<StreamName>mp4:${SourceStreamName}_270p</StreamName>
	<Video>
		...
	</Video>
	<Audio>
		...
	</Audio>
	<Properties>
		<Property>
			<Name>logVideoEncodingParameters</Name>
			<Value>true</Value>
			<Type>Boolean</Type>
		</Property>
		<Property>
			<Name>logAudioEncodingParameters</Name>
			<Value>true</Value>
			<Type>Boolean</Type>
		</Property>
	</Properties>
</Encode>

These are the options for your video codec (if using cpu)

# long: profile_id: 0=H264PROFILE_BASELINE, 1=H264PROFILE_MAIN, 3=H264PROFILE_HIGH
mainconcept.profile_id: 3
# long: level_id: = 10 -> 1.0, .. 51 -> 5.1
mainconcept.level_id: 32
# long: idr_interval: gop length
mainconcept.idr_interval: 0
# long: reordering_delay: max distance between two P frames
mainconcept.reordering_delay: 1
# long: use_b_slices
mainconcept.use_b_slices: 0
# long: interlace_mode: 0=H264_PROGRESSIVE, 1=H264_INTERLACED, 2=H264_MBAFF
mainconcept.interlace_mode: 0
# long: def_horizontal_size
mainconcept.def_horizontal_size: 852
# long: def_vertical_size
mainconcept.def_vertical_size: 480
# double: frame_rate
mainconcept.frame_rate: 50.0
# long: num_reference_frames
mainconcept.num_reference_frames: 4
# long: search_range: motion search: spatial search range
mainconcept.search_range: 255
# long: rd_optimization: motion search: rate-distortion optimization
mainconcept.rd_optimization: 1
# long: max_l0_active: motion search: max index of reference frames in list0
mainconcept.max_l0_active: 0
# long: max_l1_active: motion search: max index of reference frames in list1
mainconcept.max_l1_active: 0
# long: quant_pI: macro blocks: quantization parameter
mainconcept.quant_pI: 24
# long: quant_pP: macro blocks: quantization parameter
mainconcept.quant_pP: 25
# long: quant_pB: macro blocks: quantization parameter
mainconcept.quant_pB: 27
# long: bit_rate_mode: bit rate stuff: 0=H264_CBR, 1=H264_CQT, 2=H264_VBR or 3=H264_TQM
mainconcept.bit_rate_mode: 2
# long: bit_rate_buffer_size: bit rate stuff: vbv buffer size
mainconcept.bit_rate_buffer_size: 3740000
# long: bit_rate: bit rate stuff: avg bitrate; if 0, use above quantization parameters
mainconcept.bit_rate: 1700000
# long: max_bit_rate: bit rate stuff: max bitrate, used in VBR mode
mainconcept.max_bit_rate: 1869952
# long: inter_search_shape: prediction: 0=H264_INTERSEARCH_16x16 (use only 16x16 block size) or 1=H264_INTERSEARCH_8x8 (use block size down to 8x8)
mainconcept.inter_search_shape: 1
# long: entropy_coding_mode: coding mode: 0=H264_CAVLC or 1=H264_CABAC
mainconcept.entropy_coding_mode: 1
# long: use_hadamard_transform: coding mode: 0=SAD is used, 1=SATD is used
mainconcept.use_hadamard_transform: 0
# long: sar_width: vui parameters: sample aspect ratio: horizontal size in arbitrary units
mainconcept.sar_width: 1
# long: sar_height: vui parameters: sample aspect ratio: vertical size in arbitrary units
mainconcept.sar_height: 1
# long: video_format: vui parameters: 1=PAL, 2=NTSC
mainconcept.video_format: 1
# long: video_full_range: vui parameters: (currently) not used
mainconcept.video_full_range: 2
# long: num_units_in_tick: vui parameters: timing info use together with time_scale
mainconcept.num_units_in_tick: 1
# long: time_scale: vui parameters: timing info use together with num_units_in_tick (fps = time_scale/num_units_in_tick)
mainconcept.time_scale: 50
# long: vbv_buffer_fullness: advanced settings: initial vbv-fullness
mainconcept.vbv_buffer_fullness: 10
# long: vbv_buffer_fullness_trg: advanced settings: final vbv-fullness
mainconcept.vbv_buffer_fullness_trg: 100
# long: vbv_buffer_units: advanced settings: units of vbv-fullness and buffer size
mainconcept.vbv_buffer_units: 0
# long: cpb_removal_delay: advanced settings: CPB removal delay for the first picture (needed for segment merging)
mainconcept.cpb_removal_delay: 0
# long: bit_rate_scale: external setting of bit_rate_scale (avoids recalculation of bitrate)
mainconcept.bit_rate_scale: 1
# long: cpb_size_scale: external setting of cpb_size_scale (avoids recalculation of bitrate)
mainconcept.cpb_size_scale: 3
# long[4]: max_frame_size: max frames size for I, P, Bref, B frames
mainconcept.max_frame_size: 0,0,0,0
# long: hrd_maintain: 0=hrd model disabled, 1=hrd model enabled
mainconcept.hrd_maintain: 1
# long[4]: min_frame_size: min frames size for I, P, Bref, B frames
mainconcept.min_frame_size: 0,0,0,0
# long: hrd_low_delay: 0=low delay hrd disabled, 1=low delay hrd enabled
mainconcept.hrd_low_delay: 0
# long: smooth_factor: Quantizer curve compression smooth factor, 0 = disabled
mainconcept.smooth_factor: 0
# long: use_deblocking_filter: in-loop filter:
mainconcept.use_deblocking_filter: 1
# long: deblocking_alphaC0_offset: in-loop filter:
mainconcept.deblocking_alphaC0_offset: -1
# long: deblocking_beta_offset: in-loop filter:
mainconcept.deblocking_beta_offset: -1
# long: adaptive_deblocking: in-loop filter: adaptive deblocking filter
mainconcept.adaptive_deblocking: 0
# long: video_type: type issues: one of above defines
mainconcept.video_type: 5
# long: video_pulldown_flag: type issues: one of above flags
mainconcept.video_pulldown_flag: 0
# long: overscan_appropriate_flag: additional vui parameters: controls overscan_appropriate_flag of VUI
mainconcept.overscan_appropriate_flag: 0
# long: stream_type: file/stream issues: 0=H264_STREAM_TYPE_I, 1=H264_STREAM_TYPE_I_SEI, 3=H264_STREAM_TYPE_II, 4=H264_STREAM_TYPE_II_NO_SEI
mainconcept.stream_type: 2
# long: frame_mbs_mode: file/stream issues: 0=H264_FRAME_MBS_ON, 1=H264_FRAME_MBS_OFF
mainconcept.frame_mbs_mode: 0
# long: bit_depth_luma: bit_depth_chroma
mainconcept.bit_depth_luma: 8
# long: bit_depth_chroma: bit_depth_chroma
mainconcept.bit_depth_chroma: 8
# long: chroma_format: 1=H264_CHROMA_400, 2=H264_CHROMA_420 or 3=H264_CHROMA_422, 4=H264_CHROMA_444
mainconcept.chroma_format: 2
# long: vui_presentation: configuration of VUI header: 0 - old school / auto mode, 1 - customized configuration, depending on following flags/bits, 0x002 - aspect_ratio_info_present_flag, 0x004 - overscan_info_present_flag (not supported), 0x008 - video_signal_type_present_flag, 0x010 - colour_description_present_flag, 0x020 - chroma_loc_info_present_flag (not supported), 0x040 - timing_info_present_flag, 0x080 - nal_hrd_parameters_present_flag, 0x100 - vcl_hrd_parameters_present_flag, 0x200 - pic_struct_present_flag, 0x400 - bitstream_restriction_flag
mainconcept.vui_presentation: 0
# long: write_au_delimiters: write access unit delimiters
mainconcept.write_au_delimiters: 1
# long: write_seq_end_code: write seq end code
mainconcept.write_seq_end_code: 1
# long: write_timestamps: write picture timecode in PT SEI
mainconcept.write_timestamps: 1
# long: timestamp_offset: frame offset (in #frames) for timestamps (default = 0)
mainconcept.timestamp_offset: 0
# long: drop_frame_timecode: use NTSC drop frame timecode notation for 29.97 and 59.94 target frame rates
mainconcept.drop_frame_timecode: 0
# long: write_single_sei_per_nalu: writes single sei message per nal unit
mainconcept.write_single_sei_per_nalu: 0
# long: write_seq_par_set: behaviour of writing sequence parameter set (default = 0): 0 - old school (SPS once per IDR), 1 - SPS once per I-frame
mainconcept.write_seq_par_set: 0
# long: write_pic_par_set: behaviour of writing picture parameter set (default = 0): 0 - old school (PPS once per IDR), 1 - PPS once per I picture, 2 - PPS once per picture
mainconcept.write_pic_par_set: 0
# long: log2_max_poc: allows to specify custom log2_max_pic_order_cnt_lsb_minus4 value: valid range is 4..16, default - 8
mainconcept.log2_max_poc: 8
# long: log2_max_frame_num: allows to specify custom log2_max_frame_num_minus4 value: valid range is 4..16, default - 8
mainconcept.log2_max_frame_num: 8
# long: pic_order_cnt_type: allows to specify custom pic_order_cnt_type value: valid values are 0 (default) and 2
mainconcept.pic_order_cnt_type: 0
# long: pic_order_present_flag: controls pic_order_present_flag value in PPS (e.g. for SBTVD-T)
mainconcept.pic_order_present_flag: 0
# long: fixed_frame_rate: controls fixed_frame_rate_flag in VUI
mainconcept.fixed_frame_rate: 1
# long: frame_based_timing: controls time_scale / num_units_in_tick ration in VUI (field or frame rate)
mainconcept.frame_based_timing: 0
# long: vcsd_mode: scene detection: visual content scene detection, 0: OFF, 1: IDR (see vcsd_mode_flags)
mainconcept.vcsd_mode: 0
# long: vcsd_sensibility: describes sensibility of scene detector (0: high, 100: 0)
mainconcept.vcsd_sensibility: 0
# long: slice_mode: advanced settings: = 1, use multiple slices per picture
mainconcept.slice_mode: 1
# long: slice_arg: advanced settings: number of slices per picture
mainconcept.slice_arg: 1
# long: b_slice_reference: advanced settings: use b slices as reference too (b -> B)
mainconcept.b_slice_reference: 0
# long: b_slice_pyramid: advanced settings: pyramidal gop structure  (...bBb...)
mainconcept.b_slice_pyramid: 0
# long: cb_offset: advanced settings: chroma quality offset (-X -> increase quality, +X -> decrease quality)
mainconcept.cb_offset: 1
# long: cr_offset: advanced settings: chroma quality offset (-X -> increase quality, +X -> decrease quality)
mainconcept.cr_offset: 1
# long: me_subpel_mode: advanced settings: 0=H264_FULL_PEL, 1=H264_HALF_PEL, 2=H264_QUARTER_PEL
mainconcept.me_subpel_mode: 2
# long: me_weighted_p_mode: advanced settings: whether to use explicit WP for P-frames or not
mainconcept.me_weighted_p_mode: 1
# long: me_weighted_b_mode: advanced settings: (currently) not used
mainconcept.me_weighted_b_mode: 0
# long: enable_fast_intra_decisions: advanced settings: enables fast intra decisions
mainconcept.enable_fast_intra_decisions: 2
# long: enable_fast_inter_decisions: advanced settings: enables fast inter decisions
mainconcept.enable_fast_inter_decisions: 2
# long: pic_ar_x: advanced settings: picture aspect ratio: horizontal size
mainconcept.pic_ar_x: -1
# long: pic_ar_y: advanced settings: picture aspect ratio: vertical size
mainconcept.pic_ar_y: -1
# long: calc_quality: advanced settings: calculate PSNR or not
mainconcept.calc_quality: 0
# long: cpu_opt: advanced settings: cpu optimization
mainconcept.cpu_opt: 0
# long: num_threads: advanced settings: number of threads
mainconcept.num_threads: 0
# long: live_mode: advanced settings: online or offline mode (not yet implemented)
mainconcept.live_mode: 0
# long: buffering: advanced settings: maximum number of seconds to buffer
mainconcept.buffering: 0
# long: min_quant: advanced settings: minimum quantization parameter
mainconcept.min_quant: 0
# long: max_quant: advanced settings: maximum quantization parameter
mainconcept.max_quant: 51
# long: max_slice_size: advanced settings: maximum slice size in bits, set to 0 if you do not need it
mainconcept.max_slice_size: 0
# long: encoding_buffering: advanced settings: maximum number of seconds to buffer encoding queue
mainconcept.encoding_buffering: 0
# long: low_delay: advanced settings: low delay mode (not yet implemented)
mainconcept.low_delay: 0
# long: air_mode: advanced settings: adaptive intra refresh mode
mainconcept.air_mode: 0
# long: detach_thread: advanced settings: run core in a new thread or not
mainconcept.detach_thread: 1
# long: constrained_intra_pred: advanced settings: constrained intra prediction for improving error resilience
mainconcept.constrained_intra_pred: 0
# long: air_split_frequency: advanced settings: frequency of intra lines for adaptive air mode split
mainconcept.air_split_frequency: 0
# long: air_qp_offset: advanced settings: qp offset for adaptive intra mode lines
mainconcept.air_qp_offset: 0
# long: min_idr_interval: advanced gop settings: min gop length
mainconcept.min_idr_interval: 1
# long: adaptive_b_frames: advanced gop settings: use adaptive B-frames placement or not
mainconcept.adaptive_b_frames: 0
# long: idr_frequency: advanced gop settings: 0 means only first frame is IDR, 1 means every I-frame is IDR, etc
mainconcept.idr_frequency: 1
# long: field_order: advanced gop settings: 0=TFF, 1=BFF
mainconcept.field_order: 0
# long: fixed_i_position: advanced gop settings: constant I frame position
mainconcept.fixed_i_position: 0
# long: isolated_gops: advanced gop settings: allows to limit referencing to frames from the previous GOP, may be useful when idr_frequency != 1
mainconcept.isolated_gops: 0
# long: hierar_p_frames: advanced gop settings: GOP structure with hierarchically coded P frames (for temporal scalability with out using B frames) (not yet supported in enc_avc/trunk)
mainconcept.hierar_p_frames: 0
# long: fast_multi_ref_me: advanced me settings: enables fast decisions for multi-ref ME
mainconcept.fast_multi_ref_me: 1
# long: fast_sub_block_me: advanced me settings: enables fast decisions for sub-block ME
mainconcept.fast_sub_block_me: 1
# long: allow_out_of_pic_mvs: advanced me settings: enables mvs out of picture boundaries
mainconcept.allow_out_of_pic_mvs: 1
# long: constrained_ref_list: advanced me settings: use constrained reference picture list
mainconcept.constrained_ref_list: 0
# long: enable_intra_big: advanced intra settings: allows to use 16x16 intra mode in intra slices
mainconcept.enable_intra_big: 1
# long: enable_intra_8x8: advanced intra settings: same for 8x8
mainconcept.enable_intra_8x8: 1
# long: enable_intra_4x4: advanced intra settings: same for 4x4
mainconcept.enable_intra_4x4: 1
# long: enable_intra_pcm: advanced intra settings: same for PCM
mainconcept.enable_intra_pcm: 0
# long: enable_inter_big: advanced intra settings: allows to use 16x16 intra mode in inter slices
mainconcept.enable_inter_big: 1
# long: enable_inter_8x8: advanced intra settings: same for 8x8
mainconcept.enable_inter_8x8: 1
# long: enable_inter_4x4: advanced intra settings: same for 4x4
mainconcept.enable_inter_4x4: 1
# long: enable_inter_pcm: advanced intra settings: same for PCM
mainconcept.enable_inter_pcm: 0
# long: fast_rd_optimization: advanced rdo settings: allows fast RDO
mainconcept.fast_rd_optimization: 1
# long: quant_mode: advanced rdo settings: quantization optimization mode
mainconcept.quant_mode: 2
# long: grain_mode: advanced rdo settings: granular noise optimization mode, not used any more
mainconcept.grain_mode: 0
# long: grain_opt_strength: advanced rdo settings: scalable film grain optimization [0..100], use 0 to turn it off
mainconcept.grain_opt_strength: 0
# long[8]: adaptive_quant_strength: advanced rdo settings: adaptive quantization strength [-100..100] or every mode (from H264_AQUANT_MODE_BRIGHTNESS to COMPLEXITY), last 5 strengths are not used at the moment
mainconcept.adaptive_quant_strength: 0,0,0,0,0,0,0,0
# long: denoise_strength_y: Psycho-visual enhancement: denoise strength for luma [0..100]
mainconcept.denoise_strength_y: 0
# long: denoise_strength_c: Psycho-visual enhancement: denoise strength for chroma [0..100]
mainconcept.denoise_strength_c: 0
# long: black_norm_level: Psycho-visual enhancement: black normalization level, any luma less than or equal to black_norm_level will be set to 16
mainconcept.black_norm_level: 0
# long: pulse_reduction: Psycho-visual enhancement: key frame pulsing reduction
mainconcept.pulse_reduction: 0
# long: aux_format_idc: alpha plane: aux_format_idc
mainconcept.aux_format_idc: -1
# long: bit_depth_aux: alpha plane: bit_depth_aux
mainconcept.bit_depth_aux: 8
# long: alpha_incr_flag: alpha plane: alpha_incr_flag
mainconcept.alpha_incr_flag: 0
# long: alpha_opaque_value: alpha plane: alpha_opaque_value
mainconcept.alpha_opaque_value: 0
# long: alpha_transparent_value: alpha plane: alpha_transparent_value
mainconcept.alpha_transparent_value: 0
# long: seq_scaling_matrix_present_flag: seq_scaling_list_present_flag equal[i] to 1 specifies that the syntax structure
mainconcept.seq_scaling_matrix_present_flag: 0
# long[8]: seq_scaling_list_present_flag: for scaling list i is present in the sequence parameter set (and not in the picture parameter set)
mainconcept.seq_scaling_list_present_flag: 0,0,0,0,0,0,0,0
# long[16]: intra_y_4x4_scaling_list: scaling lists: intra_y_4x4_scaling_list
mainconcept.intra_y_4x4_scaling_list: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# long[16]: intra_cb_4x4_scaling_list: scaling lists: intra_cb_4x4_scaling_list
mainconcept.intra_cb_4x4_scaling_list: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# long[16]: intra_cr_4x4_scaling_list: scaling lists: intra_cr_4x4_scaling_list
mainconcept.intra_cr_4x4_scaling_list: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# long[16]: inter_y_4x4_scaling_list: scaling lists: inter_y_4x4_scaling_list
mainconcept.inter_y_4x4_scaling_list: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# long[16]: inter_cb_4x4_scaling_list: scaling lists: inter_cb_4x4_scaling_list
mainconcept.inter_cb_4x4_scaling_list: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# long[16]: inter_cr_4x4_scaling_list: scaling lists: inter_cr_4x4_scaling_list
mainconcept.inter_cr_4x4_scaling_list: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# long[64]: intra_y_8x8_scaling_list: scaling lists: intra_y_8x8_scaling_list
mainconcept.intra_y_8x8_scaling_list: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# long[64]: inter_y_8x8_scaling_list: scaling lists: inter_y_8x8_scaling_list
mainconcept.inter_y_8x8_scaling_list: 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
# long: performance_level: (0-15) 0:H264_PERF_FASTEST, 9:H264_PERF_BALANCED, 15:H264_PERF_BEST_Q
mainconcept.performance_level: -1
# long: keyframe_follow: 0:off, 1:on (default)
mainconcept.keyframe_follow: 1
# long: maintain_original_pts: 0:off, 1:on (default)
mainconcept.maintain_original_pts: 1
# long: colour_primaries: 0:auto (default), 1: ITU-R Rec. BT.709-5, 4: ITU-R Rec. BT.470-6 System M, 5: ITU-R Rec. BT.601-6 625, 6: ITU-R Rec. BT.601-6 525, 7: SMPTE 240M, 8: Generic film (colour filters using Illuminant C), 9: Rec. ITU-R BT.2020
mainconcept.colour_primaries: 0
# long: transfer_characteristics: 0:auto (default), 1: BT.709-5,4: BT.470-6 System M,5: BT.470-6 System B G,6: BT.709-5,7: SMPTE 240M,8: Linear,14: Rec. ITU-R BT.2020
mainconcept.transfer_characteristics: 0
# long: matrix_coefficients: 0:auto (default), 1: BT.709-5 System 1125, 4..6: BT.709-5 System 1250, 7: SMPTE 240M, 9: Rec. ITU-R BT.2020 non-constant luminance system
mainconcept.matrix_coefficients: 0
# long: extended_sar: Enable extended sample aspect ratio
mainconcept.extended_sar: 0 

These are the parameters available for your audio.

# long: channel copy: 0=donothing, 1=copy-left-over-right, 2=copy-right-over-left
mainconcept.channel_copy: 0
# long: crc protection: 0=off, 1=on
mainconcept.protect_adts_stream: 0
# long: high frequency cut-off
mainconcept.hf_cutoff: 12000
# long: mpeg version: 6=MPEG2_AAC_AUDIO, 7=MPEG4_AAC_AUDIO, 16=MPEG4_AAC_AUDIO_PSP
mainconcept.mpeg_version: 7
# long: variable bitrate mode: 0 = off
mainconcept.vbr: 0
# long: temporal noise shaping (tns) algorithm: 0=off, 1=on
mainconcept.tns: 1
# long: aac object type
mainconcept.aac_object_type: 2
# long: high efficiency: 0=off, 1=HE-v1, 2=HE-v2
mainconcept.he: 0

I extracted this from the logfile using the following command

awk 'BEGIN { FS="\t" } { print $9 }'  wowzastreamingengine_access.log | grep 'mainconcept\|^#' > parameters.log
Categories
Uncategorized

WSL2 / Vmmem

There is an ongoing issue with vmmem eating up all your memory in windows 10 2004. There is a workaround.

Workaround: Create a %UserProfile%\.wslconfig file in Windows and use it to limit memory assigned to WSL2 VM.

Apostolos
https://github.com/microsoft/WSL/issues/4166#issuecomment-526725261

Below is an example of .wslconfig

[wsl2]
memory=6GB
swap=0
localhostForwarding=true
Categories
Uncategorized

icinga/nagios test icecast stream

This is howto monitor an icecast stream that the stream has not gone quiet and to do in during a specific time. First we need a tool to monitor the audio level. This can actually be done with ffmpeg. Below is a command you can do.

ffmpeg -t 10 -i http://example.com/live.mp3 -af "volumedetect" -f null /dev/null 2>&1 | grep Parsed_volumedetect

We do several things here.

  • -t 10 lets us just play the stream we have choosen for 10 seconds before closing ffmpeg
  • -i http://example.com/live.mp3 is our icecast stream we want to monitor
  • -af “volumedetect” is the audio filter we want to apply on the stream.
  • -f null /dev/null is to tell ffmpeg to throw the result away.
  • 2>&1 is very important, nomaly the output from ffmpeg you see on your screen is from stderr, by doing this in the end, we force the output out on the normal stdout giving us the possibilty to pipe the output to our grep command.
  • Lastly  grep Parsed_volumedetect is to only show us the output from the volumedetect filter.

Below we can see the date you can get from volumedetect. The value we want to use is mean_volume which will give us an aproximation on the current audio level in the stream. Max value is zero and anything below -40 db will be considered quite a low volume.

Now is the part where we convert the code above to a icinga/nagios test. I have uploaded a working example using the above code on https://github.com/Dalesjo/dalesjo-nagios/blob/master/media/check_audio_level Below you can se it in action, giving the correct exit code for icinga/nagios of course.

Categories
Linux Uncategorized

Icinga/Nagios test using zonemaster.

Zonemaster is a great tool to verify that you have set up your domainservers correctly. You can test it out on https://zonemaster.iis.se/en/

I want my icinga server to this automaticly so i will get a warning as soon something changes, so lets do that. First thing you need to now is that Zonemaster is a tool and is freely available on Github. you can download it and run it on your own machine.

Categories
Uncategorized

raid0 for varnish

To speed up varnish i choosen to cache data to a mdadm raid0 partition on half the drives (rest is raid1).

Create raid0 partitions (done twice)

(parted) print
Model: ATA ST2000NC001-1DY1 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:
Number Start End Size Type File system Flags
1 1049kB 1001MB 1000MB primary boot, raid
2 1001MB 1009GB 1008GB primary raid

(parted) mkpart
Partition type? primary/extended? primary
File system type? [ext2]? xfs
Start? 1100GB
End? 1900GB

(parted) set 3 raid on
(parted) print
Model: ATA ST2000NC001-1DY1 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 1001MB 1000MB primary boot, raid
2 1001MB 1009GB 1008GB primary raid
3 1100GB 1900GB 800GB primary raid

mdadm raid0

mdadm -C /dev/md0 -l raid0 -n 2 /dev/sd[a-b]3
mkfs.xfs /dev/md0
mdadm --detail --scan >> /etc/mdadm.conf

fstab

To make sure this server can start evan if the raid0 partition fails, add nofail. noatime is added since atime is not needed for this drive.

/dev/md0  /var/lib/varnish/                     xfs     defaults,nofail,noatime 0 0

If it fails

If the drive fails varnish will crash, at a reboot varnish will not start (this is because the file varnish want to use dont fit within the root partition. to fix the raid0 partition, recreate all steps it and mount. dont forget to update /etc/mdadm.conf.