1

We have an app that uses the ffmpeg C API to encode mpeg-4 (AV_CODEC_ID_MPEG4) files in a mp4 container. The problem is that the files don't play in Windows Media Player or the Windows 10 video player "Movies & TV" app. It plays in VLC, google chrome, Ubuntu's video player, and all other video players I've tried.

The two Windows players are able to play other files encoded with mpeg-4 in mp4 container. I also tested transcoding video files to the same format using the command line 'ffmpeg' tool and was successfully able to play the video using the following command:

ffmpeg input.avi -c:v mpeg4 output.mp4

While I found the following commands do not work:

ffmpeg input.avi -c:v mpeg4 -vtag xvid output.mp4

ffmpeg input.avi -c:v libxvid output.mp4

# the last command wont play with windows media player but VLC can still play it. If the extension of the output file is changed to avi for the last two commands then Windows media player can play it.

I started looking at the ffmpeg src code but it appears a bit large/complex, I tried using the simpler "encode_video.c" example, which was able to encode a video and play it in Ubuntu's default video player but VLC nor Windows Media Player could play it.

We need to encode these using the ffmpeg API, not the command line tool, so I am wondering what the ffmpeg command line tool is doing that I am not, or any ideas on what the problem could be and how to get this working.

Thanks.

  • Can you show a small piece of code where you use the API and as a result you create a file that is not readable by the 2 windows players? This can help me and others to narrow down your problem. – Pedro Jun 08 '17 at 23:30

1 Answers1

0

According to this and this XVid playback is not supported by Movies & TV app as well as other Win Store apps using WinRT out of box video capabilities. And according to this it is also not supported by Windows Media Player. If you've managed to play it using Windows Media Player then most likely you had corresponding third-party Direct Show codec installed. There is actually no real point to use XVid in 2017, just use h264 instead.

user7860670
  • 35,849
  • 4
  • 58
  • 84
  • I've been told that the h264 encoders in ffmpeg are proprietary, otherwise we would probably use h264. – user1505129 Jun 09 '17 at 16:47
  • Also your link shows that Windows Media Player 12 supports .mp4 files. I have also tested other mp4/mpeg4 videos on a fresh install of Windows 10 and it works. – user1505129 Jun 09 '17 at 17:07