LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   WMV is driving me nuts (https://www.linuxquestions.org/questions/linux-software-2/wmv-is-driving-me-nuts-4175581283/)

Emerson 06-02-2016 12:52 PM

WMV is driving me nuts
 
OK, first time in 13 years I need to work with WMV and so far no success. These are Windows 7 ScreenRecorder files, no audio. I need to cut and crop them. So far I haven't found software capable of this. Avidemux crashes, ffmpeg does something (trying to recode) but the output is no use.
Any hints how to recode these files to MPEG-4 or any other standard format are most appreciated.

dolphin_oracle 06-02-2016 12:57 PM

hmmm...

can you play the wmv file on your linux platform?

schneidz 06-02-2016 01:03 PM

mencoder / mplayer --dumpstream ?

dolphin_oracle 06-02-2016 01:10 PM

I just tried using good ol' vlc for this. I used the Convert/Save feature to save a wmv file to a mp4. If all else fails, try vlc.

Emerson 06-02-2016 01:27 PM

Thanks for replies.

VLC does not display anything, just sits. Will try it from CLI when I get home.

MPV can play it. Maybe it can convert it into something useful, will try.

dolphin_oracle 06-02-2016 01:35 PM

Quote:

Originally Posted by Emerson (Post 5554719)
Thanks for replies.

VLC does not display anything, just sits. Will try it from CLI when I get home.

MPV can play it. Maybe it can convert it into something useful, will try.

you might need a codec pack. In the debian world it would be w32codecs or w64codecs, depending on 32bit or 64bit OS. Although that is interesting that mpv can play it.

*** I just noticed that I do not have those codecs install, so ??? However, I do have mpv. this worked for me do do a conversion.
Code:

$ mpv inputfile.wmv -o outputfilename.mp4 -ofps 30
the command failed for me without specifying the -ofps option (output frames per second). the autodetect failed on the wmv file.

seasons 06-03-2016 08:55 AM

It's been a while since I heard anyone talk about needing w32/64codecs. Modern ffmpeg versions should have all needed support for wmv formats (though it doesn't encode wmv3):
Code:

$ ffmpeg -codecs | grep -i wmv
ffmpeg version 3.0.2 Copyright (c) 2000-2016 the FFmpeg developers
<snip>
 DEV.L. wmv1                Windows Media Video 7
 DEV.L. wmv2                Windows Media Video 8
 D.V.L. wmv3                Windows Media Video 9 (decoders: wmv3 wmv3_crystalhd wmv3_vdpau )
 D.V.L. wmv3image            Windows Media Video 9 Image


syg00 06-03-2016 09:12 AM

I once went to a Linux conference where the session recordings (before live streaming) we were promised were (shock, horror) wmv.

The start of morning two was interesting. Everything was hastily converted, and the riots doused with liberal amounts of coffee ... :p

teckk 06-04-2016 09:14 AM

Just dug out a 15 year old CDR with some .wmv on it.
Code:

ffprobe test.wmv
ffprobe version 3.0 Copyright (c) 2007-2016 the FFmpeg developers
..........
Input #0, asf, from 'test.wmv':
  Metadata:
    WMFSDKVersion  : 7.01.00.3055
    WMFSDKNeeded    : 0.0.0.0000
  Duration: 00:28:33.21, start: 0.000000, bitrate: 354 kb/s
    Stream #0:0: Audio: wmav2 (a[1][0][0] / 0x0161), 32000 Hz, 2 channels, fltp, 32 kb/s
    Stream #0:1: Video: wmv1 (WMV1 / 0x31564D57), yuv420p, 320x240, 14.99 fps, 14.99 tbr, 1k tbn, 1k tbc

mplayer, mpv, ffplay will play it.
Code:

mplayer test.wmv
.........
[asfheader] Audio stream found, -aid 1
[asfheader] Video stream found, -vid 2
VIDEO:  [WMV1]  320x240  24bpp  1000.000 fps    0.0 kbps ( 0.0 kbyte/s)
Load subtitles in /home/teckk/
SUB: Could not determine file format
Cannot load subtitles 'test.js'.
Opening video filter: [eq brightness=10]
==========================================================================
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 56.26.100 (internal)
Selected video codec: [ffwmv1] vfm: ffmpeg (FFmpeg WMV1/WMV7)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 32000 Hz, 2 ch, floatle, 32.0 kbit/1.56% (ratio: 4000->256000)
Selected audio codec: [ffwmav2] afm: ffmpeg (DivX audio v2 (FFmpeg))

I could not just simply change containers
Code:

ffmpeg -i test.wmv -c:a copy -c:v copy testout.mp4
...........
[mp4 @ 0x55b9048697c0] Could not find tag for codec wmv1 in stream #0, codec not currently supported in container

I was was able change codecs and containers at the same time
Code:

ffmpeg -i test.wmv -c:a aac -b:a 128k -c:v libx264 -b:v 600k testout2.mp4
If you can't do that then dump both video and audio streams to uncompresssed file.
Code:

ffmpeg -i test.wmv -f rawvideo -c:a rawvideo testvid.raw

ffmpeg -i test.wmv -c:a pcm_s16le testaud.wav

Then put it back together with aac audio x264 video for example.
Code:

ffmpeg -f rawvideo -pix_fmt yuv420p -s:v 320x240 -i testvid.raw -i testaud.wav -c:v libx264 -b:v 600k -c:a aac -b:a 128k testout.mp4
Code:

mplayer testout.mp4
...........
Playing testout.mp4.
libavformat version 56.25.101 (internal)
libavformat file format detected.
[lavf] stream 0: video (h264), -vid 0
[lavf] stream 1: audio (aac), -aid 0, -alang und
VIDEO:  [H264]  320x240  24bpp  25.000 fps  607.6 kbps (74.2 kbyte/s)
............
Opening video decoder: [ffmpeg] FFmpeg's libavcodec codec family
libavcodec version 56.26.100 (internal)
Selected video codec: [ffh264] vfm: ffmpeg (FFmpeg H.264)
==========================================================================
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 32000 Hz, 2 ch, floatle, 133.3 kbit/6.51% (ratio: 16662->256000)
Selected audio codec: [ffaac] afm: ffmpeg (FFmpeg AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
[AO OSS] audio_setup: Can't open audio device /dev/dsp: No such file or directory
AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
Starting playback...
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 320x240 => 320x240 Planar YV12
A:  0.5 V:  0.5 A-V:  0.002 ct:  0.006  0/  0  5%  1%  1.1% 0 0

That's a raw video so don't forget to specify size before you try and encode it.

If you want more info, ask.

Emerson 06-06-2016 07:39 AM

Thanks everybody, I've been away, will give it another try when I get home.

Emerson 06-07-2016 07:46 AM

OK, ffmpeg starts recoding but has errors. I think the Screenrecorder application used to produce these files is outputting less than perfect files. I believe now that is the reason players and editors fail. Is there any known application to fix WMV files?

teckk 06-07-2016 02:53 PM

Quote:

MPV can play it.
Will ffplay play it?
Code:

ffplay file.wmv
If not, what error do you get.

Can you post the output of
Code:

ffprobe file.wmv
And the command line arguments you are giving ffmpeg, and the error it reports.

Emerson 06-07-2016 07:50 PM

Below is the output requested. The problem is the files are broken, ffmpeg does not crash, but produces broken output, too. All editors I've tried so far crash. Some players have apparently more error tolerance and can play these files. There seem to be some WMV repair utilities but of course you need Windows for that. Giving up.

Code:

~ $ ffprobe downloads/WMV/04042016.wmv sq=    0B f=0/0   
ffprobe version 2.8.7 Copyright (c) 2007-2016 the FFmpeg developers
  built with gcc 5.3.0 (Gentoo 5.3.0 p1.1, pie-0.6.5)
  configuration: --prefix=/usr --libdir=/usr/lib64 --shlibdir=/usr/lib64 --mandir=/usr/share/man --enable-shared --cc=x86_64-pc-linux-gnu-gcc --cxx=x86_64-pc-linux-gnu-g++ --ar=x86_64-pc-linux-gnu-ar --optflags='-march=native -O2 -pipe -floop-interchange -floop-strip-mine -floop-block -ftree-vectorize' --disable-static --enable-avfilter --enable-avresample --disable-stripping --disable-indev=oss --disable-indev=jack --disable-outdev=oss --enable-bzlib --disable-runtime-cpudetect --disable-debug --disable-doc --enable-gnutls --enable-gpl --enable-hardcoded-tables --enable-iconv --disable-lzma --enable-network --disable-openssl --enable-postproc --disable-libsmbclient --enable-ffplay --enable-sdl --enable-vaapi --enable-vdpau --enable-xlib --disable-libxcb --disable-libxcb-shm --disable-libxcb-xfixes --enable-zlib --disable-libcdio --disable-libiec61883 --disable-libdc1394 --disable-libcaca --disable-openal --enable-opengl --disable-libv4l2 --disable-libpulse --disable-libopencore-amrwb --disable-libopencore-amrnb --disable-libfdk-aac --disable-libopenjpeg --disable-libbluray --disable-libcelt --disable-libgme --disable-libgsm --disable-libmodplug --enable-libopus --disable-libquvi --disable-librtmp --disable-libssh --disable-libschroedinger --disable-libspeex --enable-libvorbis --enable-libvpx --disable-libzvbi --disable-libbs2b --disable-libflite --disable-frei0r --disable-libfribidi --enable-fontconfig --enable-ladspa --enable-libass --enable-libfreetype --disable-libsoxr --enable-pthreads --disable-libvo-aacenc --disable-libvo-amrwbenc --enable-libmp3lame --disable-libaacplus --disable-libfaac --disable-libsnappy --enable-libtheora --disable-libtwolame --enable-libwavpack --disable-libwebp --enable-libx264 --enable-libx265 --disable-libxvid --enable-x11grab --disable-amd3dnow --disable-amd3dnowext --disable-fma4 --disable-xop --cpu=host
  libavutil      54. 31.100 / 54. 31.100
  libavcodec    56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter    5. 40.101 /  5. 40.101
  libavresample  2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample  1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
Input #0, asf, from 'downloads/WMV/04042016.wmv':
  Metadata:
    title          : ScreenRecorder
    artist          : ScreenRecorder
    copyright      : ScreenRecorder
    comment        : ScreenRecorder
    WMFSDKNeeded    : 0.0.0.0000
    DeviceConformanceTemplate: @
    WMFSDKVersion  : 12.0.7601.17514
    IsVBR          : 0
  Duration: 01:17:12.98, start: 0.000000, bitrate: 50 kb/s
    Stream #0:0(eng): Video: mss2 (MSS2 / 0x3253534D), rgb24, 1600x900, 200 kb/s, 5 tbr, 1k tbn, 1k tbc


teckk 06-07-2016 09:45 PM

Quote:

Stream #0:0(eng): Video: mss2 (MSS2 / 0x3253534D), rgb24
Ok, I found some of those here to test.
http://trac.ffmpeg.org/raw-attachment/ticket/3255/

Is uses rgb24 instead of yuv420p.
Did a little more research. This codec of Microsoft's will only play on a 32 bit machine. No, not kidding. Do a search on mss2 in .wmv files.

https://fitzcarraldoblog.wordpress.c...-64-bit-linux/
http://ubuntuforums.org/archive/inde...t-1705713.html

So out of curiosity I got a copy of mplayer for 32 bit windoze.
Code:

wget --spider http://downloads.sourceforge.net/project/mplayerwin/MPlayer-MEncoder/r37871-2/mplayer-svn-37871-2.7z
.........
Length: 11541177 (11M) [application/x-7z-compressed]
Remote file exists.

Extracted mplayer.exe and in a 32 bit wine
Code:

wine mplayer.exe testmss.wmv
Still could not play it.

These will play.
http://download.wavetlan.com/SVV/Med...P/http-wmv.htm

Put those files on a windows 7, 8 machine and save them as something else like .mp4 with win media center.

Or search for more help with mss2 codec .wmv files on linux. Good luck.

ondoho 06-09-2016 01:24 PM

you've given up, that's understandable.

yet, i just thought of something:
Quote:

Originally Posted by Emerson (Post 5557486)
Some players have apparently more error tolerance and can play these files.

you could play the files, then make another desktop recording of that, this time with linux. it's a hassle, but shouldn't be more resource intensive than transcoding...


All times are GMT -5. The time now is 03:31 PM.