Recherche avancée

Médias (0)

Mot : - Tags -/xmlrpc

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (67)

  • Organiser par catégorie

    17 mai 2013, par

    Dans MédiaSPIP, une rubrique a 2 noms : catégorie et rubrique.
    Les différents documents stockés dans MédiaSPIP peuvent être rangés dans différentes catégories. On peut créer une catégorie en cliquant sur "publier une catégorie" dans le menu publier en haut à droite ( après authentification ). Une catégorie peut être rangée dans une autre catégorie aussi ce qui fait qu’on peut construire une arborescence de catégories.
    Lors de la publication prochaine d’un document, la nouvelle catégorie créée sera proposée (...)

  • Récupération d’informations sur le site maître à l’installation d’une instance

    26 novembre 2010, par

    Utilité
    Sur le site principal, une instance de mutualisation est définie par plusieurs choses : Les données dans la table spip_mutus ; Son logo ; Son auteur principal (id_admin dans la table spip_mutus correspondant à un id_auteur de la table spip_auteurs)qui sera le seul à pouvoir créer définitivement l’instance de mutualisation ;
    Il peut donc être tout à fait judicieux de vouloir récupérer certaines de ces informations afin de compléter l’installation d’une instance pour, par exemple : récupérer le (...)

  • Le plugin : Podcasts.

    14 juillet 2010, par

    Le problème du podcasting est à nouveau un problème révélateur de la normalisation des transports de données sur Internet.
    Deux formats intéressants existent : Celui développé par Apple, très axé sur l’utilisation d’iTunes dont la SPEC est ici ; Le format "Media RSS Module" qui est plus "libre" notamment soutenu par Yahoo et le logiciel Miro ;
    Types de fichiers supportés dans les flux
    Le format d’Apple n’autorise que les formats suivants dans ses flux : .mp3 audio/mpeg .m4a audio/x-m4a .mp4 (...)

Sur d’autres sites (2984)

  • What is Behavioural Segmentation and Why is it Important ?

    28 septembre 2023, par Erin — Analytics Tips

    Amidst the dynamic landscape of web analytics, understanding customers has grown increasingly vital for businesses to thrive. While traditional demographic-focused strategies possess merit, they need to uncover the nuanced intricacies of individual online behaviours and preferences. As customer expectations evolve in the digital realm, enterprises must recalibrate their approaches to remain relevant and cultivate enduring digital relationships.

    In this context, the surge of technology and advanced data analysis ushers in a marketing revolution : behavioural segmentation. Businesses can unearth invaluable insights by meticulously scrutinising user actions, preferences and online interactions. These insights lay the foundation for precisely honed, high-performing, personalised campaigns. The era dominated by blanket, catch-all marketing strategies is yielding to an era of surgical precision and tailored engagement. 

    While the insights from user behaviours empower businesses to optimise customer experiences, it’s essential to strike a delicate balance between personalisation and respecting user privacy. Ethical use of behavioural data ensures that the power of segmentation is wielded responsibly and in compliance, safeguarding user trust while enabling businesses to thrive in the digital age.

    What is behavioural segmentation ?

    Behavioural segmentation is a crucial concept in web analytics and marketing. It involves categorising individuals or groups of users based on their online behaviour, actions and interactions with a website. This segmentation method focuses on understanding how users engage with a website, their preferences and their responses to various stimuli. Behavioural segmentation classifies users into distinct segments based on their online activities, such as the pages they visit, the products they view, the actions they take and the time they spend on a site.

    Behavioural segmentation plays a pivotal role in web analytics for several reasons :

    1. Enhanced personalisation :

    Understanding user behaviour enables businesses to personalise online experiences. This aids with delivering tailored content and recommendations to boost conversion, customer loyalty and customer satisfaction.

    2. Improved user experience :

    Behavioural segmentation optimises user interfaces (UI) and navigation by identifying user paths and pain points, enhancing the level of engagement and retention.

    3. Targeted marketing :

    Behavioural segmentation enhances marketing efficiency by tailoring campaigns to user behaviour. This increases the likelihood of interest in specific products or services.

    4. Conversion rate optimisation :

    Analysing behavioural data reveals factors influencing user decisions, enabling website optimisation for a streamlined purchasing process and higher conversion rates.

    5. Data-driven decision-making :

    Behavioural segmentation empowers data-driven decisions. It identifies trends, behavioural patterns and emerging opportunities, facilitating adaptation to changing user preferences and market dynamics.

    6. Ethical considerations :

    Behavioural segmentation provides valuable insights but raises ethical concerns. User data collection and use must prioritise transparency, privacy and responsible handling to protect individuals’ rights.

    The significance of ethical behavioural segmentation will be explored more deeply in a later section, where we will delve into the ethical considerations and best practices for collecting, storing and utilising behavioural data in web analytics. It’s essential to strike a balance between harnessing the power of behavioural segmentation for business benefits and safeguarding user privacy and data rights in the digital age.

    A woman surrounded by doors shaped like heads of different

    Different types of behavioural segments with examples

    1. Visit-based segments : These segments hinge on users’ visit patterns. Analyse visit patterns, compare first-time visitors to returning ones, or compare users landing on specific pages to those landing on others.
      • Example : The real estate website Zillow can analyse how first-time visitors and returning users behave differently. By understanding these patterns, Zillow can customise its website for each group. For example, they can highlight featured listings and provide navigation tips for first-time visitors while offering personalised recommendations and saved search options for returning users. This could enhance user satisfaction and boost the chances of conversion.
    2. Interaction-based segments : Segments can be created based on user interactions like special events or goals completed on the site.
      • Example : Airbnb might use this to understand if users who successfully book accommodations exhibit different behaviours than those who don’t. This insight could guide refinements in the booking process for improved conversion rates.
    3. Campaign-based segments : Beyond tracking visit numbers, delve into usage differences of visitors from specific sources or ad campaigns for deeper insights.
      • Example : Nike might analyse user purchase behaviour from various traffic sources (referral websites, organic, direct, social media and ads). This informs marketing segmentation adjustments, focusing on high-performance channels. It also customises the website experience for different traffic sources, optimising content, promotions and navigation. This data-driven approach could boost user experiences and maximise marketing impact for improved brand engagement and sales conversions.
    4. Ecommerce segments : Separate users based on purchases, even examining the frequency of visits linked to specific products. Segment heavy users versus light users. This helps uncover diverse customer types and browsing behaviours.
      • Example : Amazon could create segments to differentiate between visitors who made purchases and those who didn’t. This segmentation could reveal distinct usage patterns and preferences, aiding Amazon in tailoring its recommendations and product offerings.
    5. Demographic segments : Build segments based on browser language or geographic location, for instance, to comprehend how user attributes influence site interactions.
      • Example : Netflix can create user segments based on demographic factors like geographic location to gain insight into how a visitor’s location can influence content preferences and viewing behaviour. This approach could allow for a more personalised experience.
    6. Technographic segments : Segment users by devices or browsers, revealing variations in site experience and potential platform-specific issues or user attitudes.
      • Example : Google could create segments based on users’ devices (e.g., mobile, desktop) to identify potential issues in rendering its search results. This information could be used to guide Google in providing consistent experiences regardless of device.
    A group of consumers split into different segments based on their behaviour

    The importance of ethical behavioural segmentation

    Respecting user privacy and data protection is crucial. Matomo offers features that align with ethical segmentation practices. These include :

    • Anonymization : Matomo allows for data anonymization, safeguarding individual identities while providing valuable insights.
    • GDPR compliance : Matomo is GDPR compliant, ensuring that user data is handled following European data protection regulations.
    • Data retention and deletion : Matomo enables businesses to set data retention policies and delete user data when it’s no longer needed, reducing the risk of data misuse.
    • Secured data handling : Matomo employs robust security measures to protect user data, reducing the risk of data breaches.

    Real-world examples of ethical behavioural segmentation :

    1. Content publishing : A leading news website could utilise data anonymization tools to ethically monitor user engagement. This approach allows them to optimise content delivery based on reader preferences while ensuring the anonymity and privacy of their target audience.
    2. Non-profit organisations : A charity organisation could embrace granular user control features. This could be used to empower its donors to manage their data preferences, building trust and loyalty among supporters by giving them control over their personal information.
    Person in a suit holding a red funnel that has data flowing through it into a file

    Examples of effective behavioural segmentation

    Companies are constantly using behavioural insights to engage their audiences effectively. In this section, we’ll delve into real-world examples showcasing how top companies use behavioural segmentation to enhance their marketing efforts.

    A woman standing in front of a pie chart pointing to the top right-hand section of customers in that segment
    1. Coca-Cola’s behavioural insights for marketing strategy : Coca-Cola employs behavioural segmentation to evaluate its advertising campaigns. Through analysing user engagement across TV commercials, social media promotions and influencer partnerships, Coca-Cola’s marketing team can discover that video ads shared by influencers generate the highest ROI and web traffic.

      This insight guides the reallocation of resources, leading to increased sales and a more effective advertising strategy.

    2. eBay’s custom conversion approach : eBay excels in conversion optimisation through behavioural segmentation. When users abandon carts, eBay’s dynamic system sends personalised email reminders featuring abandoned items and related recommendations tailored to user interests and past purchase decisions.

      This strategy revives sales, elevates conversion rates and sparks engagement. eBay’s adeptness in leveraging behavioural insights transforms user experience, steering a customer journey toward conversion.

    3. Sephora’s data-driven conversion enhancement : Data analysts can use Sephora’s behavioural segmentation strategy to fuel revenue growth through meticulous data analysis. By identifying a dedicated subset of loyal customers who exhibit a consistent preference for premium skincare products, data analysts enable Sephora to customise loyalty programs.

      These personalised rewards programs provide exclusive discounts and early access to luxury skincare releases, resulting in heightened customer engagement and loyalty. The data-driven precision of this approach directly contributes to amplified revenue from this specific customer segment.

    Examples of the do’s and don’ts of behavioural segmentation 

    Happy woman surrounded by icons of things and activities she enjoys

    Behavioural segmentation is a powerful marketing and data analysis tool, but its success hinges on ethical and responsible practices. In this section, we will explore real-world examples of the do’s and don’ts of behavioural segmentation, highlighting companies that have excelled in their approach and those that have faced challenges due to lapses in ethical considerations.

    Do’s of behavioural segmentation :

    • Personalised messaging :
      • Example : Spotify
        • Spotify’s success lies in its ability to use behavioural data to curate personalised playlists and user recommendations, enhancing its music streaming experience.
    • Transparency :
      • Example : Basecamp
        • Basecamp’s transparency in sharing how user data is used fosters trust. They openly communicate data practices, ensuring users are informed and comfortable.
    • Anonymization
      • Example : Matomo’s anonymization features
        • Matomo employs anonymization features to protect user identities while providing valuable insights, setting a standard for responsible data handling.
    • Purpose limitation :
      • Example : Proton Mail
        • Proton Mail strictly limits the use of user data to email-related purposes, showcasing the importance of purpose-driven data practices.
    • Dynamic content delivery : 
      • Example : LinkedIn
        • LinkedIn uses behavioural segmentation to dynamically deliver job recommendations, showcasing the potential for relevant content delivery.
    • Data security :
      • Example : Apple
        • Apple’s stringent data security measures protect user information, setting a high bar for safeguarding sensitive data.
    • Adherence to regulatory compliance : 
      • Example : Matomo’s regulatory compliance features
        • Matomo’s regulatory compliance features ensure that businesses using the platform adhere to data protection regulations, further promoting responsible data usage.

    Don’ts of behavioural segmentation :

    • Ignoring changing regulations
      • Example : Equifax
        • Equifax faced major repercussions for neglecting evolving regulations, resulting in a data breach that exposed the sensitive information of millions.
    • Sensitive attributes
      • Example : Twitter
        • Twitter faced criticism for allowing advertisers to target users based on sensitive attributes, sparking concerns about user privacy and data ethics.
    • Data sharing without consent
      • Example : Meta & Cambridge Analytica
        • The Cambridge Analytica scandal involving Meta (formerly Facebook) revealed the consequences of sharing user data without clear consent, leading to a breach of trust.
    • Lack of control
      • Example : Uber
        • Uber faced backlash for its poor data security practices and a lack of control over user data, resulting in a data breach and compromised user information.
    • Don’t be creepy with invasive personalisation
      • Example : Offer Moment
        • Offer Moment’s overly invasive personalisation tactics crossed ethical boundaries, unsettling users and eroding trust.

    These examples are valuable lessons, emphasising the importance of ethical and responsible behavioural segmentation practices to maintain user trust and regulatory compliance in an increasingly data-driven world.

    Continue the conversation

    Diving into customer behaviours, preferences and interactions empowers businesses to forge meaningful connections with their target audience through targeted marketing segmentation strategies. This approach drives growth and fosters exceptional customer experiences, as evident from the various common examples spanning diverse industries.

    In the realm of ethical behavioural segmentation and regulatory compliance, Matomo is a trusted partner. Committed to safeguarding user privacy and data integrity, our advanced web analytics solution empowers your business to harness the power of behavioral segmentation, all while upholding the highest standards of compliance with stringent privacy regulations.

    To gain deeper insight into your visitors and execute impactful marketing campaigns, explore how Matomo can elevate your efforts. Try Matomo free for 21-days, no credit card required. 

  • Issues with processing media on windows Azure

    23 septembre 2015, par Ahmed Mujtaba

    I have a website built on ASP.NET web forms that works as a media portal for users to upload videos. I’m using ffmpeg encoders to produce video contents to be streamed in the browser. I’m using the web deploy method to publish the site on the Azure server. The website get’s deployed properly however I get following issues in the live site.

    1. Video never get’s encoded and published. I get some sort of error.

    2. Video get’s published but the process of uploading and encoding the video is way too slow on the web server.

    My project solution contains upload.ashx that handles the upload requests and makes the call to encode.ashx which is responsible for the encoding and publishing of the videos. I tried to remotely debug the site but the debugger never get’s to encode.ashx.

    I was wondering if these issues can be resolved by having the website deployed with a VM ?

    Script that uploads the video file :

    var filesuploaded = 0;
       var faileduploaded = 0;

       $(function () {
           var uploader = new plupload.Uploader({
               runtimes: 'gears,html5,flash,silverlight,browserplus',
               browse_button: '<%= pickfiles.ClientID %>',
               container: 'container',
               max_file_size: '<%= MaxMediaSize %>mb',
               url: '<%=Config.GetUrl() %>videos/upload/upload.ashx',
               flash_swf_url: '<%=Config.GetUrl() %>plupload/js/plupload.flash.swf',
               silverlight_xap_url: '<%=Config.GetUrl() %>plupload/js/plupload.silverlight.xap',
               chunk_size: '4mb',
               <%= UniqueNames %>
               filters: [
               { title: '<%= AllowedFormatsDisplay %>', extensions: '<%= AllowedFormats %>'}],
               headers: { UName: '<%=UserName %>', MTP: '<%= MediaType %>' }
           });
           //uploader.bind('Init', function (up, params) {
           //    $('#filelist').html("<div>Current runtime: " + params.runtime + "</div>");
           //});

           uploader.init();

           $('#uploadfiles').click(function (e) {
               uploader.start();
               e.preventDefault();
               $("#uploadfiles").hide();
               $("#&lt;%= embd.ClientID %>").hide();
           });

           uploader.bind('FilesAdded', function (up, files) {
               $("#uploadfiles").show();
               $("#&lt;%= msg.ClientID %>").html("");
               var count=0;
               $.each(files, function (i, file) {
                   $('#filelist').append(
                       '<div class="item_pad_4 bx_br_bt">' + (count + 1) + ': ' + file.name + ' (' + plupload.formatSize(file.size) + ')  <b></b></div>' );
                   count++;
               });
               var maxupload = &lt;%= MaxVideoUploads %>;
               if(count > maxupload)
               {              
                   $.each(files, function(i, file) {
                       uploader.removeFile(file);
                   });

                   $('#filelist').html("");
                   $("#uploadfiles").hide();
                   Display_Message("#&lt;%= msg.ClientID %>", "Can't upload more than " + maxupload + " records at once!", 1, 1);
                   return false;
               }
               else {
                   $("#tfiles").html(count);
                   $("#uploadfiles").removeClass("disabled");
                   $("#&lt;%= pickfiles.ClientID %>").hide();
               }
               up.refresh(); // Reposition Flash/Silverlight
           });

           uploader.bind('UploadProgress', function (up, file) {
               $('#' + file.id + " b").html(file.percent + "%");
           });

           uploader.bind('Error', function (up, err) {
               $('#filelist').append("<div>Error: " + err.code +
                   ", Message: " + err.message +
                   (err.file ? ", File: " + err.file.name : "") +
                   "</div>"
               );
               up.refresh(); // Reposition Flash/Silverlight
           });

           var failedstatus = 0;
           uploader.bind('FileUploaded', function (up, file, info) {
               // encode started
               if (info.response != "failed" &amp;&amp; info.response != "") {
                   EncodeVD(file.id, info.response, file.size);
                   Display_Message('#' + file.id, "Please wait for final processing", 0, 1);
                   if (failedstatus == 0)
                       Redirect(info.response);
                   filesuploaded++;
               }
               else {
                   Display_Message('#' + file.id, "Response is: " + info.response, 0, 1);
               }
           });
       });
       var redcnt = 0;
       function Redirect(filename) {
           var IntervalID = setInterval(function () {
               redcnt++;
               if (redcnt > 2) {
                   clearInterval(IntervalID);
                   var tfiles = $("#tfiles").html();
                   if(tfiles == faileduploaded) { // break further processing all videos failed to upload
                   }
                   else if (filesuploaded >= tfiles) {
                       document.location = "&lt;%=ConfirmPageUrl %>?fn=" + filename + "&amp;gid=&lt;%=GalleryID %>&amp;uvids=" + $("#tfiles").html() + "&amp;mpid=" + $("#maxpid").html().trim() + "&lt;%=GroupParam %>";
                   }
           }
           }, 2000);
    }
    function EncodeVD(mid, mfile, msize) {
       var params = '&lt;%= EncodingParams %>&amp;fn=' + mfile;
           $.ajax({
               type: 'GET',
               url: '&lt;%= Encoding_Handler_Path %>',
               data: params,
               async: true,
               success: function (msg) {
                   if (msg == "Success" || msg == "") {
                       $('#' + mid).html('<strong>Uploading Completed Successfully - Wait for Processing.');
                   }
                   else {
                       failedstatus = 1;
                       faileduploaded++;
                       Display_Message('#' + mid, "Response is: " + msg, 0, 1);
                   }
               }
           });
       }
    </strong>

    Server side code for processing the file upload :

    private int MediaType = 0; // 0 : video, 1: audio

       public void ProcessRequest (HttpContext context) {
           try
           {
               context.Response.ContentType = "text/plain";
               context.Response.Write(ProcessMedia(context));
           }
           catch (Exception ex)
           {
               context.Response.Write("error|" + ex.Message);
           }
       }

       public string ProcessMedia(HttpContext context)
       {
           if (context.Request.Files.Count > 0)
           {
               int chunk = context.Request["chunk"] != null ? int.Parse(context.Request["chunk"]) : 0;
               string fileName = context.Request["name"] != null ? context.Request["name"] : string.Empty;
               //string _fileName = fileName.Remove(fileName.LastIndexOf(".")) + "-" + Guid.NewGuid().ToString().Substring(0, 6) + "" + fileName.Remove(0, fileName.LastIndexOf("."));
               HttpPostedFile fileUpload = context.Request.Files[0];

               string upath = "";
               if (context.Request.Headers["UName"] != null)
                   upath = context.Request.Headers["UName"].ToString();

               //if (CloudSettings.EnableCloudStorage &amp;&amp; upath != "")
               //    _fileName = upath.Substring(0, 3) + "-" + _fileName; // avoid duplication in cloud storage

               if (context.Request.Headers["MTP"] != null)
                   MediaType = Convert.ToInt32(context.Request.Headers["MTP"]);

               //string extensions = "";
               //if (MediaType == 0)
               //    extensions = Site_Settings.Video_Allowed_Formats;
               //else
               //    extensions = Site_Settings.Audio_Allowed_Formats;

               //bool sts = UtilityBLL.Check_File_Extension(extensions, fileName.ToLower());
               //if (sts == false)
               //{
               //    return "Invalid format, please upload proper video!"; // Invalid video format, please upload proper video
               //}

               int allowable_size_mb = 0;
               if (MediaType == 0)
               {
                   allowable_size_mb = Site_Settings.Video_Max_Size;
               }
               else
               {
                   allowable_size_mb = Site_Settings.Audio_Max_Size;
               }
               int UploadSize = allowable_size_mb * 1000000;
               if (fileUpload.ContentLength > UploadSize)
               {
                   return "Video Limit Exceeds";
               }

               string uploadPath = "";
               // check whether audio / mp3 encoding enabled
               if (this.MediaType == 1)
               {
                   // audio encoding
                   if (fileName.EndsWith(".mp3"))
                   {
                       // upload mp3 directly in mp3 path instead of default path
                       if (upath == "")
                           uploadPath = UrlConfig.MP3_Path(); // source video path
                       else
                           uploadPath = UrlConfig.MP3_Path(upath); // source video path
                   }
                   else
                   {
                       // default path
                       if (upath == "")
                           uploadPath = UrlConfig.Source_Video_Path(); // source video path
                       else
                           uploadPath = UrlConfig.Source_Video_Path(upath); // source video path
                   }
               }
               else
               {//azure
                   // default path
                   if (upath == "")
                       uploadPath = UrlConfig.Source_Video_Path(); // source video path
                   else
                       uploadPath = UrlConfig.Source_Video_Path(upath); // source video path
               }

               FileStream fs;
               using (fs = new FileStream(Path.Combine(uploadPath, fileName), chunk == 0 ? FileMode.Create : FileMode.Append))
               {
                   byte[] buffer = new byte[fileUpload.InputStream.Length];
                   fileUpload.InputStream.Read(buffer, 0, buffer.Length);

                   fs.Write(buffer, 0, buffer.Length);
               }
               return fileName; // "Success";
           }
           else
           {
               return "failed";
           }

           return "";
       }
       public bool IsReusable {
           get {
               return false;
           }
       }

    code in encode.aspx responsible for encoding the video :

    private string EncodeMedia(HttpContext context)
    {
       string sourcepath = "";
       string publishedpath = "";
       string mp3path = "";
       string thumbpath = "";
       if (this.UserName != "")
       {//azure
           sourcepath = UrlConfig.Source_Video_Path(this.UserName);
           publishedpath = UrlConfig.Published_Video_Path(this.UserName);
           mp3path = UrlConfig.MP3_Path(this.UserName);
           thumbpath = UrlConfig.Thumbs_Path(this.UserName);
       }
       else
       {
           sourcepath = UrlConfig.Source_Video_Path();
           publishedpath = UrlConfig.Published_Video_Path();
           mp3path = UrlConfig.MP3_Path();
           thumbpath = UrlConfig.Thumbs_Path();
       }
       if (this.FileName.EndsWith(".mp3") &amp;&amp; this.MediaType == 1)
       {
           // mp3 and audio format
           if (!File.Exists(mp3path + "/" + this.FileName))
           {
               return "Audio file not found!";
           }
       }
       else
       {
           // rest normal video and audio encoding
           if (!File.Exists(sourcepath + "/" + this.FileName))
           {
               return "Source file not found!";
           }
       }

       if (CloudSettings.EnableCloudStorage &amp;&amp; this.UserName != "")
           this.FileName = this.UserName.Substring(0, 3) + "-" + this.FileName; // avoid duplication in cloud storage


       //double f_contentlength = 0;
       //if (Site_Settings.Feature_Packages == 1)
       //{
       //    if (Config.GetMembershipAccountUpgradeType() != 1)
       //    {
       //        // Check whether user have enough space to upload content
       //        // Restriction only for normal or premium users
       //        f_contentlength = (double)fileUpload.ContentLength / 1000000;
       //        string media_field_name = "space_video";
       //        if (MediaType == 1)
       //            media_field_name = "space_audio";
       //        if (!User_PackagesBLL.Check_User_Space_Status(upath, media_field_name, f_contentlength) &amp;&amp; !isAdmin)
       //        {
       //            // insufficient credits to upload content
       //            return "Insufficient credits to upload media file"; //   Response.Redirect(Config.GetUrl("myaccount/packages.aspx?status=" + media_field_name), true);
       //        }
       //    }
       //}

       this.backgroundpublishing = true; // should be true on direct encoding
       // Video Processing
       string flv_filename = "";
       string original_filename = "";
       string thumb_filename = "";
       string duration = "";
       int duration_sec = 0;

       // set video actions : 1 -> on, 0 -> off
       int isenabled = 1;
       int ispublished = 1;
       int isreviewed = 1;
       int isresponse = 0;
       if (Response_VideoID > 0)
           isresponse = 1;

       string flv_url = "none";
       string thumb_url = "none";
       string org_url = "none";
       string _embed = "";

       string errorcode = "0";
       VideoInfo info = null;

       if (Site_Settings.Content_Approval == 0)
           isreviewed = 0;


       // check whether audio / mp3 encoding enabled
       if (this.FileName.EndsWith(".mp3") &amp;&amp; this.MediaType==1)
       {
           // audio encoding
           // mp3 file already
           // so no encoding happens
           MediaHandler _minfo = new MediaHandler();
           _minfo.FFMPEGPath = Encoding_Settings.FFMPEGPATH;
           _minfo.FileName = FileName;
           _minfo.InputPath = mp3path;
           info = _minfo.Get_Info();

           flv_filename = FileName;
           original_filename = FileName;
           duration = info.Duration;
           duration_sec = info.Duration_Sec;
           isenabled = 1; // enabled
       }
       else if (this.directpublishing)
       {            

           // publish video
           ArrayList itags = new ArrayList();
           MHPEncoder encoder = new MHPEncoder();
           //if (this.FileName.EndsWith(".mpeg") || this.FileName.EndsWith(".mpg")) // use mpg compatible ffmpeg encoder
           //    encoder.FfmpegPath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + "\\ffmpeg\\ffmpegbk\\ffmpeg.exe";
               //encoder.ThumbFfmpegPath = Encoding_Settings.FFMPEGPATH; // use normal ffmpeg encoder for thumbs processing

           //azure
           encoder.FfmpegPath = Encoding_Settings.FFMPEGPATH; // use normal ffmpeg encoder
           encoder.FlvToolPath = Encoding_Settings.FLVTOOLPATH; // set meta information for flv videos
           encoder.Mp4BoxPath = Encoding_Settings.MP4BoxPath; // set meta information for mp4 videos
           encoder.SourcePath = sourcepath;
           encoder.SourceFileName = this.FileName;

           // No cloud storage on direct encoding
           //if (CloudSettings.EnableCloudStorage)
           //    encoder.EnableCloudStorage = true;


           if (MediaType == 1)
           {
               // audio encoding
               itags.Add("14");
               encoder.iTags = itags;
               encoder.GrabThumbs = false;
               encoder.PublishedPath = mp3path;

               //_vprocess.OutputPath = this.MP3Path;
               //_vprocess.isAudio = true;
           }
           else
           {
               // video encoding
               itags.Add(EncoderSettings.DefaultITagValue.ToString()); // 5 for 360p mp4 encoding    
               //itags.Add(7);   // this will call 7 case settings to publish next video ending with _7.mp4 instead of _5.mp4
               // so there will be 2 videos with different resoultions published at the end of the process?
               // yesmake sure use proper settings first test it directly via command.    
               //okay i got it. But i'm gonna have to use a different media players to incroporate those settings
               // once published you can load different videos for different user by checking _7.mp4 (end) va
              //okay got it.

               //azure
               encoder.PublishedPath = publishedpath;
               encoder.iTags = itags;
               encoder.ThumbsDirectory = thumbpath;
               encoder.TotalThumbs = 15;

               //_vprocess.ThumbPath = this.ThumbPath;
               //_vprocess.OutputPath = this.FLVPath;
               //if (Config.isPostWaterMark())
               //{
               //    // script for posting watermark on video
               //    _vprocess.WaterMarkPath = Server.MapPath(Request.ApplicationPath) + "\\contents\\watermark";
               //    _vprocess.WaterMarkImage = "watermark.gif";

               //}
           }
           int deleteoption = Site_Settings.Video_Delete_Original;
           if (deleteoption == 1)
           {
               encoder.DeleteSource = true;
           }
           // background processing
           if (this.backgroundpublishing &amp;&amp; this.MediaType==0)
           {
               encoder.BackgroundProcessing = true;
               // get information from source video in order to store it in database
               MediaHandler _minfo = new MediaHandler();
               //if (this.FileName.EndsWith(".mpeg") || this.FileName.EndsWith(".mpg")) // use mpg compatible ffmpeg encoder
               //    encoder.FfmpegPath = HttpContext.Current.Server.MapPath(HttpContext.Current.Request.ApplicationPath) + "\\ffmpeg\\ffmpegbk\\ffmpeg.exe";
               //else
                   _minfo.FFMPEGPath = Encoding_Settings.FFMPEGPATH;

               _minfo.FileName = FileName;
               _minfo.InputPath = sourcepath;
               info = _minfo.Get_Info();
           }
           // encode video processing
           Video_Information vinfo = encoder.Process();
           if (vinfo.ErrorCode > 0)
           {
               errorcode = vinfo.ErrorCode.ToString();
               ErrorLgBLL.Add_Log("Encoding Failed Log", "", "encoding error: " + vinfo.ErrorCode.ToString() + "<br />Description: " + vinfo.ErrorDescription.ToString());
                //return vinfo.ErrorDescription;
           }
           // Double check validation
           // if published video exist
           // if thumb exist
           // then proceed further

           if (MediaType == 0)
           {
               if (!File.Exists(encoder.PublishedPath + "/" + vinfo.FLVVideoName))
               {
                   return "Video failed to published properly.";
               }
               if (!File.Exists(encoder.ThumbsDirectory + "/" + vinfo.ThumbFileName))
               {
                   return "Thumbs failed to grab from video properly.";
               }
           }
           else
           {
               if (vinfo.FLVVideoName == "")
               {
                   vinfo.FLVVideoName = this.FileName.Remove(this.FileName.LastIndexOf(".")) + "_14.mp3"; // mp3 file path name
               }
               if (!File.Exists(encoder.PublishedPath + "/" + vinfo.FLVVideoName))
               {
                   return "Audio failed to published properly.";
               }
           }
           // Now thumbs and video published, procceed for data processing
           // get information from vinfo object
           if (this.backgroundpublishing &amp;&amp; this.MediaType == 0)
           {
               string OutputFileName = this.FileName.Remove(this.FileName.LastIndexOf("."));
               flv_filename = OutputFileName + "_" + EncoderSettings.DefaultITagValue + "." + EncoderSettings.Return_Output_Extension(EncoderSettings.DefaultITagValue);
               original_filename = vinfo.OriginalVideoName;
               thumb_filename = OutputFileName + "_008.jpg"; // info.ThumbFileName;
               duration = info.Duration;
               duration_sec = info.Duration_Sec;
           }
           else
           {
               flv_filename = vinfo.FLVVideoName;
               original_filename = vinfo.OriginalVideoName;
               thumb_filename = vinfo.ThumbFileName;
               duration = vinfo.Duration;
               duration_sec = vinfo.Duration_Sec;
               isenabled = vinfo.isEnabled;
           }

           // No cloud storage on direct encoding.
           // Note cloude storage only works if background processing is disabled
           // Or works in cased of sheduled processing
           if (CloudSettings.EnableCloudStorage &amp;&amp; errorcode == "0")
           {
               flv_url = "amazon";
               org_url = "https://s3.amazonaws.com/" + CloudSettings.OriginalVideoBucketName + "/" + this.FileName;
               thumb_url = "https://s3.amazonaws.com/" + CloudSettings.ThumbsBucketName + "/" + thumb_filename;

           }

       }
       else
       {
           // set publishing status off.
           ispublished = 0;
           original_filename = this.FileName;
       }

       // Store video information in database
       string ipaddress = context.Request.ServerVariables["REMOTE_ADDR"].ToString();

       // Store media information in database
       Video_Struct vd = new Video_Struct();
       vd.CategoryID = 0; // store categoryname or term instead of category id
       vd.Categories = Categories;
       vd.UserName = UserName;
       vd.Title = "";
       vd.Description = "";
       vd.Tags = Tags;
       vd.Duration = duration;
       vd.Duration_Sec = duration_sec;
       vd.OriginalVideoFileName = original_filename;
       vd.VideoFileName = flv_filename;
       vd.ThumbFileName = thumb_filename;
       vd.isPrivate = Privacy;
       vd.AuthKey = PAuth;
       vd.isEnabled = isenabled;
       vd.Response_VideoID = Response_VideoID; // video responses
       vd.isResponse = isresponse;
       vd.isPublished = ispublished;
       vd.isReviewed = isreviewed;
       vd.FLV_Url = flv_url;
       vd.Thumb_Url = thumb_url;
       vd.Org_Url = org_url;
       vd.Embed_Script = _embed;
       vd.isExternal = 0; // website own video, 1: embed video
       vd.IPAddress = ipaddress;
       vd.Type = MediaType;
       vd.YoutubeID = "";
       vd.isTagsreViewed = 1;
       vd.Mode = 0; // filter videos based on website sections
       //vd.ContentLength = f_contentlength;
       vd.GalleryID = GID;
       vd.ErrorCode = Convert.ToInt32(errorcode);
       long videoid = VideoBLL.Process_Info(vd, false);

       // Process tags
       if (Tags != "")
       {
           int tag_type = 0; // represent videos
           if (MediaType == 1)
               tag_type = 4; // represent audio file
           TagsBLL.Process_Tags(Tags, tag_type, 0);
       }

       if (Response_VideoID > 0)
       {
           VideoBLL.Update_Responses(Response_VideoID);
       }

       return "Success";
    }
  • Revision 34625 : un lien dans un lien, ca cree des liens

    21 janvier 2010, par cedric@… — Log

    un lien dans un lien, ca cree des liens