[request] MediaInfo Mod

Started by TheLastKinQ, May 01, 2014, 02:53:36 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

stoner

#17
hmm..

I did mess with the scars autouploader.  Takes screenshots and also mediainfo.  Which is posted to site as a .txt file.  No separate fields filled in though.  More like the description is done.   Does require a bit of work on the auto uploader server though, tbh I cant remember fully what I did now, but could supply some files to look over if needed.


upload file of the auto upper:
#Call media info. 
echo "### rlspath: $RLSPATH" >> "$LOGFILE"
echo "### name: $NAME" >> "$LOGFILE"
IFS=$'\n'
#INFOMEDIA=$(find $RLSPATH -type f -iname "*.avi"  -o -iname "*.mkv"  -o -iname "*.mp4"  ! -iname "*sample*")
#find /home/bot/downloads/Vampires.Kiss.1988.DVDRip.XviD.AC3-EBX ! -iname "*sample*" \( -iname "*.mkv" -o -iname "*.avi" -o -iname "*.mp4" \)
INFOMEDIA=$(find $RLSPATH ! -iname "*sample*" \( -iname "*.mkv" -o -iname "*.avi" -o -iname "*.mp4" \))
MEDIAINFO=$(mediainfo $INFOMEDIA) 
#$RLSPATH should be the containing directory, so we run a find command looking for any file that ends in mkv, avi, mp4 which does not contain sample in the name (we dont want the info from that)
#find $NAME -type f -iname "*.avi"  -o -name "*.mkv"  -o -name "*.mp4" ! -iname "*sample"
echo "Mediainfo for $INFOMEDIA found and is being added"
#echo "### infomedia: $INFOMEDIA" >> "$LOGFILE"
#echo "### mediainfo: $MEDIAINFO" >> "$LOGFILE"
echo "$MEDIAINFO" > "media.tmp"
MEDIAINFO="media.tmp"


#Take Screenshots And Upload
echo "We are now taking 3 screenshots to add to the upload process"
ffmpeg -ss 00:03:30 -t 1  -i $INFOMEDIA -f mjpeg screenshot.png
ffmpeg -ss 00:05:30 -t 1  -i $INFOMEDIA -f mjpeg screenshot1.png
ffmpeg -ss 00:07:30 -t 1  -i $INFOMEDIA -f mjpeg screenshot2.png

SCREENSHOT="screenshot.png"
SCREENSHOT1="screenshot1.png"
SCREENSHOT2="screenshot2.png"

denede

have this made on my script.. nothing fancy, just some fields that uploader needs to fill in order to show on details page

TheLastKinQ

pls help me I don't work this mod.


Sawyer

#13
You, as uploader, of course you can extract a mediainfo log because you have the video file. Then copy-paste that log on the upload page and voila, the script does his job and extract all those values that you need.
Without MediaInfo log you can't do this.

@zokii1983, I did not make that just from the torrent file, it's impossible, as you said. I think you confuse MediaInfo with Metainfo from the torrent file.
This is MediaInfo: http://mediaarea.net/en/MediaInfo

You can find here the mode: http://bit-torrent.kiev.ua/mediainfo_mod-t9990/index.html
I don't know if it's fully working.

cm27

see as auto said if you have access to this file then your golden...

Code (php) Select

General
Complete name                            : Divine Bitches - 20140129 - ( Cherry Torn, Orlando, Bella Rossi & John Jammen ) - The Sperm Bank - 720p.mp4
Format                                   : MPEG-4
Codec ID                                 : M4V
File size                                : 1.77 GiB
Duration                                 : 49mn 43s
Overall bit rate mode                    : Variable
Overall bit rate                         : 5 102 Kbps
Encoded date                             : UTC 2014-01-28 23:48:45
Tagged date                              : UTC 2014-01-28 23:48:45

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.2
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 2 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 49mn 43s
Bit rate mode                            : Variable
Bit rate                                 : 4 968 Kbps
Maximum bit rate                         : 7 000 Kbps
Width                                    : 1 280 pixels
Height                                   : 720 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 29.970 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.180
Stream size                              : 1.73 GiB (97%)
Encoded date                             : UTC 2014-01-28 23:48:45
Tagged date                              : UTC 2014-01-28 23:48:45

Audio
ID                                       : 2
Format                                   : AAC
Format/Info                              : Advanced Audio Codec
Format profile                           : LC
Codec ID                                 : 40
Duration                                 : 49mn 43s
Bit rate mode                            : Variable
Bit rate                                 : 128 Kbps
Maximum bit rate                         : 137 Kbps
Channel(s)                               : 2 channels
Channel positions                        : Front: L R
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 44.7 MiB (2%)
Encoded date                             : UTC 2014-01-28 23:48:45
Tagged date                              : UTC 2014-01-28 23:48:45


Never fall to those that just sit there.. Always look for the way to the top even if you have to code it your self and mistakes and all... quote from BonZO...

cm27

I bet what he after is what we used back when KVCD where golden.. I know of one site the use mediainfo kinda like the nfo if you insert it it will auto fill in for you but once again you will need to be in full control of it unless you use regex  or something like it.. I know first hand as its out there but not for u-232 maybe TT or some old ass mod the site I was on used IPB 2.3.6 I think the old TBDEv or C++ but unsure.. SO if that what your after then kk I am sure the Dev team here can make something like it if you give the mediainfo file that made for you ..
Never fall to those that just sit there.. Always look for the way to the top even if you have to code it your self and mistakes and all... quote from BonZO...

autotron

class.mediainfo.php
<?php
/*
 * purpose of this class is to retrieve media info from movie/video files
 * NO media file is provided; so you have to use of your own.
 * "mediainfo" dependancy (MEDIAINFO must be installed ...http://mediainfo.sourceforge.net - for ubuntu: sudo apt-get install mediainfo) 
 * Tested on debian/ubuntu
 * 
*/
class mediaInfo{
    var 
$filename;
    var 
$media_data;   
    var 
$arrGeneral;
    var 
$arrVideo;
    var 
$arrAudio;
    
    
/*
     * Initialize the class
     * Get the media info of the passed file
     */
    
function __construct($filename ''){
        
        
$mediainfo  trim(shell_exec('type -P mediainfo'));
        if (empty(
$mediainfo)){
            die(
'<h1>Mediainfo is not available</h1>');
        }
        
        if(
$filename != ''){
            
$this->filename trim($filename);
            if(!
file_exists($this->filename)) die('File does not exists.');
            
$this->filename escapeshellarg($this->filename);
            
$this->media_data shell_exec("mediainfo $this->filename");
        }
        
        
$this->make_info_array();
        
    }

    
/*
     * Print a PREformatted info of the media file
     */   
    
function print_media_info(){
        
        echo(
'<pre>'.$this->media_data.'</pre>');
        
    }

    
/*
     * Makes 3 arrays with general, video and audio info
     */     
    
function make_info_array(){
            
        
$arrData explode(chr(10),$this->media_data);
        
$general TRUE;
        
$audio FALSE;
        
$video FALSE;
        
$count 0;
            
        if(
is_array($arrData)){    
            foreach(
$arrData as $key=>$val){
                
$arrProperty explode(': ',$val);
                if(
array_key_exists(1$arrProperty) && TRUE === $general && $count == 0$this->arrGeneral[trim($arrProperty[0])] = trim($arrProperty[1]);
                if(
array_key_exists(1$arrProperty) && TRUE === $video && $count == 1$this->arrVideo[trim($arrProperty[0])] = trim($arrProperty[1]);
                if(
array_key_exists(1$arrProperty) && TRUE === $audio && $count == 2$this->arrAudio[trim($arrProperty[0])] = trim($arrProperty[1]);
                if(
trim($arrProperty[0]) == 'Video' && !array_key_exists(1$arrProperty)){$general FALSE$video TRUE$count++;}
                if(
trim($arrProperty[0]) == 'Audio' && !array_key_exists(1$arrProperty)){$video FALSE$audio TRUE$count++;} 
            }
        
        }
        
    }

    
/*
     * Returns an array with the general info
     */ 
    
function get_general_info(){
        return(
$this->arrGeneral);
    }
    
    
/*
     * Returns an array with the video info
     */    
    
function get_video_info(){
        return(
$this->arrVideo);
    }

    
/*
     * Returns an array with the audio info
     */    
    
function get_audio_info(){
        return(
$this->arrAudio);
    }

    
/*
     * Returns an item from the array with the general info
     */    
    
function get_general_property($property){
        if(
array_key_exists($property$this->arrGeneral)){
            return(
$this->arrGeneral[$property]);
        }else{
            return(
'Property does not exists');
        }
    }

    
/*
     * Returns an item from the array with the video info
     */     
    
function get_video_property($property){
        if(
array_key_exists($property$this->arrVideo)){
            return(
$this->arrVideo[$property]);
        }else{
            return(
'Property does not exists');
        }
    }

    
/*
     * Returns an item from the array with the audio info
     */     
    
function get_audio_property($property){
        if(
array_key_exists($property$this->arrAudio)){
            return(
$this->arrAudio[$property]);
        }else{
            return(
'Property does not exists');
        }
    }

    
/*
     * Returns the aspect ratio of a media file
     */     
    
function get_aspect_ratio(){
        return(
$this->arrVideo['Display aspect ratio']);
    }

    
/*
     * Returns the width of a media file
     */    
    
function get_width(){
        return((int)
str_replace(' '''$this->arrVideo['Width']));
    }

    
/*
     * Returns the height of a media file
     */    
    
function get_height(){
        return((int)
str_replace(' '''$this->arrVideo['Height']));
    }

    
/*
     * Returns the filesize of a media file
     */
    
function get_file_size(){
        return(
$this->arrGeneral['File size']);
    }

}
?>


Now the issue as every one here has tried to explain is simple, to collect the media info you need access to the movie file itself, NOT the torrent file so unless you are will to host these movies on the same server (very bad idea) then you are pretty much out of luck unless you add those fields wanted to your upload page for the uploader to add manually.

zokii1983

Quote from: Sawyer on May 18, 2014, 02:55:57 PM
zokii1983, what you're saying it's dumb, you have to enter manually everything. This mode has to extract those informations from MediaInfo log (if you know what MediaInfo is).
I've made something like this for me but it's not from MediaInfo, but from log from another program, a simple one, not like MediaInfo, so I can't help you here. If I decide to make it for MediaInfo i'll post here too.


lol ... you managed to extract all that info from .torrent file
respect!

if additional file is uploaded with .torrent file like .log with mediainfo.. then yes, it can be done
if theres a special client for creating this type of .torrent files (which will add mediainfo to .torrent)... in that case, again yes it's possible

but "normal" torrent file doesn't hold this info... thats all you need to understand

TheLastKinQ



this I want to MediaInfo Mod

Tundracanine

#7
You have to realize .torrent file only holds so much info just from the nature of the file and too keep it able to be used with torrent clients.
This kind of addon would mean you would have to get the info some place else and the problem is not many online sites have all that info, never mind an api to access it.
The screenshots look like another source, you should study that source to see how they get the info lol.

You could in theory extract the info from the description provided but the thing is with that not everyone uses the same format. Heck most dont lol
If wanting support help please put bare min info like
Os:
U-232 Version:
Php Version:
Tracker type: like xbt or php
Saves on asking more questions just so people can help someone.

Sawyer

zokii1983, what you're saying it's dumb, you have to enter manually everything. This mode has to extract those informations from MediaInfo log (if you know what MediaInfo is).
I've made something like this for me but it's not from MediaInfo, but from log from another program, a simple one, not like MediaInfo, so I can't help you here. If I decide to make it for MediaInfo i'll post here too.

TheLastKinQ

No

for example: this movie media info
File size                                : 8.74 GiB
Duration                                 : 2h 2mn
Overall bit rate                         : 10.2 Mbps
Format/Info                              : Advanced Video Codec
Scan type                                : Progressive
Format                                   : DTS ....

General
Complete name                            : 3.days.to.kill.2014.extended.1080p.bluray.x264-sparks.mkv
Format                                   : Matroska
Format version                           : Version 2
File size                                : 8.74 GiB
Duration                                 : 2h 2mn
Overall bit rate                         : 10.2 Mbps
Writing application                      : mkvmerge v4.1.1 ('Bouncin' Back') built on Jul  3 2010 22:54:08
Writing library                          : libebml v1.0.0 + libmatroska v1.0

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.1
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 5 frames
Codec ID                                 : V_MPEG4/ISO/AVC
Duration                                 : 2h 2mn
Bit rate                                 : 8 723 Kbps
Width                                    : 1 920 pixels
Height                                   : 808 pixels
Display aspect ratio                     : 2.40:1
Frame rate mode                          : Constant
Frame rate                               : 23.976 fps
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.235
Stream size                              : 7.28 GiB (83%)
Writing library                          : x264 core 142 r2431 ac76440
Encoding settings                        : cabac=1 / ref=5 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=0 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=250 / keyint_min=23 / scenecut=40 / intra_refresh=0 / rc_lookahead=40 / rc=2pass / mbtree=1 / bitrate=8723 / ratetol=1.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / cplxblur=20.0 / qblur=0.5 / ip_ratio=1.40 / aq=1:1.00
Language                                 : English
Default                                  : Yes
Forced                                   : No

Audio
ID                                       : 2
Format                                   : DTS
Format/Info                              : Digital Theater Systems
Mode                                     : 16
Format settings, Endianness              : Big
Codec ID                                 : A_DTS
Duration                                 : 2h 2mn
Bit rate mode                            : Constant
Bit rate                                 : 1 509 Kbps
Channel(s)                               : 6 channels
Channel positions                        : Front: L C R, Side: L R, LFE
Sampling rate                            : 48.0 KHz
Bit depth                                : 24 bits
Compression mode                         : Lossy
Stream size                              : 1.29 GiB (15%)
Language                                 : English
Default                                  : Yes
Forced                                   : No

Text
ID                                       : 3
Format                                   : UTF-8
Codec ID                                 : S_TEXT/UTF8
Codec ID/Info                            : UTF-8 Plain Text
Language                                 : English
Default                                  : No
Forced                                   : No

Menu
00:00:00.000                             : en:00:00:00.000
00:03:35.132                             : en:00:03:35.132
00:06:58.543                             : en:00:06:58.543
00:10:56.573                             : en:00:10:56.573
00:16:00.710                             : en:00:16:00.710
00:20:51.709                             : en:00:20:51.709
00:25:05.963                             : en:00:25:05.963
00:29:24.346                             : en:00:29:24.346
00:34:20.392                             : en:00:34:20.392
00:37:46.806                             : en:00:37:46.806
00:40:27.300                             : en:00:40:27.300
00:44:05.226                             : en:00:44:05.226
00:49:24.795                             : en:00:49:24.795
00:53:16.443                             : en:00:53:16.443
00:57:40.874                             : en:00:57:40.874
01:08:28.396                             : en:01:08:28.396
01:13:37.621                             : en:01:13:37.621
01:19:51.828                             : en:01:19:51.828
01:25:59.070                             : en:01:25:59.070
01:32:28.167                             : en:01:32:28.167
01:39:10.569                             : en:01:39:10.569
01:42:49.413                             : en:01:42:49.413
01:51:49.452                             : en:01:51:49.452
01:54:55.597                             : en:01:54:55.597



zokii1983

#4
Quote from: autotron on May 17, 2014, 12:22:14 AM
Quote from: zokii1983 on May 15, 2014, 09:15:51 PM
this can't be done from .torrent file
.torrent file doesn't have any of these informations

i dont think he was asking to get from torrent file.

thelastkinq, this looks like fro imdb, look herehttps://u-232-forum.duckdns.org/topic,1483.msg11485.html#msg11485

I think he was asking about "technical informations" part lol
I won't do this for you (it's unlikely that anyone will) ... but idea is following
let's say you want user to manually chose run time ...
In database, you need to add runtime_hours and runtime_minutes to torrents

in upload.php
add something along these lines
<b>Run Time</b>&nbsp;
        <select name="runtime_hours">
          <option selected="selected">-- </option>
          <option value="00">00 </option>
          <option value="01">01 </option>
          <option value="02">02 </option>
          <option value="03">03 </option>
        </select>
        H
        <select name="runtime_minutes">
          <option selected="selected">-- </option>
          <option value="00">00 </option>
          <option value="01">01 </option>
          <option value="02">02 </option>
          <option value="03">03 </option>
        </select>
        mn

in takeupload.php

you need something like
$runtimehours = $_POST['runtime_hours');
$runtimeminutes= $_POST['runtime_minutes');



in to display in torrent details, you need to add "runtime_hours, runtime_minutes" to large query
and where you want to post it
$row["runtime_hours"]
$row["runtime_minutes"]


now repeat this for all info you want to display .. and there ya go :)

or you can have users type in these values instead of choosing
in that case use something like this for upload.php
<input type=\"text\" name=\"runtime\" size=\"80\" />
to add to database you just need 1 entry in takeupload.php
$runtime = $_POST['runtime');
and to display you need to add "runtime" to large query

autotron

Quote from: zokii1983 on May 15, 2014, 09:15:51 PM
this can't be done from .torrent file
.torrent file doesn't have any of these informations

i dont think he was asking to get from torrent file.

thelastkinq, this looks like fro imdb, look herehttps://u-232-forum.duckdns.org/topic,1483.msg11485.html#msg11485