/useful/trunk-1

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/useful/trunk-1

« back to all changes in this revision

Viewing changes to scripts/enc2firefox.sh

  • Committer: Gustav Hartvigsson
  • Date: 2024-07-10 14:25:13 UTC
  • Revision ID: git-v1:55fc68b13933a25315ad96a4c69e64d962d2c2d4
Fixed install script's --target flag.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
####
3
3
# FILE NAME: enc2firefox.sh
4
4
#
5
 
# Authors:
6
 
#    Gustav Hartvigsson 2024
7
 
#    Distributed under the Cool Licence 1.1
8
 
#
9
5
# Encodes (mp4/x264) videos so they can be played in firefox.
10
6
#
11
7
# Updates:
16
12
# 2021-01-13:
17
13
#   * Fixed up if statments
18
14
#
19
 
# 2024-07-10
20
 
#  * Simplefied if-else-statement.
21
 
#
22
15
####
23
16
 
24
17
__IN_NAME=""
124
117
}
125
118
 
126
119
__main () {
127
 
  if [[ ! -e "$__IN_NAME" ]]; then
 
120
  if [[ ! -e "$__IN_NAME" ]]
 
121
  then
128
122
    echo "missing input audio. Please provide."
129
123
    exit 1
130
124
  fi
131
125
  
132
 
  if [[ $__OUT_NAME == "" ]]; then
 
126
  if [[ $__OUT_NAME == "" ]]
 
127
  then
133
128
    echo "missing output file name. Please provide."
134
129
    exit 1
135
130
  fi
136
 
 
137
 
  if [[ $__USE_WEBM == true ]]; then
138
 
    if [[ $__IN_NAME == $__OUT_NAME.webm ]]; then
 
131
  
 
132
  
 
133
  if [[ $__USE_WEBM == true ]]
 
134
  then
 
135
    if [[ $__IN_NAME == $__OUT_NAME.webm ]]
 
136
    then
139
137
      echo "Filenames can't be the same."
140
138
      exit
141
139
    fi
142
140
    __enc_webm
143
 
  elif [[ $__IN_NAME == $__OUT_NAME.mp4 ]]; then
144
 
    if [[ $__USE_FJ == true ]]; then
145
 
      __enc_fj
146
 
    else
147
 
      __enc_mp4
 
141
  elif [[ $__USE_FJ == true ]]
 
142
  then
 
143
    if [[ $__IN_NAME == $__OUT_NAME.mp4 ]]
 
144
    then
 
145
      echo "Filenames can't be the same."
 
146
      exit
148
147
    fi
 
148
    __enc_fj
149
149
  else
150
 
    echo " Input and output files can't be the same."
151
 
    exit
 
150
    if [[ $__IN_NAME == $__OUT_NAME.mp4 ]]
 
151
    then
 
152
      echo "Filenames can't be the same."
 
153
      exit
 
154
    fi
 
155
    __enc_mp4
152
156
  fi
153
157
}
154
158