瘋ふル 发表于 2018-1-16 10:35:38

ffmpeg.exe转码的视频文件无法播放

process.StartInfo.Arguments = " -i " + inputFile + " -y -c:v libx264 -c:a libfdk_aac " + outPath + ".mp4";
                process.StartInfo.UseShellExecute = false;
                process.StartInfo.CreateNoWindow = true;
                process.StartInfo.RedirectStandardOutput = true;
                process.StartInfo.RedirectStandardInput = true;
                process.StartInfo.RedirectStandardError = true;

我需要将视频文件用h264重新编码,但是我在c#中调用用上面的方式调用ffmpeg.exe传递参数,转完码的视频无法再播放器中播放(暴风一闪而过,qq影音走进度条,但是黑屏),但是谷歌和qq浏览器播放时正常的,ie11无法播放,请问大神是否是我的命令写的不对,我希望一般的播放器可以播放,浏览器用viedo标签也可以播放,包括ie

孙悟空 发表于 2018-1-16 13:56:14

ffmpeg version N-89672-g41e51fbcd9 Copyright (c) 2000-2018 the FFmpeg developers
built with Apple LLVM version 9.0.0 (clang-900.0.39.2)
configuration: --enable-fontconfig --enable-gpl --enable-libass --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libspeex --enable-libx264 --enable-libx265 --enable-libfdk-aac --enable-version3 --cc='ccache gcc' --enable-nonfree --enable-videotoolbox
libavutil      56.7.100 / 56.7.100
libavcodec   58.9.100 / 58.9.100
libavformat    58.3.100 / 58.3.100
libavdevice    58.0.100 / 58.0.100
libavfilter   7.8.100 /7.8.100
libswscale      5.0.101 /5.0.101
libswresample   3.0.101 /3.0.101
libpostproc    55.0.100 / 55.0.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/Users/liuqi/1.MP4':
Metadata:
    major_brand   : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf57.71.100
Duration: 00:00:08.04, start: 0.000000, bitrate: 96 kb/s
    Stream #0:0(und): Video: h264 (High 4:2:2) (avc1 / 0x31637661), yuvj422p(pc), 256x192, 92 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
    Metadata:
      handler_name    : VideoHandler
At least one output file must be specified

你的视频是yuvj422p的pix_fmt, 一般硬解平台不一定会支持好,可以考虑加上-pix_fmt yuv420p解决,yuv420p比较通用
页: [1]
查看完整版本: ffmpeg.exe转码的视频文件无法播放