Insta360Develop / MediaSDK-Cpp

MediaSDK-Cpp is a C++ library to handle stitching, editing of media from Insta360 Cameras.
60 stars 8 forks source link

Program using cuda does not work on ec2 #14

Closed Hiroaki-K4 closed 10 months ago

Hiroaki-K4 commented 1 year ago

Hi, I got below error when I run the program on EC2(g5xlarge). The command is below.

./bin/stitcherSDKDemo -inputs ${TARGET_INPUT_INSV_00_FILE} ${TARGET_INPUT_INSV_10_FILE} -output ${OUTPUT_MP4_FILE} -stitch_type optflow -bitrate 30000000 -output_size 5760x2880

The environment is below.

The error message is below.

[02-01 05:10:40.195]  33 33 I stitcherImp.cpp:0078:  cuda size = 1 current = 0
[02-01 05:10:40.195]  33 33 I stitcherImp.cpp:0107:  gpu_count = 1 use gpu no = 0
[02-01 05:10:40.197]  33 33 V av_demuxer.cc:0285:  enable fast parse for mp4
[02-01 05:10:40.199]  33 33 V av_demuxer.cc:0301:  check is mp4 format, need filter to annexb
[02-01 05:10:40.199]  33 33 I bsf_filter.cpp:0030:  bsf_init ret:0
[02-01 05:10:40.199]  33 33 I llog.h:0316:  [MediaAsset::Load] in [3 ms]
[02-01 05:10:40.200]  33 33 I stitch_strategy.h:0071:  
 CUDA Device Info:
 Name:              NVIDIA A10G
 TotalGlobalMem:    22731M
 SharedMemPerBlock: 48M
 MaxGridSize:       1024
[02-01 05:10:40.303]  33 33 V av_demuxer.cc:0301:  check is mp4 format, need filter to annexb
[02-01 05:10:40.303]  33 33 I bsf_filter.cpp:0030:  bsf_init ret:0
curdeviceIndex = 0
[02-01 05:10:40.304]  33 33 I video_stitcherImp.cpp:0129:  ~~~~~~~~~~~~~ fps 29.97
[02-01 05:10:40.304]  33 33 I video_stitcherImp.cpp:0133:  ~~~~~~~~~~~~~ fps 29.97
[02-01 05:10:40.406]  33 33 V av_demuxer.cc:0301:  check is mp4 format, need filter to annexb
[02-01 05:10:40.406]  33 33 I bsf_filter.cpp:0030:  bsf_init ret:0
[02-01 05:10:40.406]  33 33 V decode_filter.cpp:0027:  to use hwaccel decoder:h264_cuvid
[02-01 05:10:40.476]  33 33 I codec_util.cpp:0230:  init cuda pixel format....
[02-01 05:10:40.481]  33 33 W ffmpeg:0000:  h264_cuvid @ 0x562441400e40 Invalid pkt_timebase, passing timestamps as-is.

[02-01 05:10:40.481]  33 33 V decode_filter.cpp:0037:  set decode hw_frame_ctx.
[02-01 05:10:40.642]  33 33 V encode_filter.cpp:0046:  switch to use encoder:libx264
[02-01 05:10:40.779]  33 33 V av_demuxer.cc:0301:  check is mp4 format, need filter to annexb
[02-01 05:10:40.779]  33 33 I bsf_filter.cpp:0030:  bsf_init ret:0
[02-01 05:10:40.779]  33 33 V decode_filter.cpp:0027:  to use hwaccel decoder:h264_cuvid
[02-01 05:10:40.832]  33 33 I codec_util.cpp:0230:  init cuda pixel format....
[02-01 05:10:40.837]  33 33 W ffmpeg:0000:  h264_cuvid @ 0x562445a2f400 Invalid pkt_timebase, passing timestamps as-is.

[02-01 05:10:40.837]  33 33 V decode_filter.cpp:0037:  set decode hw_frame_ctx.
[02-01 05:10:40.936]  33 33 V av_demuxer.cc:0301:  check is mp4 format, need filter to annexb
[02-01 05:10:40.936]  33 33 I bsf_filter.cpp:0030:  bsf_init ret:0
[02-01 05:10:40.936]  33 33 V event_dispatcher.cpp:0102:  libevent use phreads:0
[02-01 05:10:40.936]  33 49 V file_media_src.cpp:0299:  file media src to start.
[02-01 05:10:40.937]  33 50 V file_media_src.cpp:0299:  file media src to start.
[02-01 05:10:40.937]  33 51 V file_media_src.cpp:0299:  file media src to start.
[02-01 05:10:41.001]  33 50 E stitcher_param.hpp:0170:  blend Error
cost = 0.820287
[02-01 05:10:41.002]  33 33 I video_stitcherImp.cpp:0057:  use cancel ~~~~~~~~~~~~~~~~~~~~~~ 333333333333333333333
[02-01 05:10:41.198]  33 51 V av_demuxer.cc:0496:  ReadPacket eof.
[02-01 05:10:41.198]  33 51 V file_media_src.cpp:0071:  /tasks/insv_conversion/VID_20221102_103041_00_049.insv on end.
[02-01 05:10:41.198]  33 51 I file_media_src.cpp:0110:  estimate audio frame duration:21
Tianweihaihaihai commented 1 year ago

pls update sdk version and try, but we cannot ensure NVIDIA A10G is supported

Hiroaki-K4 commented 10 months ago

It seems that the target GPU is not supported because I could not get it to work even after upgrading the version.