FFmpeg 命令不起作用?

FFmpeg 命令不起作用?

我想将 mp4 文件转换为 hls 格式,这个命令有问题吗,请告诉我

 String exec =
            "-y -i "+mediaPath+
                    " -preset slow -g 48 -sc_threshold 0"+
                    " -map 0:0 -map 0:1 -map 0:0 -map 0:1"+
                    " -s:v:0 640x360 -c:v:0 libx264 -b:v:0 365k"+
                    " -s:v:1 960x540 -c:v:1 libx264 -b:v:1 2000k"+
                    " -c:a copy"+
                    " -var_stream_map v:0,a:0  v:1,a:1"+
                    " -master_pl_name master.m3u8"+
                    " -f hls -hls_time 6 -hls_list_size 0"+
                    " -hls_segment_filename "+outDirPath+"/%v_fileSequence_%d.ts "+
                    outDirPath+"/%v_playlistVariant.m3u8";

    String[] splitCmd = exec.split(" ");

    FFmpeg.getInstance(this).execute(splitCmd, new ExecuteBinaryResponseHandler() {
        //execution
       }
               

它显示以下错误:-

E/FFmpeg  (15588):   libavutil      56. 14.100 / 56. 14.100
E/FFmpeg  (15588):   libavcodec     58. 18.100 / 58. 18.100
E/FFmpeg  (15588):   libavformat    58. 12.100 / 58. 12.100
E/FFmpeg  (15588):   libavdevice    58.  3.100 / 58.  3.100
E/FFmpeg  (15588):   libavfilter     7. 16.100 /  7. 16.100
E/FFmpeg  (15588):   libavresample   4.  0.  0 /  4.  0.  0
E/FFmpeg  (15588):   libswscale      5.  1.100 /  5.  1.100
E/FFmpeg  (15588):   libswresample   3.  1.100 /  3.  1.100
E/FFmpeg  (15588):   libpostproc    55.  1.100 / 55.  1.100
E/FFmpeg  (15588): Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/data/user/0/com.brahmand.sanju/cache/file_picker/VID-20201118-WA0002.mp4':
E/FFmpeg  (15588):   Metadata:
E/FFmpeg  (15588):     major_brand     : mp4v
E/FFmpeg  (15588):     minor_version   : 0
E/FFmpeg  (15588):     compatible_brands: mp4vmp42isom
E/FFmpeg  (15588):   Duration: 00:00:21.40, start: 0.000000, bitrate: 1733 kb/s
E/FFmpeg  (15588):     Stream #0:0(und): Video: h264 (avc1 / 0x31637661), yuv420p(tv, unknown/bt470bg/unknown), 640x352, 1731 kb/s, 26.21 fps, 30 tbr, 90k tbn, 180k tbc (default)
E/FFmpeg  (15588): Stream map '0:1' matches no streams.
E/FFmpeg  (15588): To ignore this, add a trailing '?' to the map.

相关内容