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 > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd March 2007, 23:51   #1  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
opening an .MP4 in Avisynth ?

Hi looking for suggestions or a link for opening an .MP4 file in avisynth ...

Saw neuron2's thread "AVC/H.264 Avisynth source filter released" http://forum.doom9.org/showthread.php?t=122598&page=4 however its closed for some patching (really looking forward to it).

Wonder if this'd work -
1. demux using AVIdemux2 http://avidemux.sourceforge.net/ (can it demux .MP4 I wonder?)
2. mux into an AVI using avc2avi http://forum.doom9.org/showthread.ph...495#post610495
3. use AVISource in Avisynth on the .avi from step 2 (have xvid and ffdshow installed, so one of these codecs should pick it up ?) ... cleanup in avisynth and feed into HC
4. use ffmpeggiu http://www.videohelp.com/tools?tool=ffmpegGUI to convert the audio from step 1 into .mp2 or something together with the .mpv file from step 3, as input to a DVD authoring tool.

Also, wondering does .MP4 have a framerate and if so how do I tell what it is ? AVIcodec doesn't seem to tell me about .MP4's. Do you reckon I'll have audio sync issues with the above approach ? You may have suggestions which work better (ps not really wanting to install haali).
halsboss is offline   Reply With Quote
Old 3rd March 2007, 00:09   #2  |  Link
zambelli
Doom9ing since 2001
 
zambelli's Avatar
 
Join Date: Oct 2001
Location: Seattle, WA, USA
Posts: 1,965
Why all that trouble? Just use DirectShowSource with fps and convertfps=true.
zambelli is offline   Reply With Quote
Old 3rd March 2007, 00:10   #3  |  Link
ilovejedd
insane college undergrad
 
ilovejedd's Avatar
 
Join Date: Jun 2006
Location: middle of nowhere
Posts: 404
I think MP4, like MKV, supports variable framerate. I'm also very much looking forward to neuron2's AVC filter. In the meantime, though, why not just install Haali Media Splitter and use DirectShowSource()?
ilovejedd is offline   Reply With Quote
Old 3rd March 2007, 00:10   #4  |  Link
Pookie
Registered User
 
Join Date: Apr 2005
Posts: 1,339
DirectShowSource ought to do it, as long as you have the codec installed to play the MP4 in Windows.
Pookie is offline   Reply With Quote
Old 3rd March 2007, 00:20   #5  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
OK DirectshowSource seems like the go, since I have xvid and ffdshow...

does DirectshowSource depend on haali ? Not really wanting to install it - happy to demux the .mp4 first if I have to, assuming the demuxed video ES will go into DirectShowSource.

Also, sort of a gspot/avicoded tool type of question, how could I find out the .MP4's framerate and other info, since I'll need it for "with fps and convertfps=true" ... "MP4, like MKV, supports variable framerate" doesn't sound promising...

Last edited by halsboss; 3rd March 2007 at 00:26.
halsboss is offline   Reply With Quote
Old 3rd March 2007, 00:39   #6  |  Link
ilovejedd
insane college undergrad
 
ilovejedd's Avatar
 
Join Date: Jun 2006
Location: middle of nowhere
Posts: 404
You'll need an MP4 splitter on your PC for DirectShowSource to be able to play. My desktop PC was able to do it without my needing to install Haali Splitter but I think it might be either Nero or QuickTime which provided the splitter. Try creating a script with
Code:
DirectShowSource("file.mp4")
just to test if you'll still need a splitter or not.

The latest version of GSpot supports MP4, I believe. There's also MediaInfo.

You can extract the video as AVI using mp4box but AVI doesn't really play nice with variable frame rate that's why it's better to use DirectShowSource in this instance.
ilovejedd is offline   Reply With Quote
Old 3rd March 2007, 00:48   #7  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Ah. ilovejedd, that makes it a bit clearer. I have a new full Nero7 so I hope that'll do the splitting... will give the script a try, and download gspot too. Pity avi and vfr don't mix. Oh well. Roll on, neuron2's AVC filter...

Any reason I should prefer either of Gspot or MediaInfo (eg no "phone-home" or some such... mediainfo appears to be a Sourceforge project which could be "safer" maybe) ?

Last edited by halsboss; 3rd March 2007 at 00:52.
halsboss is offline   Reply With Quote
Old 3rd March 2007, 01:21   #8  |  Link
ilovejedd
insane college undergrad
 
ilovejedd's Avatar
 
Join Date: Jun 2006
Location: middle of nowhere
Posts: 404
I use both but I use MediaInfo more frequently purely because there's a command line version. No spyware or adware in either. Although, GSpot seems to be more accurate and fault tolerant. I've had several files that were reported incorrectly with MediaInfo that GSpot handled correctly.
ilovejedd is offline   Reply With Quote
Old 3rd March 2007, 05:17   #9  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Oh Dear. This
Code:
DirectShowSource("D:\DVD\file.mp4",fps=25,convertfps=true)
converttoyv12()
Opens in Windows Media Player 10, but HC shows the Avisynth error message
Code:
Directshowsource. Could not open as video or audio.
Any ideas ? Must I retreat to encoding Nero Vision, which doesn't let me clean it up with avisynth filters ?

Last edited by halsboss; 3rd March 2007 at 09:26.
halsboss is offline   Reply With Quote
Old 3rd March 2007, 06:03   #10  |  Link
ilovejedd
insane college undergrad
 
ilovejedd's Avatar
 
Join Date: Jun 2006
Location: middle of nowhere
Posts: 404
Can you open the script in VirtualDub? If not, then I guess you'll have to give Haali Splitter a try.
ilovejedd is offline   Reply With Quote
Old 3rd March 2007, 09:33   #11  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Confirmed. This
Code:
DirectShowSource("D:\DVD\file.mp4",fps=25,convertfps=true)
converttoyv12()
Does open and play fine in Windows Media Player 10, but doesn't open and play in either of

1. HC which shows the Avisynth error message
Code:
Directshowsource. Could not open as video or audio.
2. Vdub 1.6.17 which says
Code:
Avisynth open failure
DirectShowSource: Could not open as video or audio.
Video returned: "DirectShowSource: couldn't open file D:\DVD\file.mp4:
Cannot play back the file.  The format is not supported."
Audio returned: "DirectShowSource: the filter graph manager won't talk to me"
Seems strange that avisynth/directshowsource works in one program but not another for the exact same file/avs... I'm at a bit of a loss as to why that may be so. AviSynth version is 2.5.6 by the way. A bug of some sort ?

Last edited by halsboss; 3rd March 2007 at 09:36.
halsboss is offline   Reply With Quote
Old 3rd March 2007, 13:16   #12  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,174
Try 2.5.7, there were tons of DirectShowSource improvements in it. It also has a log= and logmask= parameters that you can use to help trace DShow errors.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 23rd March 2007, 17:17   #13  |  Link
derebo
Registered User
 
Join Date: Oct 2004
Posts: 60
hi,

you've given me the key to get right framerate with variable framerate!

fps=25,convertfps=true

that's it! by the way, can you explain an avisynth newbie the need for:

converttoyv12()

even when virtualdub will output 24bit RGB?

my post covers 3gp > xvid conversion. you might find something useful there:
http://forum.doom9.org/showthread.ph...818#post973818


greetings,
derebo is offline   Reply With Quote
Old 23rd March 2007, 20:35   #14  |  Link
foxyshadis
ангел смерти
 
foxyshadis's Avatar
 
Join Date: Nov 2004
Location: Lost
Posts: 9,174
The only reason for it is if you're opening it directly into a command-line codec, or want to feed it from virtualdub with fast recompress. Vdub can read just about any colorspace format.
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order. ~ Ed Howdershelt
foxyshadis is offline   Reply With Quote
Old 23rd March 2007, 22:08   #15  |  Link
smok3
brontosaurusrex
 
smok3's Avatar
 
Join Date: Oct 2001
Posts: 2,361
halsboss, iam guessing this is actually nero splitter problem, do try that halli way.
smok3 is offline   Reply With Quote
Old 9th May 2007, 07:31   #16  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Quote:
Originally Posted by smok3 View Post
halsboss, iam guessing this is actually nero splitter problem, do try that halli way.
Thanks for the suggestion on the issue source. Just saw the mp4box documentation at http://gpac.sourceforge.net/doc_mp4box.php . Next crummy mp4 I come across, maybe I try the latest MP4box to re-jig it and see if that fixes it ? Say with "-tight" and/or "-isma" ? (saves me installing haali, I like to keep installed codecs/splitters to a minimum using ffdshow & MPC for most things)

Oh, fyi, Firefox printing of http://gpac.sourceforge.net/doc_mp4box.php is problematic per http://forums.mozillazine.org/viewtopic.php?p=2876382 ...

Regards
halsboss is offline   Reply With Quote
Old 25th February 2008, 13:05   #17  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Hi, any new news on "opening an .mp4 in avisynth" front ?

eg, not knowing much about DGAVCDec ... would that do it ? I note its help file says
Quote:
DGAVCDec is an AVC (H.264) decoder suite. It is used to decode AVC streams from such sources as HD-DVD EVOs, captured transport streams, *.264 files, etc. Note that currently only AVC elementary streams and transport streams are supported, so if you have a different container type, such as *.mp4, you will have to demultiplex the raw AVC stream from its container before processing it with DGAVCDec.
so what would you suggest to demux the .mp4 ?

Last edited by halsboss; 25th February 2008 at 13:09.
halsboss is offline   Reply With Quote
Old 25th February 2008, 13:36   #18  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Ah, found this wiki entry http://avisynth.org/mediawiki/FAQ_lo...to_AviSynth.3F which says
Quote:
If your media file contains MPEG-4 ASP video, then there are two possibilities of opening them in AviSynth ...
and
Quote:
If your media file contains MPEG-4 AVC video, then there are two possibilities of opening them in AviSynth:

1) Using the plugin FFmpegSource. See above for its usage. At the moment, the supported containers are: AVI, MKV and MP4.

2) Get DGAVCDec. At the moment you need to extract the raw stream (*.264) from the container first (using MKVExtract, MPlayer, TSRemux or whatever program can extract those streams). Open the raw stream file in DGAVCIndex to create an index file (say track1.dga). Open the index file in AviSynth
As I'm not sure in the general case how to tell what the .mp4 contains (ASP or AVC), DGAVCDec with [which demuxer?] would do the trick ?

Last edited by halsboss; 25th February 2008 at 13:49.
halsboss is offline   Reply With Quote
Old 25th February 2008, 17:53   #19  |  Link
45tripp
Dolphin Blue
 
45tripp's Avatar
 
Join Date: Mar 2007
Posts: 336
ffmpeg -i input.mp4
will tell you what you have for video.

use yamb (mp4box gui) to extractthee raw h264 stream.

gl
45tripp is offline   Reply With Quote
Old 26th February 2008, 10:20   #20  |  Link
halsboss
likes to tinker
 
Join Date: Jan 2004
Location: girt by sea
Posts: 635
Thankyou. This link http://forum.videohelp.com/topic346811.html#1818343 provides some pictorial detail on how to demux including program version info...
However also note the post underneath it which indicates an error message and what versions did download and work with the newer .mp4 AVC input file.
halsboss 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 12:42.


Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2017, vBulletin Solutions, Inc.