@@ -114,7 +114,7 @@ function extract_audios() {
114
114
local audio_temp_name=" audio_stream_$index .m4a"
115
115
# here we are going to use -map 0:index instead of -map a:index
116
116
# that's because we are getting the total index number not index in audio streams
117
- lambda_commands+=" -map 0:" $index " -copyts -map_chapters -1 -c copy \" $input_filename /$audio_temp_name \" "
117
+ lambda_commands+=" -map 0:" $index " -copyts -map_chapters -1 -c copy $input_filename /$audio_temp_name "
118
118
echo " $audio_temp_name " >> " $input_filename /audio_list.txt"
119
119
done
120
120
$ffmpeg_binary -i " $input_file " $lambda_commands
@@ -224,11 +224,7 @@ function divide_video() {
224
224
# but in the several test I had, this calculation until ~10.0 had a same outcome.
225
225
# we can keep it or ignore it
226
226
local frame_rate=$( $ffprobe_binary -v 0 -of csv=p=0 -select_streams v:0 -show_entries stream=r_frame_rate $input_file )
227
- if [[ ! " $frame_rate " =~ ^[0-9]+ ([.][0-9]+)? (/[0-9]+ ([.][0-9]+)? )? $ ]]; then
228
- echo " Error: Invalid frame rate: $frame_rate "
229
- exit 1
230
- fi
231
- local segment_time_delta=$( echo " scale=6; 1/(2*($frame_rate ))" | bc)
227
+ local segment_time_delta=$( awk ' BEGIN{printf "%6f", 1/(2*' $frame_rate ' )}' )
232
228
# here we just do some split-copy but I think -copyts is also useful in some cases and it can't hurt
233
229
# so do avoid_negative_ts
234
230
# this is important to note that WE DO NOT COPY/transfer ANY SUBTITLES!!! because I have had problem in some
@@ -306,8 +302,8 @@ function process_video_transcode_hpc_parallel() {
306
302
local lambda_video=" "
307
303
for resolution in ${resolutions[@]} ; do
308
304
lambda_video+=" -pix_fmt yuv420p -fps_mode passthrough -vcodec h264 \
309
- -vf scale=-2:$resolution \" $input_filename /transcoded_${resolution} p_{}\" "
310
- lambda_video_return+=" --return \" $input_filename /transcoded_${resolution} p_{}\" "
305
+ -vf scale=-2:$resolution $input_filename /transcoded_${resolution} p_{} "
306
+ lambda_video_return+=" --return $input_filename /transcoded_${resolution} p_{} "
311
307
done
312
308
parallel --bar -j 2 \
313
309
-S ' ..,1/:' --delay 0.1 --sshdelay 0.1 --workdir /mnt/data/ \
@@ -370,7 +366,7 @@ function join_audios_videos() {
370
366
local lambda_audio_map=" "
371
367
local counter=1
372
368
for audio_filename in $( cat " $input_filename /audio_list.txt" ) ; do
373
- lambda_audio+=" -i \" $input_filename /transcoded_$audio_filename \" "
369
+ lambda_audio+=" -i $input_filename /transcoded_$audio_filename "
374
370
lambda_audio_map+=" -map $counter :a "
375
371
(( counter++ ))
376
372
done
@@ -418,7 +414,7 @@ function make_hls() {
418
414
local lambda_audio_map=" "
419
415
local lambda_audio_copy=" "
420
416
for audio_filename in $( cat " $input_filename /audio_list.txt" ) ; do
421
- lambda_audio+=" -i \" $input_filename /transcoded_$audio_filename \" "
417
+ lambda_audio+=" -i $input_filename /transcoded_$audio_filename "
422
418
lambda_audio_map+=" -map $counter :a:0 "
423
419
lambda_audio_copy+=" -c:a:$audio_counter copy -copyts "
424
420
var_stream_map+=" a:$audio_counter ,agroup:vidaud,name:audio_$audio_counter "
0 commit comments