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 |
11th September 2012, 23:53 | #1 | Link |
Registered User
Join Date: May 2007
Posts: 146
|
Can I use ffmpegsource/ffvideosource to determine video format
Hi
I looked through the docs for ffmpegsource - couldn't find what I was looking for. Can I use ffmpegsource/ffvideosource avisynth plugin [ffms2.dll] to determine the type of video codec, i.e. 264, vc1, or mpeg-2/mpv/m2v re ts or m2ts clip? TIA |
12th September 2012, 14:10 | #3 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
You saw the MediaInfo demo in another thread
(http://forum.doom9.org/showthread.ph...78#post1590078) MediaInfo allows you to use a template to query the info that your after, and you could I think access via RT_Stats funcs (although I have not tried it).
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
12th September 2012, 20:41 | #4 | Link |
Registered User
Join Date: May 2007
Posts: 146
|
@TheFluff
Thanks for the info @StainlessS Yes, I saw that MediaInfo demo - and did a test run with it - another great tool Looks like that is best way to do this with an avisynth script - I have been avoiding using MediaInfo - probably cause I was too lazy to figure out all the syntax commands |
13th September 2012, 02:45 | #5 | Link |
Registered User
Join Date: May 2007
Posts: 146
|
@StainlessS
Well this seems to work as long as RTCall.avs is in the same folder i.e. D:\MediaTest along with MediaInfo.dll, MediaInfo.exe, and Template.txt RTCall.avs Code:
FN = "D:\newmobcal1440_12mbps.ts" filename = "D:\MediaTest\mymedia.bat" quote = chr(34) media = "mediainfo.exe --Inform=file://Template.txt " + quote + FN + quote + " >> sept12.txt" RT_TxtWriteFile(media,filename) RT_Call("D:\MediaTest\mymedia.bat") retrun ColorBars() General;ClipName->%CompleteName%\nVideoCodec:%Video_Format_List%\nAudioCodec:%Audio_Format_List%\n Video;VideoWidth:%Width%\r\nVideoHeight:%Height%\r\nVideoFramerate:%FrameRate%\r\nVideoFrameCount:%FrameCount%\r\nVideoStreamSize in bytes:%StreamSize%\r\nVideoDuration in ms:%Duration%\r\nVideoBitrate in bps:%BitRate%\r\nPixelAspectRatio:%PixelAspectRatio%\r\nDisplayAspectRatio:%DisplayAspectRatio%\r\n Audio;AudioDuration in ms:%Duration%\r\nAudioBitRate in bps:%BitRate%\r\nAudioChannels:%Channel(s)%\r\nAudioSamplingRate:%SamplingRate%\r\nAudioStreamSize in bytes:%StreamSize% Output: ClipName->D:\newmobcal1440_12mbps.ts VideoCodec:MPEG Video AudioCodec:AC-3 VideoWidth:1440 VideoHeight:1080 VideoFramerate:29.970 VideoFrameCount:1810 VideoStreamSize in bytes:104715052 VideoDuration in ms:60394 VideoBitrate in bps:13870984 PixelAspectRatio:1.333 DisplayAspectRatio:1.778 AudioDuration in ms:60128 AudioBitRate in bps:384000 AudioChannels:2 AudioSamplingRate:48000 AudioStreamSize in bytes:2886144 Works opening RTCall.avs in VirtualDub, AvsPMod, and MediaPlayerClassic Perhaps you can come up with a better way to implement this . . |
13th September 2012, 22:41 | #7 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Currently modding AutoCropLevelsGenny.avs to take a MediaInfo template (like yours above) with a paired replacement file,
so replacement file (line for line matching the mediainfo template) might contain eg:- Code:
[MI_CLIPNAME] [MI_VIDEOCODEC] [MI_AUDIOCODEC] [MI_VIDEOWIDTH] [MI_VIDEOHEIGHT] Would allow you to select any info you like that is output by Mediainfo and insert it into a generated log, avs or command file. Also adding a group command file (containing commands for entire directory of clips) with header and tail templates, so eg head might ask for input (eg bitrate) and tail might wait for keypress.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 13th September 2012 at 22:54. |
14th September 2012, 04:56 | #8 | Link |
Registered User
Join Date: May 2007
Posts: 146
|
@StainlessS
Now that sounds interesting I was thinking - it would be possible to analyze a video using various tools, create a custom batch file for encoding, and run the batch file from VirtualDub that can use x264 or HCEnc - all within an avs file . . . |
14th September 2012, 09:32 | #9 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
There is a prob with the above mentioned paired replacement, if you want a specific stream eg Eng subs for hard of hearing.
It would have no way at all of knowing what you want, it only matches the pair of template lines and simply replaces text. You might be able to eg fetch data for the first n sets of subs and in script, make them into pseudo arrays using RT_TxtAddStr, then scan the arrays to figure out which is closest to the required. I dont myself really need that, I usually dump non wanted streams during ripping. Anyway, the script when done will just be a demo, and intended as a starting point for more adventurous scripts. Keep getting bitten by the 4096-1 string concatenation/allocation bug in 2.58 & 2.6a3, you really need to be using the RT_StrAddStr and RT_TxtAddStr functs to avoid, thought I'd discovered another string bug, but turned out I had somehow reverted back to an earlier version of this script function (StrReplace):- http://forum.doom9.org/showthread.ph...02#post1590402 Although, I have to wonder if the bug can appear in eg LeftStr, MidStr etc too. EDIT: No it cant. EDIT: 4096-1 bug, not affect filenames, too short.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? Last edited by StainlessS; 14th September 2012 at 18:55. |
14th September 2012, 10:05 | #10 | Link | |
Avisynth language lover
Join Date: Dec 2007
Location: Spain
Posts: 3,431
|
Quote:
LeftStr, MidStr, etc, use strncat() and are not affected. |
|
14th September 2012, 10:13 | #11 | Link |
HeartlessS Usurer
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
|
Danke Sehr.
__________________
I sometimes post sober. StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace "Some infinities are bigger than other infinities", but how many of them are infinitely bigger ??? |
|
|