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. |
|
|
Thread Tools | Search this Thread | Display Modes |
21st October 2006, 11:20 | #1 | Link |
Registered User
Join Date: Mar 2002
Posts: 2,323
|
encoding 1080p wmv9 + 6ch wma wmv to 480p x264 + 6ch aac mp4
I have tried to encode (with the help of megui) this trailer (it's a self-extracting exe, no drm, 1:53, 126MB) from microsoft, but I have 3 problems:
1. video duration I have used this script (in MPC the decoders are: WMVideo decoder DMO and WMAudio decoder DMO ): Code:
DirectShowSource("Alexander_Trailer_1080p.wmv", audio=False, fps=23.976) crop( 0, 132, 0, -132) LanczosResize(848,352) If I'm using the convertfps=true parameter too (to dssource function), then there are freezed frames: like avisynth adds still frames to get the correct duration. If I'm using the seek=false parameter too, then I get a video as in the 1st case, but not repeated section in the end: so the duration is about 1:38 ... (Of course the original wmv is perfectly played in MPC) I have tried to create a graph with graphedit, like this: Code:
file --> WMVideo Decoder DMO And I also tried to change the WMVideo DMO to ffdshow in the graph (enabling wmv3/wmv9 decodeing): resulting the same ... So what can be the problem, and how can I get rid of that? 2. washed out colors It's like when I switch from Overlay to VMR7 in MPC. Can I do about it something or the original encode is just simlpy bad. 3. couldn't convert 6ch audio 2 channel works fine, but 6ch doesn't. In MPC AC3filter connects to WMAudio DMO and results 6ch audio, but when I create the same graph it's only 2 channel. Strange ... Code:
file --> WMAudio DMO --> AC3filter I checked the PIN out0 info of WMAudio DMO in MPC: Code:
- Connection media type: Audio: WAVE_FORMAT_EXTENSIBLE 48000Hz 6ch 6912Kbps ... - Enumerated media type 1: Audio: WAVE_FORMAT_EXTENSIBLE 48000Hz stereo 2304Kbps ... - Enumerated media type 2: Audio: PCM 48000Hz stereo 1536Kbps Is it means that the decoder can produces different outputs? If it is, then in MPC AC3 filter can connect to 6ch waveformat_ex but not in graphedit ... Strange ... Any idea ? Thanks |
21st October 2006, 12:39 | #2 | Link |
Registered User
Join Date: Nov 2001
Posts: 9,770
|
about 3: m$ blocks 6 channel output from their decoder if you are not using the decoder in windows media player iirc
someone posted a fix for this issue, but i dont remember whether this can help you
__________________
Between the weak and the strong one it is the freedom which oppresses and the law that liberates (Jean Jacques Rousseau) I know, that I know nothing (Socrates) MPEG-4 ASP FAQ | AVC/H.264 FAQ | AAC FAQ | MP4 FAQ | MP4Menu stores DVD Menus in MP4 (guide) Ogg Theora | Ogg Vorbis use WM9 today and get Micro$oft controlling the A/V market tomorrow for free |
21st October 2006, 12:54 | #3 | Link | |
Registered User
Join Date: Jul 2003
Posts: 1,152
|
Quote:
and here fore solution (updated DirectShowSource.dll) http://forum.doom9.org/showthread.ph...961#post861961 |
|
21st October 2006, 14:39 | #4 | Link | |||
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
Quote:
Using Quote:
1) the during will be much shorter (well, in this case, since i guess that the average framerate is well below 23.976). Imo, this is a bit strange for a movie or a movietrailer, since normal movies are shot at 24 fps. 2) the audio will not be in sync as a result of (1). To circumvent this issue you need to use convertfps=true, since it will add or remove frames to get a constant framerate of 23.976 fps (or whatever value the parameter fps is set). If you encode it to MKV, you could create a timecodes file and encode your clip as having a variable framerate. But i'm afraid this only works for hybrid 24/30 fps stuff. (see docs->advanced topics->hybrid-video.htm), and not for general hybrid stuff. This post contains WMVTIMES.exe which can be used to extract a timecodes file (for MKV) directly from the wmv and mux it with the video using mkvmerge. Quote:
|
|||
21st October 2006, 20:22 | #6 | Link |
Angel of Night
Join Date: Nov 2004
Location: Tangled in the silks
Posts: 9,559
|
Actually in this case it's a perfect example of when DeDup would be useful, and none of the hybrid stuff applies. Still, there might be some deeper bizarro problem, I'll take a look at it tonight if you guys haven't solved it.
|
21st October 2006, 23:31 | #7 | Link |
Moderator
Join Date: Nov 2001
Location: Netherlands
Posts: 6,364
|
I tried the following two approaches without succes:
1) Using WMVTIMES.exe i created a MKV timecodes file. I encoded the content to XviD using: Code:
DirectShowSource("F:\HDTV\WMV\Alexander_Trailer_1080p.wmv", fps=29.97, convertfps=true) Code:
DirectShowSource("F:\HDTV\WMV\Alexander_Trailer_1080p.wmv", fps=29.97, convertfps=false, seek=false) "The number of external timecodes 2359 is smaller than the number of frames in this track. The remaining frames of this track might not be timestamped the way you intended them to be. mkvmerge might even crash." which makes sense, because the number of frames is altered. 2) I used the scripts: 1st pass: Code:
DirectShowSource("F:\HDTV\WMV\Alexander_Trailer_1080p.wmv", fps=29.97, convertfps=true) TFM(mode=0,pp=0) TDecimate(mode=4,output="stats.txt") 2nd pass: Code:
DirectShowSource("F:\HDTV\WMV\Alexander_Trailer_1080p.wmv", fps=29.97, convertfps=true) TFM(mode=0,pp=0) TDecimate(mode=6,hybrid=2,input="stats.txt",mkvout="timecodes.txt") I think method 2 should work, and method 1 should also work provided Code:
DirectShowSource("F:\HDTV\WMV\Alexander_Trailer_1080p.wmv", fps=29.97, convertfps=false, seek=false) I haven't tried DeDup yet. |
23rd October 2006, 00:33 | #8 | Link | |
Registered User
Join Date: Mar 2002
Posts: 2,323
|
First of all, thanks for the answers, I managed to create the perfect encode (at least I think so).
A3: with the updated DirectShowSource.dll it's worked like a charm. Thanks! A1: As it turned out it's vfr indeed ! (On the MS page: "To deliver ultra-high quality, these clips were encoded at 24 frames per second (fps)..." ) I never thought about it ! I thought the problem was that my computer is too slow (3Ghz + 1GB RAM) so it drops frames during encoding. So are directshowsource and avisynth intelligent enough to wait for the decoded frames??? So the process is the following: 1. create the timestamp file (Alexander_Trailer_1080p.txt) with: Code:
WMVTIMES.exe Alexander_Trailer_1080p.wmv Code:
wmv file -> WMVideo Decoder DMO wmv file -> WMAudio Decoder DMO Code:
DirectShowSource("a-a.GRF", fps=23.976, video=false) Code:
DirectShowSource("a-v.GRF", audio=false, fps=23.976) crop( 0, 132, 0, -132) LanczosResize(848,352) 5. Do the audio and video encodes into mp4 (so we can decide later the container: mp4 or mkv) with megui (I used x264)... 6. And now the trick: we will cut out the repeated section at the end of the video file with Yamb/mp4box! So we'll get the 1:38 duration... Only question remains: what time must we cut it? Open the timecode file and see how many rows it has (format v2: 1 frame per row in milliseconds) so it equals to the frame number +1 of the clip (because of the first comment row), in our case: 2360-1=2359 (Avisynth sees it 2720 frames...) We devided this with the framerate (23.976): 2359/23.976=98.390 (in seconds) So: Code:
MP4Box.exe -splitx 0:98.390 4-dmo-h264.mp4 7a. mux into mkv - use mkvmerge GUI: add the video and audio track, and select the timecode file to the video stream -> mux 7b. mux into mp4 - we need this util to get the correct timecode for mp4 from the timecode file (it needs mp4box) Code:
tc2mp4 -i 4-dmo-h264_0_98.mp4 -t Alexander_Trailer_1080p.txt -o 4-dmo-h264_0_98-vfr.mp4 So we get a perfectly synched vfr mp4 or mkv file !!! And plus: if you're using the CE-QuickTime profile in MeGUI, the resulted mp4 file can playback by QuickTime player v7.x !!! (at least 2ch sound). (BTW: can we produce a 6ch-mp4 file wich can be playable by QT? I have tried it, but with no luck.) Q2: Quote:
Any other idea? Last edited by chros; 23rd October 2006 at 00:39. |
|
23rd October 2006, 10:57 | #9 | Link |
Registered User
Join Date: Mar 2002
Posts: 2,323
|
I don't know how I missed this yesterday night (maybe I was too tired ), but we can use trim() to specify the correct number of frames, so in this case we don't need the 6. step (cutting) and we get smaller encoding time!
4. - Open the timecode file and see how many rows it has (format v2: 1 frame per row in milliseconds) so it equals to the frame number +1 of the clip (because of the first comment row) and we'll use it in trim so -1 yet, in our case: 2360-2=2358 (Avisynth sees it 2720 frames...) - create the avisynth script for video: Code:
DirectShowSource("a-v.GRF", audio=false, fps=23.976) crop( 0, 132, 0, -132) LanczosResize(848,352) trim(0,2358) "framecount (in v2.57): This is sometimes needed to specify the framecount of the video. If the framerate or the number of frames is incorrect (this can happen with asf or mov clips), use this option to force the correct number of frames. If fps is also specified the length of the audio stream is also adjusted." Last edited by chros; 23rd October 2006 at 20:12. |
25th October 2006, 08:57 | #10 | Link | ||
Doom9ing since 2001
Join Date: Oct 2001
Location: Seattle, WA, USA
Posts: 2,002
|
Quote:
Quote:
Code:
Histogram("levels") |
||
25th October 2006, 19:48 | #11 | Link | ||
Registered User
Join Date: Mar 2002
Posts: 2,323
|
Quote:
And I apologize to Wilbert for being stupid: ColorYUV(levels="TV->PC") solved the problem, the opposite you have suggested, which I haven't tried. I think I can put this ColorYUV() right after the crop() function. Question: is there any quality loss during this conversion ? Quote:
Regardning 7b (when muxing into mp4): there are some clips, where after the encoding the audio isn't synched (7a works perfectly, when we mux into mkv the same encoded clip). So I don't know if tc2mp4 or mp4box mistaken ... The clips are in common: they have 2ch 44100 Hz audio. Godsend The Punisher But with this clip, it's ok too (it has 2ch 48000 Hz audio): Serenity trailer 3 After the tc2mp4 step, the video duration is correct, so maybe mp4box's muxing the 44100 Hz audio badly. |
||
25th October 2006, 23:26 | #12 | Link | |
Doom9ing since 2001
Join Date: Oct 2001
Location: Seattle, WA, USA
Posts: 2,002
|
Quote:
I would recommend leaving the luma range as is and compensating in your decoder, video driver or display instead. |
|
1st November 2006, 14:11 | #13 | Link | |||
Registered User
Join Date: Mar 2002
Posts: 2,323
|
Quote:
And there are other sources from Apple (eg. Eragon 132MB, District B13, and the others), where the black is non-black. I have tried this function, but I don't know if it's reliable. If I'm right it's strechs out the black range... Or the whole range? Code:
Levels(3, 1, 255, 0, 255, coring=false) Quote:
Code:
SSRC(last, 48000) Quote:
The tricky part is how can we gain the timecode file from the source. wmv: WMVTIMES.exe mkv: mkvextract.exe Is there any tool for this in case of mp4 and realmedia? @Wilbert: I have find your Variable FrameRate Video tutorial - thanks for it - (in google cache, since avisynth.org is down, date: 10 May 2006, so I don't know if these infos are up-to-date, but if they are) You can update the following sections: - Encoding to vfr (mp4) - Opening non-avi vfr content in AviSynth and - reencoding to vfr |
|||
3rd November 2006, 01:35 | #14 | Link | |
Doom9ing since 2001
Join Date: Oct 2001
Location: Seattle, WA, USA
Posts: 2,002
|
If you use MPC or Zoom or some other player that lets you pick the video renderer, try switching between Overlay and VMR9, apparently it makes a difference. See:
http://forum.doom9.org/showthread.ph...362#post808362 Quote:
PHP Code:
|
|
27th November 2006, 12:00 | #15 | Link |
Avisynth Developer
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
|
Try this updated DSS.dll http://forum.doom9.org/showthread.php?t=118715
|
9th December 2006, 07:46 | #16 | Link | |
Registered User
Join Date: Mar 2002
Posts: 2,323
|
Quote:
|
|
Thread Tools | Search this Thread |
Display Modes | |
|
|