.mp4 cant play on WMplayer. Tried to change container and work. How to bat fix?

1

1

I have some .mp4 files which are not playing in Windows Media Player.

Error: Windows Media Player cannot play the file. The Player might not support the file type or might not support the codec that was used to compress the file

But does play in VLC. I tried to change the container from .mp4 to .flv using a .bat* and after i changed it back to .mp4 and the file started playing normally without the error message. Does anyone have an idea of what it might be or how I can write a a command for batch conversion that changes the containers in all folders and them change it back to .mp4 and save in another folder (or will I have to do folder by folder?)

I used ffmpeg and the command i put in the batch file was:

the firtst .bat: to change the container from .mp4 to another container(i choose .flv)

for %%a in ("*.mp4") do ffmpeg -i "%%a" -vcodec copy -acodec copy "%%~na.flv"
pause

the second .bat: to change back to .mp4:

for %%a in ("*.flv") do ffmpeg -i "%%a" -vcodec copy -acodec copy "%%~na.mp4"
pause

I wrote this on notepad and then saved .bat. After changing all files i wrote the way back.

I don't know exactly what it does, but i know it fixes any issues.

Can someone help me to write it better and make it work with the whole directory and then save it to another directory to not overwrite the older files?

C:\ch_class>ffmpeg -i bd.mp4
ffmpeg version N-83657-g7e4f32f Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 6.3.0 (GCC)
  configuration: --enable-gpl --enable-version3 --enable-cuda --enable-cuvid --e
nable-d3d11va --enable-dxva2 --enable-libmfx --enable-nvenc --enable-avisynth --
enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-li
bfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug -
-enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enabl
e-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-li
bsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolam
e --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx
 --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable
-libxavs --enable-libxvid --enable-libzimg --enable-lzma --enable-zlib
  libavutil      55. 47.100 / 55. 47.100
  libavcodec     57. 81.100 / 57. 81.100
  libavformat    57. 66.102 / 57. 66.102
  libavdevice    57.  2.100 / 57.  2.100
  libavfilter     6. 74.100 /  6. 74.100
  libswscale      4.  3.101 /  4.  3.101
  libswresample   2.  4.100 /  2.  4.100
  libpostproc    54.  2.100 / 54.  2.100
[flv @ 0000000000566980] video stream discovered after head already parsed
[flv @ 0000000000566980] audio stream discovered after head already parsed
Input #0, flv, from 'bd.mp4':
  Metadata:
    moovPosition    : 32
    avcprofile      : 77
    avclevel        : 41
    aacaot          : 2
    videoframerate  : 25
    audiochannels   : 2
    length          : 77795328
    timescale       : 48000
    sampletype      : mp4a
  Duration: 00:27:00.74, start: 0.000000, bitrate: 707 kb/s
    Stream #0:0: Video: h264 (Main), yuv420p(tv, progressive), 1280x720 [SAR 1:1
 DAR 16:9], 25 fps, 25 tbr, 1k tbn, 50 tbc
    Stream #0:1: Audio: aac (LC), 48000 Hz, stereo, fltp
At least one output file must be specified

luiza

Posted 2019-10-03T17:18:16.480

Reputation: 11

Can you share a link to a MP4 file that does not work in WMP? Alternatively, show the complete output of ffmpeg -i file_that_does_not_work_in_wmp.mp4 It will show info that can be used to provide an answer. – llogan – 2019-10-03T18:32:12.943

I tried to share the output here but got the message "too long by 1496 characters" so i edited the question and add the information. Sorry if i did wrong, i not familiar with the site. Thank you! – luiza – 2019-10-03T20:00:32.943

Answers

2

ffmpeg says the input file is FLV, not MP4. It appears that someone simply renamed it.

Windows Media Player does not support FLV, so you'll have to re-mux it to MP4. You can skip the step where you output FLV and re-mux directly to MP4.

for /R %%a in ("*.mp4") do ffmpeg -i "%%a" -c copy "%%~da%%~pa%%~na-remuxed.mp4"
pause

The new file names will end in -remuxed.mp4.

llogan

Posted 2019-10-03T17:18:16.480

Reputation: 31 929