Hello.
Im using ffmpeg.exe to convert video in h264 format to mp4 video file. After converting mp4 file not plaing in WPF MediaElement control, and any Windows player. I installed K_Lite codec package.
I'm running query: "ffmpeg -i C:\video.h264 c:\video.mp4" in System.Diagnostics.Process in WPF apllication in 4.0 framework.
Why MediaElement not plaing mp4 video? Video in other formats (wmv, mpg...) plaing ok.
Jayraj ChhayaPosted Aug 19, 2025, 11:44 AM
Hello,
Try below.
Your MP4 doesn’t play because you just wrapped raw H.264 into MP4, which WPF
MediaElement(Windows Media Foundation) can’t handle.Fix: re-encode properly:
Or convert to WMV (fully supported):
MediaElementplays WMV reliably. For MP4/H.264, re-encode or use LibVLCSharp/FFME.