Recherche avancée

Médias (0)

Mot : - Tags -/content

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

Autres articles (82)

  • Le profil des utilisateurs

    12 avril 2011, par

    Chaque utilisateur dispose d’une page de profil lui permettant de modifier ses informations personnelle. Dans le menu de haut de page par défaut, un élément de menu est automatiquement créé à l’initialisation de MediaSPIP, visible uniquement si le visiteur est identifié sur le site.
    L’utilisateur a accès à la modification de profil depuis sa page auteur, un lien dans la navigation "Modifier votre profil" est (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

Sur d’autres sites (7901)

  • Moviepy audio is merging together in script. How do I fix it ?

    9 novembre 2023, par Corey4005

    I have a dataframe containing speech recordings and videofiles I want to merge. For example, here is what the dataframe looks like :

    


    speech_paths,vid_paths,start,stop,short_option, 
Recording.m4a,hr.mp4,00:11:11.520,00:11:22.800,N,
Recording2.m4a,hr.mp4,00:04:38.800,00:04:54.840,N, 
Recording3.m4a,hr.mp4,00:05:12.520,00:05:35.600,N, 
Recording4.m4a,hr.mp4,00:10:36.440,00:11:11.520,N,  


    


    My goal is to loop through this csv and combine each recording with the video. The start and stop stamps represent when I would like the audio from the video file to start. However, my recording in "speech paths" should be added to the beginning of each video before the audio from the video starts. I am essentially trying to create an audiofile that combines my voice with the audio file in the video at the beginning of each video. The video clip will also be extended at the beginning and will contain no audio, but will have video still playing. My voice will just be the start.

    


    Here is the code that does this :

    


    #get the directory containing the .csv
  df = pd.read_csv('./csv-data/clip-config.csv')
  speech = df['speech_paths']
  startstamps = df['start']
  endstamps = df['stop']
  videos = df['vid_paths']

  #create standard recording path
  record_path = 'C:/Users/Corey4005/Documents/Sound recordings'

  #current directory 
  cwd = os.getcwd()

  #video locations 
  videos_path = os.path.join(cwd, 'inputvideos')
  outputvideos_path = os.path.join(cwd, 'outputvideos')
  srt_path = os.path.join(cwd, 'srtfile')

  #a list to concatinate all of the clips into one video if df > 0
  clips_list = []

  count = 0
  #get name of filepath 
  for i in range(len(df)):
    count +=1

    #adding the name of the speech file to the variable
    speech_file = speech[i]

    #selecting the start and end stamps to download from yt
    start_stamp = startstamps[i]
    end_stamp = endstamps[i]

    #selecting the video file
    video_file = videos[i]

    #getting the video file 
    path_to_video = os.path.join(videos_path, video_file)
    path_to_mp3 = os.path.join(record_path, speech_file)

    print("----------- Progress: {} / {} videos processed -----------".format(count, len(df)))
    print("----------- Combining the Following Files: ")
    print("----------- Speech: {}".format(path_to_mp3))
    print("----------- Video: {}".format(path_to_video))

    #need the audio length to get the appropriate start time for the new clip
    audio_length = get_audio_length(path_to_mp3)

    print('----------- Writing mono speech file')
    #create an audio clip of the new audio that is now .mp3 and convert from stero to mono
    mp.AudioFileClip(path_to_mp3).write_audiofile('mono.mp3', ffmpeg_params=["-ac", "1"])
    

    #create the overall big clip that is the size of the audio + the video in question
    big_clip = clip_video(path_to_video, start_stamp, end_stamp, audio_length)

    #create the first clip the size of the speech file, or from 0 -> end of audio_length
    first_clip = big_clip.subclip(0, audio_length)

    #set first clip audio as speech file
    audioclip = mp.AudioFileClip("mono.mp3")
    first_clip.audio=audioclip
  
    #create a second clip the size of the rest of the file or from audio_length -> end
    second_clip = big_clip.subclip(audio_length)

    # Concatenate the two subclips
    final_clip = mp.concatenate_videoclips([first_clip, second_clip])

    if len(df)>1:
      
      #for youtube
      clips_list.append(final_clip)
      
    else:
      ytoutpath = os.path.join(outputvideos_path, 'youtube.mp4')

      print('----------- Writing combined speech and videofile')
      #youtube
      final_clip.write_videofile(ytoutpath)
      #yt filepath 

      ytfilepath = os.path.abspath(ytoutpath)


      #create subtitles filepath
      print("----------- generating srt file")
      transcribefile = video_to_srt(ytfilepath, srt_path)

      #create videos that are subtitles 
      print("----------- subtitiling youtube video")
      subtitledyt = create_subtitles(ytfilepath, transcribefile, 'yt', outputvideos_path)

      #resize the video for tt, resized is the filename
      print('----------- generating tiktok video')
      resized = resize(final_clip, count, outputvideos_path)
      
      print('----------- subtitling tiktokvideo')
      tiktoksubtitled = create_subtitles(resized, transcribefile, 'tt', outputvideos_path)

  if len(df)>1:
    #writing the finall clips list into a concatinated video
    print("----------- Concatinating all {} videos -----------".format(len(df)))
    concatinate_all = mp.concatenate_videoclips(clips_list)
    
    #creating paths to save videos to 
    ytoutpath = os.path.join(outputvideos_path, 'concat_youtube.mp4')

    #write out file for iphone
    concatinate_all.write_videofile(ytoutpath)


    


    Here are some other functions that are used in the main script I created, which will show the complete context :

    


    def get_audio_length(filepath: str)->float:
    print('----------- Retrieving audio length')
    seconds = librosa.get_duration(filename=filepath)
    print(f'----------- Seconds: {seconds}')
    return seconds

def clip_video(input_video: str, start_stamp: str, end_stamp: str, delta: float | None = None) -> mp.VideoFileClip:
  # Load the video.
  video = mp.VideoFileClip(input_video)

  #converting timestamp to seconds 
  if delta:
    start_stamp = convert_timestamp(start_stamp)-delta
    end_stamp = convert_timestamp(end_stamp)
    clip = video.subclip(start_stamp, end_stamp)

  else:
  # Clip the video.
    clip = video.subclip(convert_timestamp(start_stamp), convert_timestamp(end_stamp))
  
  return clip


def convert_timestamp(timestamp: str) -> float:
    
    # Split the timestamp on the `:` character.
    hours, minutes, seconds = timestamp.split(":")  
    seconds, ms = seconds.split('.')
    # Convert the time string to a timedelta object.
    timedelta_object = datetime.timedelta(hours=int(hours), minutes=int(minutes), seconds=int(seconds), milliseconds=int(ms))
    #convert to seconds 
    seconds = timedelta_object.total_seconds()
    return seconds


    


    My problem is that the Recording4.m4a, is bleeding into the last part of each of the recordings above it. I am not sure why this is happening, as I am creating a totally different "mono.mp3" file each time. Essentially, this file is a mono instead of stero version of the "speech" file I am adding to the front of each video.

    


    How do I stop the final recording from bleeding into the others ? This basically means that each of my audio files start with the correct sound, but then about halfway through the fourth recording interrupts and starts. I feel like I am missing some understanding of how moviepy works.

    


  • Revision 36889 : Le début d’une page d’info concernant la configuration de FFMPEG sur le ...

    3 avril 2010, par kent1@… — Log

    Le début d’une page d’info concernant la configuration de FFMPEG sur le serveur.
    On vire le PHP du squelette du formulaire de configuration
    On prépare le passage aux pressets

  • Make better marketing decisions with attribution modeling

    19 décembre 2017, par InnoCraft

    Do you suspect some traffic sources are not getting the rewards they deserve ? Do you want to know how much credit each of your marketing channel actually gets ?

    When you look at which referrers contribute the most to your goal conversions or purchases, Matomo (Piwik) shows you only the referrer of the last visit. However, in reality, a visitor often visits a website multiple times from different referrers before they convert a goal. Giving all credit to the referrer of the last visit ignores all other referrers that contributed to a conversion as well.

    You can now push your marketing analysis to the next level with attribution modeling and finally discover the true value of all your marketing channels. As a result, you will be able to shift your marketing efforts and spending accordingly to maximize your success and stop wasting resources. In marketing, studying this data is called attribution modeling.

    Get the true value of your referrers

    Attribution is a premium feature that you can easily purchase from the Matomo (Piwik) marketplace.

    Once installed, you will be able to :

    • identify valuable referrers that you did not see before
    • invest in potential new partners
    • attribute a new level of conversion
    • make this work very easily by filling just a couple of form information

    Identify valuable referrers that you did not see before

    You probably have hundreds or even thousands of different sources listed within the referrer reports. We also guess that you have the feeling that it is always the same referrers which are credited of conversions.
    Guess what, those data are probably biased or at least are not telling you the whole story.
    Why ? Because by default, Matomo (Piwik) only attributes all credit to the last referrer.

    It is likely that many non credited sources played a role in the conversion process as well as people often visit your website several times before converting and they may come from different referrers.

    This is exactly where attribution modeling comes into play. With attribution modeling, you can decide which touchpoint you want to study. For example, you can choose to give credit to all the referrers a single visitor came from each time the user visits your website, and not only look at the last one. Without this feature, chances are, that you have spent too much money and / or efforts on the wrong referrer channels in the past because many referrers that contributed to conversions were ignored. Based on the insights you get by applying different attribution models, you can make better decisions on where to shift your marketing spending and efforts.

    Invest in potential new partners

    Once you apply different attribution models, you will find out that you need to consider a new list of referrers which you before either over- or under-estimated in terms of how much they contributed to your conversions. You probably did not identify those sources before because Matomo (Piwik) shows only the last referrer before a conversion. But you can now also look at what these newly discovered referrers are saying about your company, looking for any advertising programs they may offer, getting in contact with the owner of the website, and more.

    Apply up to 6 different attribution models

    By default, Matomo (Piwik) is attributing the conversion to the last referrer only. With attribution modeling you can analyze 6 different models :

    • Last Interaction : the conversion is attributed to the last referrer, even if it is a direct access.
    • Last Non-Direct : the conversion is attributed to the last referrer, but not in the case of a direct access.
    • First Interaction : the conversion is attributed to the first referrer which brought you the visit.
    • Linear : whatever the number of referrers which brought you the conversion, they will all get the same value.
    • Position Based : first and last referrer will be attributed 40% each the conversion value, the remaining 60% is divided between the rest of the referrers.
    • Time Decay : this attribution model means that the closer to the date of the conversion is, the more your last referrers will get credit.

    Those attribution models will enable you to analyze all your referrers deeply and increase your conversions.

    Let’s look at an example where we are comparing two models : “last interaction” and “first interaction”. Our goal is to identify whether some referrers that we are currently considering as less important, are finally playing a serious role in the total amount of conversions :

    Comparing Last Interaction model to First Interaction model

    Here it is interesting to observe that the website www.hongkiat.com is bringing almost 90% conversion more with the first interaction model rather than the last one.

    As a result we can look at this website and take the following actions :

    • have a look at the message on this website
    • look at opportunities to change the message
    • look at opportunities to display extra marketing messages
    • get in contact with the owner to identify any other communication opportunities

    The Multi Channel Attribution report

    Attribution modeling in Matomo (Piwik) does not require you to add any tracking code. The only thing you need is to install the plugin and let the magic happen.
    Simple as pie is the word you should keep in mind for this feature. Once installed, you will find the report within the goal section, just above the goals you created :

    The Multi Attribution menu

    There you can select the attribution model you would like to apply or compare.

    Attribution modeling is not just about playing with a new report. It is above all an opportunity to increase the number of conversions by identifying referrers that you may have not recognized as valuable in the past. To grow your business, it is crucial to identify the most (and least) successful channels correctly so you can spend your time and money wisely.

    The post Make better marketing decisions with attribution modeling appeared first on Analytics Platform - Matomo.