C# 在C代码中使用ffprobe获取视频文件中的帧数

C# 在C代码中使用ffprobe获取视频文件中的帧数,c#,count,ffmpeg,frame,ffprobe,C#,Count,Ffmpeg,Frame,Ffprobe,我可以使用以下命令在命令提示符下使用Ffprobe成功读取test.mp4中的帧数: >ffprobe -i 'c://test.mp4' -show_frames | find /c 'pict_type' 但是,当我尝试使用以下参数从C代码运行“ffprobe.exe”时: string params = " -i 'c://test.mp4' -show_frames | find /c 'pict_type'"; 它的错误如下: ffprobe version N-59453-

我可以使用以下命令在命令提示符下使用Ffprobe成功读取test.mp4中的帧数:

>ffprobe -i 'c://test.mp4' -show_frames | find /c 'pict_type'
但是,当我尝试使用以下参数从C代码运行“ffprobe.exe”时:

string params = " -i 'c://test.mp4' -show_frames | find /c 'pict_type'";
它的错误如下:

ffprobe version N-59453-gd52882f Copyright (c) 2007-2013 the FFmpeg developers
  built on Dec 30 2013 22:07:23 with gcc 4.8.2 (GCC)
  configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libcaca --enable-libfreetype --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libx264 --enable-libxavs --enable-libxvid --enable-zlib
  libavutil      52. 59.100 / 52. 59.100
  libavcodec     55. 47.100 / 55. 47.100
  libavformat    55. 22.101 / 55. 22.101
  libavdevice    55.  5.102 / 55.  5.102
  libavfilter     4.  0.103 /  4.  0.103
  libswscale      2.  5.101 /  2.  5.101
  libswresample   0. 17.104 /  0. 17.104
  libpostproc    52.  3.100 / 52.  3.100
Argument '|' provided as input filename, but ''c://test.mp4'' was already specified.
如何为C修复此问题


我知道使用Ffmpeg有一种解决方法,但这种方法不够干净。

可能是因为C控制台不支持管道或查找。我会考虑使用FF探头输出的结果在C中编写PICTYTYPE的查找实例。 字符串参数=-i'c://test.mp4'-show_frames

比如:

output.Countx=>x==pict_类型