@@ -161,10 +161,10 @@ std::string quoteValue(const std::string& value) {
161161
162162// Helper function to unflatten extra_options, alternating keys and values
163163std::map<std::string, std::string> unflattenExtraOptions (
164- const std::vector<std::string_view >& opts) {
164+ const std::vector<std::string >& opts) {
165165 std::map<std::string, std::string> optionsMap;
166166 for (size_t i = 0 ; i < opts.size (); i += 2 ) {
167- optionsMap[opts[i]. data () ] = opts[i + 1 ]. data () ;
167+ optionsMap[opts[i]] = opts[i + 1 ];
168168 }
169169 return optionsMap;
170170}
@@ -618,7 +618,7 @@ void encode_video_to_file(
618618 std::optional<std::string_view> pixel_format = std::nullopt ,
619619 std::optional<double > crf = std::nullopt ,
620620 std::optional<std::string_view> preset = std::nullopt ,
621- std::optional<std::vector<std::string_view >> extra_options = std::nullopt ) {
621+ std::optional<std::vector<std::string >> extra_options = std::nullopt ) {
622622 VideoStreamOptions videoStreamOptions;
623623 videoStreamOptions.codec = std::move (codec);
624624 videoStreamOptions.pixelFormat = std::move (pixel_format);
@@ -646,7 +646,7 @@ at::Tensor encode_video_to_tensor(
646646 std::optional<std::string_view> pixel_format = std::nullopt ,
647647 std::optional<double > crf = std::nullopt ,
648648 std::optional<std::string_view> preset = std::nullopt ,
649- std::optional<std::vector<std::string_view >> extra_options = std::nullopt ) {
649+ std::optional<std::vector<std::string >> extra_options = std::nullopt ) {
650650 auto avioContextHolder = std::make_unique<AVIOToTensorContext>();
651651 VideoStreamOptions videoStreamOptions;
652652 videoStreamOptions.codec = std::move (codec);
@@ -677,7 +677,7 @@ void _encode_video_to_file_like(
677677 std::optional<std::string_view> pixel_format = std::nullopt ,
678678 std::optional<double > crf = std::nullopt ,
679679 std::optional<std::string_view> preset = std::nullopt ,
680- std::optional<std::vector<std::string_view >> extra_options = std::nullopt ) {
680+ std::optional<std::vector<std::string >> extra_options = std::nullopt ) {
681681 auto fileLikeContext =
682682 reinterpret_cast <AVIOFileLikeContext*>(file_like_context);
683683 TORCH_CHECK (
0 commit comments