Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > New and alternative a/v containers

Reply
 
Thread Tools Search this Thread Display Modes
Old 1st December 2012, 07:24   #1  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
PotPlayer captures corrupted MKV files

I used Video: Capture... option in PotPlayer to capture two videos in MKV format, but the ending files cannot be demuxed by any software I tried (MKVExtractGUI-2, MKVcleaver, Mkv2Mp4, mkv/avi to mp4 and pgc.NET). I used Project Meteorite and mkwdclean to try to fix them, but it doesn't work. The first file plays as an audio in MPC-HC, while PotPlayer shows video normally. I think it's because I didn't click on Stop button when recording in PotPlayer, I immediately exit the program. The second file plays just fine, but it also cannot be demuxed. The sample files are here. Thank you in advance.
TheRancher is offline   Reply With Quote
Old 1st December 2012, 11:42   #2  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,443
Player fine in MPC-HC for me (using LAV Filters as splitter and decoder).
Extraction works fine with ffmpeg and muxing the raw streams works fine with mp4box (remuxed as mp4)

Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 1st December 2012, 12:06   #3  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
Now if only I knew how to use ffmpeg... It's command line, right? Can you tell me the code for demuxing and how can I do it?
TheRancher is offline   Reply With Quote
Old 1st December 2012, 13:05   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,443
I used Hybrid to remux to mp4
here are the command line it uses for the 1st file (analog for the 2nd):
extract audio:
Code:
ffmpeg -y -threads 8 -i "C:\Users\Selur\Desktop\Sample\01.mkv" -vn  -acodec copy  "H:\Temp\iId_1_aid_0_DELAY_18ms_13_03_18_701_01.aac"
extract video:
Code:
ffmpeg -y -i "C:\Users\Selur\Desktop\Sample\01.mkv" -vcodec copy -an -vbsf h264_mp4toannexb -f rawvideo "H:\Temp\13_03_18_701_02.264"
multiplex audio&video:
Code:
MP4Box -add "H:\Temp\13_03_18_701_02.264"#video:fps=25:par=1000/1000 -brand avc1 -add "H:\Temp\iId_1_aid_0_DELAY_18ms_13_03_18_701_01.aac"#audio:delay=18 -mpeg4 -itags tool="Hybrid 2012.11.30.1" -tmp "H:\Temp" -new "H:\Output\13_03_18_701_03.mp4"
Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 1st December 2012, 16:56   #5  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
Audio extraction went alright. Video extraction reports this error message constantly: "Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid argument". However, it extracts the video in the end, though I have no idea if everything went OK. Also, multiplexing cannot run it just exits the command prompt.
TheRancher is offline   Reply With Quote
Old 1st December 2012, 20:45   #6  |  Link
nhakobian
Registered User
 
Join Date: Oct 2009
Location: San Francisco, CA
Posts: 101
Quote:
Originally Posted by TheRancher View Post
Audio extraction went alright. Video extraction reports this error message constantly: "Failed to open bitstream filter h264_mp4toannexb for stream 0 with codec copy: Invalid argument". However, it extracts the video in the end, though I have no idea if everything went OK. Also, multiplexing cannot run it just exits the command prompt.
If I remember correctly, that was a bug in older versions of ffmpeg using -vcodec copy and a bitstream filter (-vbsf filtername).

I can confirm that it works correctly in a recent build of ffmpeg provided in libav (tested on several video files both in mp4 and mkv containers):

Code:
$ ffmpeg -version
ffmpeg version 0.8.4-4:0.8.4-0ubuntu0.12.04.1, Copyright (c) 2000-2012 the Libav developers
  built on Nov  6 2012 16:51:33 with gcc 4.6.3
*** THIS PROGRAM IS DEPRECATED ***
This program is only provided for compatibility and will be removed in a future release. Please use avconv instead.
ffmpeg 0.8.4-4:0.8.4-0ubuntu0.12.04.1
libavutil    51. 22. 1 / 51. 22. 1
libavcodec   53. 35. 0 / 53. 35. 0
libavformat  53. 21. 0 / 53. 21. 0
libavdevice  53.  2. 0 / 53.  2. 0
libavfilter   2. 15. 0 /  2. 15. 0
libswscale    2.  1. 0 /  2.  1. 0
libpostproc  52.  0. 0 / 52.  0. 0
nhakobian is offline   Reply With Quote
Old 1st December 2012, 23:33   #7  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
I used the latest version of ffmpeg found here (64-bit), and later tried the one in Hybrid package. The same error showed up.
Quote:
Originally Posted by nhakobian View Post
I can confirm that it works correctly in a recent build of ffmpeg provided in libav (tested on several video files both in mp4 and mkv containers).
I just tried a non-corrupted MKV file and there were no errors at all. Please try the files from the first post instead and tell me the results.

By the way, why multiplexing cannot run?
TheRancher is offline   Reply With Quote
Old 2nd December 2012, 18:41   #8  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,443
extraction&multiplexing worked fine for me with your sample,..

Quote:
By the way, why multiplexing cannot run?
What exactly were your calls looking like? And did the 1st two create files?
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 2nd December 2012, 23:42   #9  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
Quote:
Originally Posted by Selur View Post
What exactly were your calls looking like? And did the 1st two create files?
I used the same codes as you, I only changed the location. And yes, both video and audio files were created.
I just tried the samples I posted here instead of the full-length files for both audio and video extraction, and there's the same error in latter one. Could it be a problem with codecs? I have FFDShow, CoreAVC and Haali Media Splitter installed and I am running Windows 8 64-bit. Also, I tried Hybrid GUI and SUPER, but they cannot start multiplexing too. I am desperate.
TheRancher is offline   Reply With Quote
Old 2nd December 2012, 23:47   #10  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,443
Hybrid doesn't use any of the mentioned (FFDShow, CoreAVC and Haali Media Splitter) on muxing,..
+ I can remux the sample without a problem using Hybrid.
-> can you remux the sample with Hybrid or does that also not work for you?
(I'm using Windows 7 64bit, but that should not make a difference)

Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 3rd December 2012, 00:01   #11  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
Neither Hybrid nor SUPER can remux the sample files. Should I post a Hybrid log, if that helps?
TheRancher is offline   Reply With Quote
Old 3rd December 2012, 00:05   #12  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,443
Normal log doesn't help, create a debug log and upload it in example to pastebin and send me a link via pm.
I can test tomorrow on my Windows 8 laptop if I can reproduce the problem.
(going to bed now, 12pm here)

Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 3rd December 2012, 00:08   #13  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
Before you go, can you tell me how can I create a debug log?
TheRancher is offline   Reply With Quote
Old 3rd December 2012, 00:11   #14  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,443
Config->Internals->Handling->Create debug file,.. (see: http://www.selur.de/support)
best is you
1. start Hybrid
2. set an Output file
3. enabled the debug output
(-> the debug output will be created in the output folder)
4. load your source
5. do your settings
6. add and run the job
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 3rd December 2012, 09:19   #15  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,443
-> DOH, you have to enable: "Config->Input settings->General Settings->Stream extraction with ffmpeg" otherwise mkvmerge is used and the extractions doesn't work properly.
ffmpeg on the other hand extracts the video properly.
(when 'Stream extraction with ffmpeg' is enabled it works fine on Win8; just realized drag&drop is broken on Win8 with current Hybrid)
seems like mkvmerge is more picky than ffmpeg regarding you source.

Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 3rd December 2012, 16:24   #16  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
It works! Thank you very much! Unfortunately, another problem is showing up. The audio noticeably goes out of sync after 15 minutes, approximately a second, and it keeps increasing until it reaches enormous number at the end of the file (about 10 seconds late). The original file is completely in sync. Why is that so and how can I fix it?
TheRancher is offline   Reply With Quote
Old 3rd December 2012, 16:33   #17  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,443
wild guess: your file is vfr, if so, try if it helps you enable "Config->Automation->Always extract timecodes from mp4/mkv/flv files"
If that doesn't help you can try using ffmpeg via command line and do the whole copying through ffmpeg:
Code:
ffmpeg -y -i "Path to input" -vcodec copy -acodec copy "Path to output"
(make sure output and input are different files!)

Cu Selur
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Old 3rd December 2012, 17:12   #18  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
Man, you're a genius. Thanks! The first method worked great.
TheRancher is offline   Reply With Quote
Old 5th December 2012, 15:13   #19  |  Link
TheRancher
Registered User
 
Join Date: Oct 2010
Posts: 42
Here's the explanation from PotPlayer author:
Quote:
PotPlayer is using own H.264 codec FCC using for muxing MKV.

But it is almost standard.

So your demuxer programs's fail.

So I cannot want to change PotPlayer MKV muxing.

So use other player or other video codec(MPEG4...)
I don't see a point of using a modified H.264 codec for muxing MKV files.
TheRancher is offline   Reply With Quote
Old 5th December 2012, 15:16   #20  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 6,443
Quote:
But it is almost standard.
LOL
Quote:
PotPlayer is using own H.264 codec FCC using for muxing MKV.
wondering why the author started using a non standard FCC in the first place,..
__________________
Hybrid here in the forum, homepage
Notice: Since email notifications do not work here any more, it might take me quite some time to notice a reply to a thread,..
Selur is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 11:27.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, vBulletin Solutions Inc.