Closed JXIONG008 closed 2 years ago
Seems running out GPU. Have you tried reducing BS (batch size)? Possibly Kinetics400 data is larger than UCF.
For moov atom not found
error, I referred to #1093
Iterate all videos and see 1) how many videos are "broken"? 2) Can you open them manually in video player?
For
moov atom not found
error, I referred to #1093 Iterate all videos and see 1) how many videos are "broken"? 2) Can you open them manually in video player?
Hi Liangyu, thanks for your prompt reply.
Two suggested to-do
Two suggested to-do
- resolve the CUDA out of memory first, so we can locate the related code more precisely.
- Check this out (https://repairit.wondershare.com/video-repair/moov-atom-not-found.html#:~:text=The%20reason%20for%20this%20error,there%20when%20the%20recording%20ends.), maybe method 2 is a good fix.
in reply to point 2, I am trying to process all the corrupted files by a python loop, but the subprocess is not working as expected, or to be more specific, the function.
my code:
import os
from sys import stdout
import pandas as pd
import subprocess
def fix():
df= pd.read_csv('/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/annotations/kinetics_val.csv')
des_root = '/home/students/s121md104_06/FYP/mmaction2/data/k400-fix/videos_val'
for root, dirs, files in os.walk("/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val", topdown=False):
for name in files:
print("root:"+root)
root_first_part = root[0:70]
root_last_part = "\'"+root[70:]+"\'"
current_dir = os.path.join(root_first_part,root_last_part, name)
print("current dir:"+current_dir)
vid_id = name[0:11]
#print(vid_id)
label = df[df['youtube_id']==vid_id]['label'].item()
#print(label)
label_new = "\'"+label+"\'"
final_folder = os.path.join(des_root, label_new)
#print(final_folder)
final_dir=os.path.join(final_folder,name)
print("final dir:"+final_dir)
#os.rename(current_dir, final_dir)
cmd=["qt-faststart"]
cmd.append(current_dir)
cmd.append(final_dir)
print(cmd)
p=subprocess.Popen(cmd,shell=True, stdout=subprocess.PIPE, universal_newlines=True)
print(p.stdout.read())
#p=subprocess.Popen(,shell=True, stdout=subprocess.PIPE)
fix()
the imtermediate step:
root:/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val/waxing chest
current dir:/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val/'waxing chest'/-8h42AaoMnc_000020_000030.mp4
final dir:/home/students/s121md104_06/FYP/mmaction2/data/k400-fix/videos_val/'waxing chest'/-8h42AaoMnc_000020_000030.mp4
['qt-faststart', "/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val/'waxing chest'/-8h42AaoMnc_000020_000030.mp4", "/home/students/s121md104_06/FYP/mmaction2/data/k400-fix/videos_val/'waxing chest'/-8h42AaoMnc_000020_000030.mp4"]
Usage: qt-faststart <infile.mov> <outfile.mov>
Note: alternatively you can use -movflags +faststart in ffmpeg
root:/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val/waxing chest
current dir:/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val/'waxing chest'/zX8mLojq_BY_000066_000076.mp4
final dir:/home/students/s121md104_06/FYP/mmaction2/data/k400-fix/videos_val/'waxing chest'/zX8mLojq_BY_000066_000076.mp4
['qt-faststart', "/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val/'waxing chest'/zX8mLojq_BY_000066_000076.mp4", "/home/students/s121md104_06/FYP/mmaction2/data/k400-fix/videos_val/'waxing chest'/zX8mLojq_BY_000066_000076.mp4"]
Usage: qt-faststart <infile.mov> <outfile.mov>
Note: alternatively you can use -movflags +faststart in ffmpeg
root:/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val/waxing chest
current dir:/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val/'waxing chest'/vllcsHErd-o_000036_000046.mp4
final dir:/home/students/s121md104_06/FYP/mmaction2/data/k400-fix/videos_val/'waxing chest'/vllcsHErd-o_000036_000046.mp4
['qt-faststart', "/home/students/s121md104_06/FYP/mmaction2/data/kinetics400/videos_val/'waxing chest'/vllcsHErd-o_000036_000046.mp4", "/home/students/s121md104_06/FYP/mmaction2/data/k400-fix/videos_val/'waxing chest'/vllcsHErd-o_000036_000046.mp4"]
Usage: qt-faststart <infile.mov> <outfile.mov>
Note: alternatively you can use -movflags +faststart in ffmpeg
If you think the single quotation marks caused the error, you can try removing it.
Remove specific characters from a string in Python - Stack Overflow https://stackoverflow.com/questions/3939361/remove-specific-characters-from-a-string-in-python
Thanks for your error report and we appreciate it a lot. If you feel we have help you, give us a STAR! :satisfied:
Checklist
Describe the bug
Reproduction
Did you make any modifications on the code or config? Did you understand what you have modified? No.
What dataset did you use? Kinetics400
Environment
PYTHONPATH=${PWD}:$PYTHONPATH python mmaction/utils/collect_env.py
to collect necessary environment information and paste it here.sys.platform: linux Python: 3.8.12 (default, Oct 12 2021, 13:49:34) [GCC 7.5.0] CUDA available: True GPU 0,1,2,3: GeForce GTX 1080 Ti CUDA_HOME: /usr/local/cuda NVCC: Cuda compilation tools, release 9.2, V9.2.148 GCC: gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0 PyTorch: 1.10.1 PyTorch compiling details: PyTorch built with:
TorchVision: 0.11.2 OpenCV: 4.5.4 MMCV: 1.4.2 MMCV Compiler: GCC 7.3 MMCV CUDA Compiler: 10.2 MMAction2: 0.20.0+6fb9f47
Error traceback
If applicable, paste the error traceback here.
Bug fix
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!