Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b36687c

Browse filesBrowse files
fix/2: copilot messed up
1 parent 53b7540 commit b36687c
Copy full SHA for b36687c

File tree

1 file changed

+6
-10
lines changed
Filter options

1 file changed

+6
-10
lines changed

‎gpff.bash

Copy file name to clipboardExpand all lines: gpff.bash
+6-10
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ function extract_audios() {
114114
local audio_temp_name="audio_stream_$index.m4a"
115115
# here we are going to use -map 0:index instead of -map a:index
116116
# 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 "
118118
echo "$audio_temp_name" >> "$input_filename/audio_list.txt"
119119
done
120120
$ffmpeg_binary -i "$input_file" $lambda_commands
@@ -224,11 +224,7 @@ function divide_video() {
224224
# but in the several test I had, this calculation until ~10.0 had a same outcome.
225225
# we can keep it or ignore it
226226
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')}')
232228
# here we just do some split-copy but I think -copyts is also useful in some cases and it can't hurt
233229
# so do avoid_negative_ts
234230
# 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() {
306302
local lambda_video=""
307303
for resolution in ${resolutions[@]}; do
308304
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_{} "
311307
done
312308
parallel --bar -j 2 \
313309
-S '..,1/:' --delay 0.1 --sshdelay 0.1 --workdir /mnt/data/ \
@@ -370,7 +366,7 @@ function join_audios_videos() {
370366
local lambda_audio_map=""
371367
local counter=1
372368
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 "
374370
lambda_audio_map+=" -map $counter:a "
375371
((counter++))
376372
done
@@ -418,7 +414,7 @@ function make_hls() {
418414
local lambda_audio_map=""
419415
local lambda_audio_copy=""
420416
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 "
422418
lambda_audio_map+=" -map $counter:a:0 "
423419
lambda_audio_copy+=" -c:a:$audio_counter copy -copyts "
424420
var_stream_map+="a:$audio_counter,agroup:vidaud,name:audio_$audio_counter "

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.