Fix video & audio track detection (wrappers)

This commit is contained in:
q3aql 2023-03-12 15:33:06 +01:00
parent 49e6641085
commit 0904ffc312
7 changed files with 53 additions and 56 deletions

View File

@ -2,12 +2,12 @@
############################################################### ###############################################################
# ks-av1-wrapper (ks-tools) - Wrapper for ks-av1 # # ks-av1-wrapper (ks-tools) - Wrapper for ks-av1 #
# Date: 10-03-2023 # # Date: 12-03-2023 #
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
############################################################### ###############################################################
VERSION="8.5-dev" VERSION="8.5-dev"
M_DATE="100323" M_DATE="120323"
# Conversion parameters # Conversion parameters
ks_mp4_to_wrap="/usr/bin/ks-av1" ks_mp4_to_wrap="/usr/bin/ks-av1"
@ -129,7 +129,7 @@ function showInfo() {
# Syntax: showVideoDefault <video_file> # Syntax: showVideoDefault <video_file>
function showVideoDefault() { function showVideoDefault() {
# Check de video track by default # Check de video track by default
video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${video_default}" ] ; then if [ -z "${video_default}" ] ; then
video_default="0:0" video_default="0:0"
else else
@ -147,9 +147,9 @@ function showVideoDefault() {
# Syntax: showAudioDefault <video_file> # Syntax: showAudioDefault <video_file>
function showAudioDefault() { function showAudioDefault() {
# Check the audio track by default # Check the audio track by default
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default="0:1" audio_default="0:1"
else else
@ -175,11 +175,11 @@ function showAudioDefault() {
# Syntax: showSubtitleDefault <video_file> # Syntax: showSubtitleDefault <video_file>
function showSubtitleDefault() { function showSubtitleDefault() {
# Check the subtitle track by default # Check the subtitle track by default
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default="0:3" subtitle_default="0:3"
else else

View File

@ -2,12 +2,12 @@
############################################################### ###############################################################
# ks-av1s-wrapper (ks-tools) - Wrapper for ks-av1s # # ks-av1s-wrapper (ks-tools) - Wrapper for ks-av1s #
# Date: 10-03-2023 # # Date: 12-03-2023 #
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
############################################################### ###############################################################
VERSION="8.5-dev" VERSION="8.5-dev"
M_DATE="100323" M_DATE="120323"
# Conversion parameters # Conversion parameters
ks_mp4s_to_wrap="/usr/bin/ks-av1s" ks_mp4s_to_wrap="/usr/bin/ks-av1s"
@ -129,7 +129,7 @@ function showInfo() {
# Syntax: showVideoDefault <video_file> # Syntax: showVideoDefault <video_file>
function showVideoDefault() { function showVideoDefault() {
# Check de video track by default # Check de video track by default
video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${video_default}" ] ; then if [ -z "${video_default}" ] ; then
video_default="0:0" video_default="0:0"
else else
@ -147,9 +147,9 @@ function showVideoDefault() {
# Syntax: showAudioDefault <video_file> # Syntax: showAudioDefault <video_file>
function showAudioDefault() { function showAudioDefault() {
# Check the audio track by default # Check the audio track by default
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default="0:1" audio_default="0:1"
else else
@ -175,11 +175,11 @@ function showAudioDefault() {
# Syntax: showSubtitleDefault <video_file> # Syntax: showSubtitleDefault <video_file>
function showSubtitleDefault() { function showSubtitleDefault() {
# Check the subtitle track by default # Check the subtitle track by default
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default="0:3" subtitle_default="0:3"
else else

View File

@ -2,12 +2,12 @@
############################################################### ###############################################################
# ks-avi-wrapper (ks-tools) - Wrapper for ks-avi # # ks-avi-wrapper (ks-tools) - Wrapper for ks-avi #
# Date: 10-03-2023 # # Date: 12-03-2023 #
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
############################################################### ###############################################################
VERSION="8.5-dev" VERSION="8.5-dev"
M_DATE="100323" M_DATE="120323"
# Conversion parameters # Conversion parameters
ks_avi_to_wrap="/usr/bin/ks-avi" ks_avi_to_wrap="/usr/bin/ks-avi"
@ -129,7 +129,7 @@ function showInfo() {
# Syntax: showVideoDefault <video_file> # Syntax: showVideoDefault <video_file>
function showVideoDefault() { function showVideoDefault() {
# Check de video track by default # Check de video track by default
video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${video_default}" ] ; then if [ -z "${video_default}" ] ; then
video_default="0:0" video_default="0:0"
else else
@ -147,9 +147,9 @@ function showVideoDefault() {
# Syntax: showAudioDefault <video_file> # Syntax: showAudioDefault <video_file>
function showAudioDefault() { function showAudioDefault() {
# Check the audio track by default # Check the audio track by default
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default="0:1" audio_default="0:1"
else else
@ -175,11 +175,11 @@ function showAudioDefault() {
# Syntax: showSubtitleDefault <video_file> # Syntax: showSubtitleDefault <video_file>
function showSubtitleDefault() { function showSubtitleDefault() {
# Check the subtitle track by default # Check the subtitle track by default
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default="0:3" subtitle_default="0:3"
else else

View File

@ -2,12 +2,12 @@
############################################################### ###############################################################
# ks-mp4-wrapper (ks-tools) - Wrapper for ks-mp4 # # ks-mp4-wrapper (ks-tools) - Wrapper for ks-mp4 #
# Date: 10-03-2023 # # Date: 12-03-2023 #
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
############################################################### ###############################################################
VERSION="8.5-dev" VERSION="8.5-dev"
M_DATE="100323" M_DATE="120323"
# Conversion parameters # Conversion parameters
ks_mp4_to_wrap="/usr/bin/ks-mp4" ks_mp4_to_wrap="/usr/bin/ks-mp4"
@ -129,7 +129,7 @@ function showInfo() {
# Syntax: showVideoDefault <video_file> # Syntax: showVideoDefault <video_file>
function showVideoDefault() { function showVideoDefault() {
# Check de video track by default # Check de video track by default
video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${video_default}" ] ; then if [ -z "${video_default}" ] ; then
video_default="0:0" video_default="0:0"
else else
@ -147,9 +147,9 @@ function showVideoDefault() {
# Syntax: showAudioDefault <video_file> # Syntax: showAudioDefault <video_file>
function showAudioDefault() { function showAudioDefault() {
# Check the audio track by default # Check the audio track by default
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default="0:1" audio_default="0:1"
else else
@ -175,11 +175,11 @@ function showAudioDefault() {
# Syntax: showSubtitleDefault <video_file> # Syntax: showSubtitleDefault <video_file>
function showSubtitleDefault() { function showSubtitleDefault() {
# Check the subtitle track by default # Check the subtitle track by default
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default="0:3" subtitle_default="0:3"
else else

View File

@ -2,12 +2,12 @@
############################################################### ###############################################################
# ks-mp4k-wrapper (ks-tools) - Wrapper for ks-mp4k # # ks-mp4k-wrapper (ks-tools) - Wrapper for ks-mp4k #
# Date: 10-03-2023 # # Date: 12-03-2023 #
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
############################################################### ###############################################################
VERSION="8.5-dev" VERSION="8.5-dev"
M_DATE="100323" M_DATE="120323"
# Conversion parameters # Conversion parameters
ks_mp4k_to_wrap="/usr/bin/ks-mp4k" ks_mp4k_to_wrap="/usr/bin/ks-mp4k"
@ -129,7 +129,7 @@ function showInfo() {
# Syntax: showVideoDefault <video_file> # Syntax: showVideoDefault <video_file>
function showVideoDefault() { function showVideoDefault() {
# Check de video track by default # Check de video track by default
video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${video_default}" ] ; then if [ -z "${video_default}" ] ; then
video_default="0:0" video_default="0:0"
else else
@ -147,9 +147,9 @@ function showVideoDefault() {
# Syntax: showAudioDefault <video_file> # Syntax: showAudioDefault <video_file>
function showAudioDefault() { function showAudioDefault() {
# Check the audio track by default # Check the audio track by default
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default="0:1" audio_default="0:1"
else else
@ -175,11 +175,11 @@ function showAudioDefault() {
# Syntax: showSubtitleDefault <video_file> # Syntax: showSubtitleDefault <video_file>
function showSubtitleDefault() { function showSubtitleDefault() {
# Check the subtitle track by default # Check the subtitle track by default
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default="0:3" subtitle_default="0:3"
else else

View File

@ -2,12 +2,12 @@
############################################################### ###############################################################
# ks-mp4s-wrapper (ks-tools) - Wrapper for ks-mp4s # # ks-mp4s-wrapper (ks-tools) - Wrapper for ks-mp4s #
# Date: 10-03-2023 # # Date: 12-03-2023 #
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
############################################################### ###############################################################
VERSION="8.5-dev" VERSION="8.5-dev"
M_DATE="100323" M_DATE="120323"
# Conversion parameters # Conversion parameters
ks_mp4s_to_wrap="/usr/bin/ks-mp4s" ks_mp4s_to_wrap="/usr/bin/ks-mp4s"
@ -129,7 +129,7 @@ function showInfo() {
# Syntax: showVideoDefault <video_file> # Syntax: showVideoDefault <video_file>
function showVideoDefault() { function showVideoDefault() {
# Check de video track by default # Check de video track by default
video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${video_default}" ] ; then if [ -z "${video_default}" ] ; then
video_default="0:0" video_default="0:0"
else else
@ -147,9 +147,9 @@ function showVideoDefault() {
# Syntax: showAudioDefault <video_file> # Syntax: showAudioDefault <video_file>
function showAudioDefault() { function showAudioDefault() {
# Check the audio track by default # Check the audio track by default
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default="0:1" audio_default="0:1"
else else
@ -175,11 +175,11 @@ function showAudioDefault() {
# Syntax: showSubtitleDefault <video_file> # Syntax: showSubtitleDefault <video_file>
function showSubtitleDefault() { function showSubtitleDefault() {
# Check the subtitle track by default # Check the subtitle track by default
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | grep "(forced)" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | grep "(${default_lang_subt})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) subtitle_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Subtitle:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${subtitle_default}" ] ; then if [ -z "${subtitle_default}" ] ; then
subtitle_default="0:3" subtitle_default="0:3"
else else

View File

@ -2,21 +2,18 @@
############################################################### ###############################################################
# ks-vob-wrapper (ks-tools) - Wrapper for ks-vob # # ks-vob-wrapper (ks-tools) - Wrapper for ks-vob #
# Date: 10-03-2023 # # Date: 12-03-2023 #
# Author: q3aql # # Author: q3aql #
# Contact: q3aql@duck.com # # Contact: q3aql@duck.com #
############################################################### ###############################################################
VERSION="8.5-dev" VERSION="8.5-dev"
M_DATE="100323" M_DATE="120323"
# Conversion parameters # Conversion parameters
ks_vob_to_wrap="/usr/bin/ks-vob" ks_vob_to_wrap="/usr/bin/ks-vob"
p_ffmpeg="ffmpeg -i" p_ffmpeg="ffmpeg -i"
p_ffmpeg_patched="-max_muxing_queue_size 9999" p_ffmpeg_patched="-max_muxing_queue_size 9999"
rel_size="720x480" rel_size="720x480"
configFolder=${HOME}/.ks-tools
configFile=${configFolder}/ks-vob
source ${configFile}
# Check cygwin alias (for Windows) # Check cygwin alias (for Windows)
if [ -f "/usr/bin/cygwin-alias.sh" ] ; then if [ -f "/usr/bin/cygwin-alias.sh" ] ; then
@ -67,7 +64,7 @@ function showInfo() {
# Syntax: showVideoDefault <video_file> # Syntax: showVideoDefault <video_file>
function showVideoDefault() { function showVideoDefault() {
# Check de video track by default # Check de video track by default
video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) video_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Video:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${video_default}" ] ; then if [ -z "${video_default}" ] ; then
video_default="0:0" video_default="0:0"
else else
@ -85,9 +82,9 @@ function showVideoDefault() {
# Syntax: showAudioDefault <video_file> # Syntax: showAudioDefault <video_file>
function showAudioDefault() { function showAudioDefault() {
# Check the audio track by default # Check the audio track by default
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | grep "(${default_lang_audio})" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | head -1) audio_default=$(${p_ffmpeg} "${1}" 2>&1 | grep Stream | tr -s " " | grep "Audio:" | cut -d " " -f 3 | cut -c2-5 | cut -d "(" -f 1 | cut -d "[" -f 1 | head -1)
if [ -z "${audio_default}" ] ; then if [ -z "${audio_default}" ] ; then
audio_default="0:1" audio_default="0:1"
else else