Files
audio2motion/scripts/BG_Actor6/get-reference-frame-4R3A0205.ipynb
2022-09-01 11:54:15 +08:00

870 KiB

In [1]:
import os
from pathlib import Path
import numpy as np
import json
np.set_printoptions(precision=2, suppress=True)

from pathlib import Path
import numpy as np
# Importing packages
import matplotlib.pyplot as plt
%matplotlib inline

from jupyterthemes import jtplot
jtplot.style(grid=False)


pose_select = [0, 2, 5, 3, 6, 4, 7]
pose_weight = [1, 1, 1, 5, 5, 10, 10]


# filter by windows
def filter_peaks(x, input_peaks, nwind= 1*50):
    peaks = input_peaks.copy()
    peaks_filter = []

    i = 1
    prev_idx = peaks[0]
    while i < len(peaks):
        cur_idx = peaks[i]

        # filter peak
        while cur_idx - prev_idx <= nwind and i < len(peaks):
            # compare ssim
            if x[cur_idx] > x[prev_idx]:
                prev_idx = cur_idx
            # next 
            i += 1
            if i < len(peaks):
                cur_idx = peaks[i]  
            else:
                break
        # update 
        i += 1 

        # add to 
        peaks_filter.append(prev_idx)
        prev_idx = cur_idx

    # last value
    if cur_idx - peaks_filter[-1] > nwind:
        peaks_filter.append(prev_idx)
    # peaks_filter.append(prev_idx)


    return peaks_filter


def get_landmarks(idx, path_ldmks):
    # get lmd_distance 
    path_json = path_ldmks.joinpath(f"frame-{idx:06d}_keypoints.json")
    dict_json = json.loads(open(str(path_json), 'r').read())['people']
    data_ldmk_pose = np.array(dict_json[0]["pose_keypoints"]).reshape(-1, 3)
    # data_ldmk_face = np.array(dict_json[0]["face_keypoints"]).reshape(-1, 3)

    # select & concate pose
    data_ldmk_pose = data_ldmk_pose[pose_select, :2]  # COCO-18 body pose 
    # data_ldmk_pose = data_ldmk_pose[:,   :2]  # 18 body pose 

    # data_ldmk_face = data_ldmk_face[:17, :2]   # 70 landmarks pose

    # data_ldmk = np.concatenate([data_ldmk_pose, data_ldmk_face], axis=0) # (88, 2)
    # print(data_ldmk.shape)
    data_ldmk = data_ldmk_pose


    return data_ldmk 
In [2]:
# fname = "4R3A0156" 
fname = "4R3A0205" # bad data

path_root = Path("/mfs/lsen/DATA/Actor6/bg/processing2_0810")

path_video = path_root.joinpath(fname, "video") 
path_ldmks = path_root.joinpath(fname, "openpose")
path_video.mkdir(parents=True, exist_ok=True)
path_frame = path_root.joinpath(fname, "frames")
In [3]:
vpath_ldmks = sorted(path_ldmks.glob("frame-*_keypoints.json"), reverse=False)

# load pose
total_ldmks = []
for idx, ipath_ldmk in enumerate(vpath_ldmks):
    if idx % 500 ==0: print(f"\t processing... {idx:05d}-th json ")
    idata_peak = get_landmarks(idx, path_ldmks)
    total_ldmks.append(idata_peak)
    # print(idata_peak.shape)

total_ldmks = np.stack(total_ldmks, axis=0)

path_save_total = path_video.joinpath("openpose_total.npy")
np.save(path_save_total, total_ldmks)   # (nseqs, N, 2)

print(total_ldmks.shape)
	 processing... 00000-th json 
	 processing... 00500-th json 
	 processing... 01000-th json 
	 processing... 01500-th json 
	 processing... 02000-th json 
	 processing... 02500-th json 
	 processing... 03000-th json 
	 processing... 03500-th json 
	 processing... 04000-th json 
	 processing... 04500-th json 
	 processing... 05000-th json 
	 processing... 05500-th json 
	 processing... 06000-th json 
	 processing... 06500-th json 
	 processing... 07000-th json 
	 processing... 07500-th json 
	 processing... 08000-th json 
	 processing... 08500-th json 
	 processing... 09000-th json 
	 processing... 09500-th json 
	 processing... 10000-th json 
	 processing... 10500-th json 
	 processing... 11000-th json 
	 processing... 11500-th json 
	 processing... 12000-th json 
	 processing... 12500-th json 
	 processing... 13000-th json 
	 processing... 13500-th json 
	 processing... 14000-th json 
	 processing... 14500-th json 
	 processing... 15000-th json 
	 processing... 15500-th json 
	 processing... 16000-th json 
	 processing... 16500-th json 
	 processing... 17000-th json 
	 processing... 17500-th json 
	 processing... 18000-th json 
	 processing... 18500-th json 
	 processing... 19000-th json 
	 processing... 19500-th json 
	 processing... 20000-th json 
	 processing... 20500-th json 
	 processing... 21000-th json 
	 processing... 21500-th json 
	 processing... 22000-th json 
	 processing... 22500-th json 
	 processing... 23000-th json 
	 processing... 23500-th json 
(23521, 7, 2)
In [4]:
# get velocity 
velocity = total_ldmks[1:] - total_ldmks[:-1]               # (8321, 7, 2)
print(velocity.shape)

distance = np.sqrt(velocity[..., 0]**2 + velocity[..., 1]**2 )  # (8321, 7)
print(distance.shape)

pose_weight = [1, 1, 1, 5, 5, 10, 10]
weight_norm = np.array([pose_weight]) / np.sum(pose_weight)     # (1, 7)
print(weight_norm.shape)

distance = distance * weight_norm       # (8321, 7)
distance = np.mean(distance, axis=1)                          # (N) -> 1 
print(distance.shape)
(23520, 7, 2)
(23520, 7)
(1, 7)
(23520,)
In [10]:
x = - distance[::50]
height = -10

# Plot a simple line chart without any feature
plt.figure(figsize=(30,10))
plt.plot(range(x.shape[0]), x)
plt.plot(range(x.shape[0]), np.full(x.shape, height))
plt.ylim(-2, 0.1)

plt.show()
In [45]:
# 获取一些候选Reference帧
# (1)windows窗内的 max velocity < 0.1
nwindow = int(0.1 * 50) # 0.5s 
max_threold = 0.15

candidate_reference = set()

for i in range(nwindow//2, len(distance)-nwindow//2):

    if max(distance[i-nwindow//2 : i+nwindow//2]) < max_threold:
        _ = [candidate_reference.add(i) for i in range(i-nwindow//2, i+nwindow//2) ]


candidate_reference = sorted(list(candidate_reference))


print(f"size = {len(candidate_reference)}, ratio = {100*len(candidate_reference) / len(distance)} % ")
print(candidate_reference[:100])
print(distance[candidate_reference[:100]])
size = 4981, ratio = 21.177721088435373 % 
[40, 41, 42, 43, 50, 51, 52, 53, 58, 59, 60, 61, 186, 187, 188, 189, 190, 191, 245, 246, 247, 248, 260, 261, 262, 263, 264, 265, 272, 273, 274, 275, 291, 292, 293, 294, 295, 296, 297, 298, 299, 303, 304, 305, 306, 307, 308, 309, 310, 311, 315, 316, 317, 318, 319, 320, 407, 408, 409, 410, 429, 430, 431, 432, 433, 510, 511, 512, 513, 514, 515, 542, 543, 544, 545, 558, 559, 560, 561, 562, 564, 565, 566, 567, 568, 569, 570, 571, 572, 573, 574, 575, 576, 577, 578, 579, 580, 581, 582, 583]
[0.03 0.01 0.11 0.01 0.01 0.03 0.11 0.01 0.12 0.01 0.12 0.11 0.11 0.11
 0.03 0.02 0.01 0.   0.11 0.11 0.13 0.11 0.11 0.11 0.03 0.03 0.13 0.03
 0.   0.01 0.   0.01 0.01 0.01 0.01 0.11 0.11 0.   0.13 0.01 0.03 0.03
 0.01 0.   0.03 0.03 0.   0.02 0.   0.   0.   0.   0.   0.01 0.   0.01
 0.11 0.14 0.   0.03 0.01 0.01 0.01 0.01 0.   0.03 0.01 0.01 0.12 0.14
 0.01 0.02 0.01 0.01 0.13 0.   0.   0.01 0.   0.   0.14 0.05 0.03 0.03
 0.   0.   0.11 0.02 0.01 0.   0.   0.01 0.   0.   0.   0.11 0.03 0.03
 0.01 0.03]
In [13]:
# 根据候选帧 去计算一个平均的帧
candidate_ldmks = total_ldmks[candidate_reference]  # (nseqs, 7, 2)
mean_ldmks  = np.mean(candidate_ldmks, axis=0)  # (7, 2)
print(mean_ldmks.shape)


path_save_mean_ldmks = path_video.joinpath("mean_ldmks.npy")
np.save(path_save_mean_ldmks, mean_ldmks)   # (7, 2)
(7, 2)
In [14]:
# 根据这个平均值去计算,每一帧与其的相似度 (用 cos similarity)
# cacluate LMD-smilirity
total_LMD = []
vpath_ldmks = sorted(path_ldmks.glob("frame-*_keypoints.json"), reverse=False)

for k in range(len(vpath_ldmks)):
    if k % 500 ==0: print(f"\t processing... {k:05d}-th json ")
    kdata_ldmk = get_landmarks(k, path_ldmks)

    # calculate LMD 
    idiff = (kdata_ldmk - mean_ldmks) * (kdata_ldmk - mean_ldmks)                # (N, 2)
    idiff = np.sqrt( idiff[:, 0] + idiff[:, 1]) * np.array(pose_weight)          # (N, )
    idistance = idiff.sum() / np.sum(pose_weight)                                # (N) -> 1 

    total_LMD.append(idistance)
    # print(idistance)

# save 
total_LMD = np.array(total_LMD)
path_save = path_video.joinpath(f"lmd_ref_mean.npy")
np.save(path_save, np.array(total_LMD))
print(f"total_LMD shape = {total_LMD.shape}, save to > {path_save}")
	 processing... 00000-th json 
	 processing... 00500-th json 
	 processing... 01000-th json 
	 processing... 01500-th json 
	 processing... 02000-th json 
	 processing... 02500-th json 
	 processing... 03000-th json 
	 processing... 03500-th json 
	 processing... 04000-th json 
	 processing... 04500-th json 
	 processing... 05000-th json 
	 processing... 05500-th json 
	 processing... 06000-th json 
	 processing... 06500-th json 
	 processing... 07000-th json 
	 processing... 07500-th json 
	 processing... 08000-th json 
	 processing... 08500-th json 
	 processing... 09000-th json 
	 processing... 09500-th json 
	 processing... 10000-th json 
	 processing... 10500-th json 
	 processing... 11000-th json 
	 processing... 11500-th json 
	 processing... 12000-th json 
	 processing... 12500-th json 
	 processing... 13000-th json 
	 processing... 13500-th json 
	 processing... 14000-th json 
	 processing... 14500-th json 
	 processing... 15000-th json 
	 processing... 15500-th json 
	 processing... 16000-th json 
	 processing... 16500-th json 
	 processing... 17000-th json 
	 processing... 17500-th json 
	 processing... 18000-th json 
	 processing... 18500-th json 
	 processing... 19000-th json 
	 processing... 19500-th json 
	 processing... 20000-th json 
	 processing... 20500-th json 
	 processing... 21000-th json 
	 processing... 21500-th json 
	 processing... 22000-th json 
	 processing... 22500-th json 
	 processing... 23000-th json 
	 processing... 23500-th json 
total_LMD shape = (23521,), save to > /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/lmd_ref_mean.npy
In [46]:
x = - total_LMD[1000:10000]
height = -10

# Plot a simple line chart without any feature
plt.figure(figsize=(30,10))
plt.plot(range(x.shape[0]), x)
plt.plot(range(x.shape[0]), np.full(x.shape, height))
plt.ylim(-400, 1)

plt.show()
In [48]:
# 找一些最佳的点 (连续不动的地方)
candidate_reference_update = []

i = 0
while i < len(candidate_reference)-1:

    idx_frame_curr = candidate_reference[i]
    idx_frame_next = candidate_reference[i+1]

    min_idx, min_lmd = idx_frame_curr, total_LMD[idx_frame_curr]
    while i < len(candidate_reference) -1 and idx_frame_next - idx_frame_curr < 50 * 1 :  # 连续index

        idx_frame_curr = candidate_reference[i]
        idx_frame_next = candidate_reference[i+1]

        if total_LMD[idx_frame_next] < min_lmd:
            min_idx, min_lmd = idx_frame_next, total_LMD[idx_frame_next]
        
        i += 1
    

    candidate_reference_update.append(min_idx)

    i += 1

print("candidate_reference_update size = ", len(candidate_reference_update))
candidate_reference_update size =  148
In [49]:
# candidate_reference_update 
# ===> 相似度要大于一定的值

min_ldm_threa = 75
candidate_reference_update2 = []
for icand in candidate_reference_update:
    if total_LMD[icand] < min_ldm_threa:
        candidate_reference_update2.append(icand)

print("candidate_reference_update2 size = ", len(candidate_reference_update2))
candidate_reference_update2 size =  130
In [50]:
x = - total_LMD[:10000]
height = -75

peaks = np.array(candidate_reference_update)
peaks = peaks[peaks < 10000]

# Plot a simple line chart without any feature
plt.figure(figsize=(30,10))
plt.plot(range(x.shape[0]), x)
plt.plot(range(x.shape[0]), np.full(x.shape, height))
plt.ylim(-200, 1)
plt.plot(peaks, x[peaks], "o", color="r", label="peaks")

plt.xticks(peaks,rotation=90)


plt.show()
In [51]:
x = - total_LMD[:10000]
height = -75

peaks = np.array(candidate_reference_update2)
peaks = peaks[peaks < 10000]

# Plot a simple line chart without any feature
plt.figure(figsize=(30,10))
plt.plot(range(x.shape[0]), x)
plt.plot(range(x.shape[0]), np.full(x.shape, height))
plt.ylim(-200, 1)
plt.plot(peaks, x[peaks], "o", color="r", label="peaks")

plt.xticks(peaks,rotation=90)


plt.show()
In [38]:
import tempfile
import os

def concate_video(path_frames, idx_beg, idx_end, path_save):

    # write to a input.txt 
    file_tmp = tempfile.NamedTemporaryFile(suffix='.txt')

    files = [ str(path_frames.joinpath(f"frame-{i:06d}.jpg")) for i in range(idx_beg, idx_end)]
    with open(file_tmp.name, 'w') as f:
        for ifiles in files:
            f.write(f"file {ifiles} \n")

    # with open(file_tmp.name, 'r') as f:
    #     read = f.readlines()
    #     print(read)

    # concate to a video 
    cmd = f"ffmpeg -y -r 50  -f concat -safe 0 -i {str(file_tmp.name)} -c:v libx264 -pix_fmt yuv420p -loglevel error  {str(path_save)}"
    print(cmd)
    os.system(cmd)

    print(f"frame=[{idx_beg},{idx_end}] duration={(idx_end - idx_beg)/50}s. save video to {path_save}")
    
In [52]:
# cut video
ipath_video_save = path_video.joinpath(f"video_split_ref_mean_update2")
ipath_video_save.mkdir(parents=True, exist_ok=True)


peaks_filter = candidate_reference_update2

# ipath_video_log = path_video.joinpath(f"video_split_ref_mean2.manifest")
# dict_manifest = {}

for i in range(0, len(peaks_filter)-1):

    # if i > 15: break
    
    idx_beg = peaks_filter[i]
    idx_end = peaks_filter[i+1]
    
    nsize = idx_end - idx_beg + 1

    # filter small video
    if nsize < 50 * 1: continue  # < 1s 


    duration     = nsize/50
    duration_pad = nsize//50 + 1
    nframe_pad = duration_pad * 50 - nsize
    
    print(f"frame=[{idx_beg},{idx_end}] nframes = {nsize}, duration={duration}, duration_pad = {duration_pad}, need padding {nframe_pad / 2}")

    # make 32 padding 
    # resampling
    ipath_save = ipath_video_save.joinpath(f"split_{i:02d}_{idx_beg:05d}_{idx_end:05d}.mp4")
    concate_video(path_frame, idx_beg, idx_end, ipath_save)
frame=[245,303] nframes = 59, duration=1.18, duration_pad = 2, need padding 20.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmppsxmu44t.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_00_00245_00303.mp4
frame=[245,303] duration=1.16s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_00_00245_00303.mp4
frame=[303,510] nframes = 208, duration=4.16, duration_pad = 5, need padding 21.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp3hhqo82d.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_01_00303_00510.mp4
frame=[303,510] duration=4.14s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_01_00303_00510.mp4
frame=[515,824] nframes = 310, duration=6.2, duration_pad = 7, need padding 20.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpbmyitza4.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_03_00515_00824.mp4
frame=[515,824] duration=6.18s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_03_00515_00824.mp4
frame=[832,1600] nframes = 769, duration=15.38, duration_pad = 16, need padding 15.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpov4j6_gc.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_05_00832_01600.mp4
frame=[832,1600] duration=15.36s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_05_00832_01600.mp4
frame=[1600,1985] nframes = 386, duration=7.72, duration_pad = 8, need padding 7.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp7npqo73c.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_06_01600_01985.mp4
frame=[1600,1985] duration=7.7s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_06_01600_01985.mp4
frame=[1985,2352] nframes = 368, duration=7.36, duration_pad = 8, need padding 16.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmphq6e7jh3.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_07_01985_02352.mp4
frame=[1985,2352] duration=7.34s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_07_01985_02352.mp4
frame=[2352,2436] nframes = 85, duration=1.7, duration_pad = 2, need padding 7.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpq6y8o9yo.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_08_02352_02436.mp4
frame=[2352,2436] duration=1.68s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_08_02352_02436.mp4
frame=[2436,2513] nframes = 78, duration=1.56, duration_pad = 2, need padding 11.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpasp6beh1.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_09_02436_02513.mp4
frame=[2436,2513] duration=1.54s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_09_02436_02513.mp4
frame=[2513,2759] nframes = 247, duration=4.94, duration_pad = 5, need padding 1.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp07_5ettk.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_10_02513_02759.mp4
frame=[2513,2759] duration=4.92s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_10_02513_02759.mp4
frame=[2763,3018] nframes = 256, duration=5.12, duration_pad = 6, need padding 22.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpi418qvlo.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_12_02763_03018.mp4
frame=[2763,3018] duration=5.1s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_12_02763_03018.mp4
frame=[3029,3219] nframes = 191, duration=3.82, duration_pad = 4, need padding 4.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp8p_6m_yd.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_14_03029_03219.mp4
frame=[3029,3219] duration=3.8s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_14_03029_03219.mp4
frame=[3219,3290] nframes = 72, duration=1.44, duration_pad = 2, need padding 14.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpbwg42tkb.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_15_03219_03290.mp4
frame=[3219,3290] duration=1.42s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_15_03219_03290.mp4
frame=[3290,3731] nframes = 442, duration=8.84, duration_pad = 9, need padding 4.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp3zg2ptcj.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_16_03290_03731.mp4
frame=[3290,3731] duration=8.82s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_16_03290_03731.mp4
frame=[3731,4094] nframes = 364, duration=7.28, duration_pad = 8, need padding 18.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpohmo3hf7.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_17_03731_04094.mp4
frame=[3731,4094] duration=7.26s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_17_03731_04094.mp4
frame=[4094,4212] nframes = 119, duration=2.38, duration_pad = 3, need padding 15.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp359zbe1b.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_18_04094_04212.mp4
frame=[4094,4212] duration=2.36s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_18_04094_04212.mp4
frame=[4212,4388] nframes = 177, duration=3.54, duration_pad = 4, need padding 11.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpr2fuxkhf.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_19_04212_04388.mp4
frame=[4212,4388] duration=3.52s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_19_04212_04388.mp4
frame=[4424,4680] nframes = 257, duration=5.14, duration_pad = 6, need padding 21.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp0jpso1p8.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_21_04424_04680.mp4
frame=[4424,4680] duration=5.12s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_21_04424_04680.mp4
frame=[4680,4908] nframes = 229, duration=4.58, duration_pad = 5, need padding 10.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp7q5nnpwi.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_22_04680_04908.mp4
frame=[4680,4908] duration=4.56s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_22_04680_04908.mp4
frame=[4908,5167] nframes = 260, duration=5.2, duration_pad = 6, need padding 20.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpuelo1apr.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_23_04908_05167.mp4
frame=[4908,5167] duration=5.18s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_23_04908_05167.mp4
frame=[5209,5420] nframes = 212, duration=4.24, duration_pad = 5, need padding 19.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmph8h1qlaa.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_25_05209_05420.mp4
frame=[5209,5420] duration=4.22s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_25_05209_05420.mp4
frame=[5420,5699] nframes = 280, duration=5.6, duration_pad = 6, need padding 10.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpg76329ii.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_26_05420_05699.mp4
frame=[5420,5699] duration=5.58s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_26_05420_05699.mp4
frame=[5701,5959] nframes = 259, duration=5.18, duration_pad = 6, need padding 20.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpz9vrlx_x.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_28_05701_05959.mp4
frame=[5701,5959] duration=5.16s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_28_05701_05959.mp4
frame=[5959,6016] nframes = 58, duration=1.16, duration_pad = 2, need padding 21.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp0aos4s4l.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_29_05959_06016.mp4
frame=[5959,6016] duration=1.14s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_29_05959_06016.mp4
frame=[6021,6217] nframes = 197, duration=3.94, duration_pad = 4, need padding 1.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp4scavmc1.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_31_06021_06217.mp4
frame=[6021,6217] duration=3.92s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_31_06021_06217.mp4
frame=[6220,6511] nframes = 292, duration=5.84, duration_pad = 6, need padding 4.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpzatuv8g8.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_33_06220_06511.mp4
frame=[6220,6511] duration=5.82s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_33_06220_06511.mp4
frame=[6523,6798] nframes = 276, duration=5.52, duration_pad = 6, need padding 12.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpdte_ri13.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_35_06523_06798.mp4
frame=[6523,6798] duration=5.5s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_35_06523_06798.mp4
frame=[6798,7029] nframes = 232, duration=4.64, duration_pad = 5, need padding 9.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp45rs9v0b.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_36_06798_07029.mp4
frame=[6798,7029] duration=4.62s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_36_06798_07029.mp4
frame=[7066,7311] nframes = 246, duration=4.92, duration_pad = 5, need padding 2.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpgqlwotbw.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_38_07066_07311.mp4
frame=[7066,7311] duration=4.9s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_38_07066_07311.mp4
frame=[7311,7372] nframes = 62, duration=1.24, duration_pad = 2, need padding 19.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpf73vghv5.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_39_07311_07372.mp4
frame=[7311,7372] duration=1.22s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_39_07311_07372.mp4
frame=[7372,7578] nframes = 207, duration=4.14, duration_pad = 5, need padding 21.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp7zts7803.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_40_07372_07578.mp4
frame=[7372,7578] duration=4.12s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_40_07372_07578.mp4
frame=[7581,7831] nframes = 251, duration=5.02, duration_pad = 6, need padding 24.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpyj8x7ew8.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_42_07581_07831.mp4
frame=[7581,7831] duration=5.0s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_42_07581_07831.mp4
frame=[7831,7954] nframes = 124, duration=2.48, duration_pad = 3, need padding 13.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp7xvkyoz6.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_43_07831_07954.mp4
frame=[7831,7954] duration=2.46s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_43_07831_07954.mp4
frame=[7954,8226] nframes = 273, duration=5.46, duration_pad = 6, need padding 13.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpv3edpnhh.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_44_07954_08226.mp4
frame=[7954,8226] duration=5.44s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_44_07954_08226.mp4
frame=[8226,8445] nframes = 220, duration=4.4, duration_pad = 5, need padding 15.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpvv02damr.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_45_08226_08445.mp4
frame=[8226,8445] duration=4.38s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_45_08226_08445.mp4
frame=[8455,8668] nframes = 214, duration=4.28, duration_pad = 5, need padding 18.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpbvly09em.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_47_08455_08668.mp4
frame=[8455,8668] duration=4.26s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_47_08455_08668.mp4
frame=[8696,9153] nframes = 458, duration=9.16, duration_pad = 10, need padding 21.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpoc85on0n.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_49_08696_09153.mp4
frame=[8696,9153] duration=9.14s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_49_08696_09153.mp4
frame=[9153,9392] nframes = 240, duration=4.8, duration_pad = 5, need padding 5.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp8zjgey8m.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_50_09153_09392.mp4
frame=[9153,9392] duration=4.78s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_50_09153_09392.mp4
frame=[9392,9562] nframes = 171, duration=3.42, duration_pad = 4, need padding 14.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpms06ob5k.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_51_09392_09562.mp4
frame=[9392,9562] duration=3.4s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_51_09392_09562.mp4
frame=[9562,9964] nframes = 403, duration=8.06, duration_pad = 9, need padding 23.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp52cwblud.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_52_09562_09964.mp4
frame=[9562,9964] duration=8.04s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_52_09562_09964.mp4
frame=[9964,10330] nframes = 367, duration=7.34, duration_pad = 8, need padding 16.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpcy6q7p7y.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_53_09964_10330.mp4
frame=[9964,10330] duration=7.32s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_53_09964_10330.mp4
frame=[10330,10522] nframes = 193, duration=3.86, duration_pad = 4, need padding 3.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpi326kqbe.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_54_10330_10522.mp4
frame=[10330,10522] duration=3.84s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_54_10330_10522.mp4
frame=[10553,11050] nframes = 498, duration=9.96, duration_pad = 10, need padding 1.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp4m2ligvv.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_56_10553_11050.mp4
frame=[10553,11050] duration=9.94s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_56_10553_11050.mp4
frame=[11052,11278] nframes = 227, duration=4.54, duration_pad = 5, need padding 11.5
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmpj396s6sy.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_58_11052_11278.mp4
frame=[11052,11278] duration=4.52s. save video to /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_58_11052_11278.mp4
frame=[11279,11572] nframes = 294, duration=5.88, duration_pad = 6, need padding 3.0
ffmpeg -y -r 50  -f concat -safe 0 -i /tmp/tmp9xnxtnbe.txt -c:v libx264 -pix_fmt yuv420p -loglevel error  /mfs/lsen/DATA/Actor6/bg/processing2_0810/4R3A0205/video/video_split_ref_mean_update2/split_60_11279_11572.mp4
In [ ]: