4

I have a file downloaded from the web this is the media below.

General
Format                                   : WebM
Format version                           : Version 2
File size                                : 10.3 MiB
Duration                                 : 6mn 30s
Overall bit rate mode                    : Variable
Overall bit rate                         : 222 Kbps
Movie name                               : Untitled
Writing application                      : Lavf53.13.0
Writing library                          : Lavf53.13.0

Video
ID                                       : 1
Format                                   : VP8
Codec ID                                 : V_VP8
Duration                                 : 6mn 30s
Bit rate                                 : 76.6 Kbps
Width                                    : 1 024 pixels
Height                                   : 768 pixels
Display aspect ratio                     : 4:3
Frame rate mode                          : Constant
Frame rate                               : 15.000 fps
Compression mode                         : Lossy
Bits/(Pixel*Frame)                       : 0.006
Stream size                              : 3.57 MiB (34%)
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : Vorbis
Format settings, Floor                   : 1
Codec ID                                 : A_VORBIS
Duration                                 : 6mn 30s
Bit rate mode                            : Variable
Bit rate                                 : 128 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 5.96 MiB (58%)
Writing library                          : libVorbis (Schaufenugget) (20101101 (Schaufenugget))
Language                                 : English
Default                                  : Yes
Forced                                   : No
Writing application                      : Lavc53.19.0

I tried transcoding the file into MKV but no luck I could not get it to fix the seek issues:

mkvextract tracks file.webm 0:file.ivf
mkvextract tracks file.webm 1:file.ogg
mkvmerge -o file.mkv file.ivf file.ogg

I also tried fixing the indexes using mencoder but it got worse.

mencoder input.mkv -idx -ovc copy -oac copy -o output.mkv

I also tried Metorite

Meteorite is MKV / Matroska file repair engine. That repairs MKV files and can repair MKV files still downloading from internet.

I was able to seek but the video halts after moving the video sliders , the audio remains normal.

Do you know other ways to fix the seek issues?

Aivan Monceller
  • 567
  • 2
  • 10
  • 21

3 Answers3

2

I solved the seek issues by using this FFmpeg command

ffmpeg -i file.webm -vcodec copy -acodec libvo_aacenc -b:a 128k file.avi

This command copies the video stream from the webm file and re encodes the audio using livbo_aacenc codec or AAC. Then it muxes the streams into an AVI container.

Aivan Monceller
  • 567
  • 2
  • 10
  • 21
  • 1
    THANK YOU for posting your own answer. I can confirm for anyone coming from google that this will fix seeking problems on `MKV` files when trying to play in `VLC` or any other media player. You will probably get an encoding error if you are using `libvo_aacenc` so either add `-ac 2` to the audio parameters to force 2 channels, OR use a different audio encoder like `aac` with the `-strict experimental` flag (didn't work for me on Windows though). – degenerate Feb 16 '14 at 21:57
  • Is there a fix for copying the audio stream rather than transcoding it? I'm converting mp3 files to mp4. – Llamageddon Jan 01 '18 at 17:56
1

The WebM project container guidelines page discusses this specifically and offers the tool mkclean.

Although my transcodes were seekable before using mkclean, remuxing them with it has:

  • Cut down the size per file.
  • Greatly improved seeking performance
g2mk
  • 1,428
  • 12
  • 15
psy phii
  • 11
  • 1
-1

To elaborate on Aivan's solution above, if you want to convert ALL your MKV videos to seekable AVI really fast, use the following batch script I wrote:

@echo on
set /A nfile=0
@echo Copying directory structure from %0 to %1 ...
xcopy /T %1 %2
for /R %1 %%i in (*.mkv) do (
    ffmpeg -i "%%i" -c:v copy -c:a libvo_aacenc -b:a 320k -ac 2 "%2%%~pi%%~ni.avi"
    set /A nfile+=1
)

echo Done! Converted %nfile% file(s)
pause

You will need to put ffmpeg.exe in the same folder as all the videos and save this as go.bat and run it. The -ac 2 flag sets all the sound to 2-channel stereo, as a warning. I don't know another way to get libvo_aacenc to work properly without throwing an error.

degenerate
  • 436
  • 5
  • 21
  • 1
    thanks for taking some time to read into this. No one has really bothered answering this question so I posted what I discovered. Thanks for the script! – Aivan Monceller Feb 19 '14 at 10:59