@@ -68,20 +68,17 @@ pub fn create_thumbnails(input: &str, subpath: &str, output: &str) -> io::Result
68
68
pub fn create_hls_encoding ( input : & str , subpath : & str , output : & str ) -> io:: Result < ( ) > {
69
69
println ! ( "\n pub create_hls_encoding" ) ;
70
70
71
- let hls_path = format ! ( "{}/{}" , output, subpath) ;
71
+ let hls_path = format ! ( "{}/{}/hls " , output, subpath) ;
72
72
73
73
if fs:: metadata ( & hls_path) . is_err ( ) {
74
74
fs:: create_dir_all ( & hls_path) ?;
75
75
}
76
76
77
- // TODO: Sub add paths
78
- // let paths = ["hls", "dash"];
79
- // for path in paths {
80
- // let p = format!("{}/{}", path, output);
81
- // if !fs::metadata(&p).is_ok() {
82
- // fs::create_dir_all(&p)?;
83
- // }
84
- // }
77
+ let dash_path = format ! ( "{}/{}/dash" , output, subpath) ;
78
+
79
+ if fs:: metadata ( & dash_path) . is_err ( ) {
80
+ fs:: create_dir_all ( & dash_path) ?;
81
+ }
85
82
86
83
let command = format ! ( "ffmpeg -stream_loop 0 -i {} \
87
84
-map 0 -map 0 -map 0 -c:a aac -c:v h264_videotoolbox -allow_sw 1 \
@@ -92,9 +89,9 @@ pub fn create_hls_encoding(input: &str, subpath: &str, output: &str) -> io::Resu
92
89
-keyint_min 120 -g 120 -sc_threshold 0 -b_strategy 0 -ar:a:1 22050 -use_timeline 1 -use_template 1 \
93
90
-window_size 0 -adaptation_sets \" id=0,streams=v id=1,streams=a\" -hls_playlist 1 -seg_duration 4 \
94
91
-streaming 0 -f dash \
95
- -hls_segment_filename \
96
92
-hls_playlist_type {}/vod \
97
- {}/720p_%03d.m3u8 {}/720p .m3u8", input, hls_path, hls_path, hls_path ) ;
93
+ {}/720p_%03d.m3u8 {}/720p_%03d .m3u8", input, hls_path, hls_path, dash_path ) ;
98
94
run_command ( & command) ?;
99
95
Ok ( ( ) )
100
96
}
97
+ // -hls_segment_filename \
0 commit comments