Author Topic: Still can't convert WMV properly  (Read 808 times)

Bart Z Lederman

  • Newbie
  • *
  • Posts: 4
Still can't convert WMV properly
« on: June 10, 2018, 03:12:18 PM »
This is a problem which has been reported in many forums for many years, and even with the newest version 2.7.1 it still exists.

Avidemux can read WMV files, it can play them correctly, but when I save them to a different format there is no sound.  I repeat, the sound plays fine when the file is in avidemux, it demuxes fine, all of the settings seem to work, the saved file says it has an audio track (according to VLC and MediaInfo), but there is actually no audio in the output file and there are no error messages during conversion.

I've tried outputs of AVI+AAC in MP4 containers, xvid+ac3 in AVI containers, and xvid+mp3 in AVI containers, and always get the same results.

I have tried every solution anyone has ever offered in this an other forums, and none of them fix the problem.

Does anyone really know how to get AVI to convert WMV into another format and keep the audio, or is this just something that avidemux should say outright it can't be done?

Any constructive comments are welcome.

Jan Gruuthuse

  • Hero Member
  • *****
  • Posts: 6052
Re: Still can't convert WMV properly
« Reply #1 on: June 10, 2018, 03:23:40 PM »
avidemux never could as far as I could remember:
Quote
Is probably not going to happen: due to
- Windows Media Components License Agreements
- and other reasons such as:
Quote
- ... WMV has been the subject of numerous complaints from users and the press. Users dislike the digital rights management system which is sometimes attached to WMV files. The loss of the ability to restore licenses for WMV files in the Windows Media Player 11 was not positively received ....
- ...
Windows Media Video
Windows Media Audio
source: WMV output format

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Still can't convert WMV properly
« Reply #2 on: June 10, 2018, 03:31:38 PM »
I repeat, the sound plays fine when the file is in avidemux

It plays fine. But just once. If you rewind (go to the beginning of the video), the audio is lost. The workaround is not to start reencoding from the first keyframe but from the second one (set the marker A to the second keyframe).

Yes, this is a bug, likely in the Asf demuxer.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Still can't convert WMV properly
« Reply #3 on: June 10, 2018, 05:17:40 PM »
More precisely, it is a bug in asfAudioAccess::goToTime, a simple

Code: [Select]
diff --git a/avidemux_plugins/ADM_demuxers/Asf/ADM_asfAudio.cpp b/avidemux_plugins/ADM_demuxers/Asf/ADM_asfAudio.cpp
index 7749ccb6..4d24484d 100644
--- a/avidemux_plugins/ADM_demuxers/Asf/ADM_asfAudio.cpp
+++ b/avidemux_plugins/ADM_demuxers/Asf/ADM_asfAudio.cpp
@@ -98,7 +98,7 @@ bool   asfAudioAccess::goToTime(uint64_t dts_us) // PTS!
     int size=_seekPoints->size();
     if(dts_us<=(*_seekPoints)[0].pts || size<2)
     {
-          return setPos( 0);
+        return _packet->goToPacket((*_seekPoints)[0].packetNb);
     }
 
     for(int i=size-2;i>=0;i--)

works, but results in a short burst of noise at the beginning of video after rewind.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Still can't convert WMV properly
« Reply #4 on: June 10, 2018, 10:36:15 PM »
For WMV, the loss of audio on rewind should be mostly fixed by [demuxers/Asf] Do not lose audio on rewind (it still happens sometimes for unrelated reasons). No solution for the burst of noise (actually, ~100 ms of the last played audio before rewinding) so far.

Bart Z Lederman

  • Newbie
  • *
  • Posts: 4
Re: Still can't convert WMV properly
« Reply #5 on: June 11, 2018, 09:38:58 AM »
I've tried converting by opening the WMV file and immediately writing the output without trying to play the file at all. This does not appear to make any difference, the output still has no sound.

I will try skipping forward to the first key frame and then writing the output.

I haven't looked at the source code, but it seems to me that this problem is very well defined, and should be fixable. There are other programs that run on Windows that can do the conversion.  I've successfully converted WMV to AVI using Any Video Converter, VLC, and even ffmpeg from the command line.  The problem is, none of them can do color corrections, or deinterlace, or do other fixes, VLC is very cumbersome for doing conversions, and Any Video Converter sometimes gets the video size wrong.  I'd rather do it in Avidemux if I can.

eumagga0x2a

  • Moderator
  • Hero Member
  • *****
  • Posts: 2293
Re: Still can't convert WMV properly
« Reply #6 on: June 11, 2018, 10:35:47 AM »
I've tried converting by opening the WMV file and immediately writing the output without trying to play the file at all. This does not appear to make any difference, the output still has no sound.

Right, this can't make a difference because Avidemux internally rewinds when saving from the beginning of the video. A this moment we hit the bug and lose the audio.

Quote
I will try skipping forward to the first key frame and then writing the output.

Depending on particular video, just skipping one or two frames may be already enough to avoid the bug. The starting point must be after the first audio seek point (max 500 ms) for that.

Quote
I haven't looked at the source code, but it seems to me that this problem is very well defined, and should be fixable.

It is fixed. Just the side effect of a brief (~50 ms long) noise burst is unsolved. Download and use the next nightly once it has been built and uploaded.