Recherche avancée

Médias (91)

Autres articles (111)

  • Creating farms of unique websites

    13 avril 2011, par

    MediaSPIP platforms can be installed as a farm, with a single "core" hosted on a dedicated server and used by multiple websites.
    This allows (among other things) : implementation costs to be shared between several different projects / individuals rapid deployment of multiple unique sites creation of groups of like-minded sites, making it possible to browse media in a more controlled and selective environment than the major "open" (...)

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

  • (Dés)Activation de fonctionnalités (plugins)

    18 février 2011, par

    Pour gérer l’ajout et la suppression de fonctionnalités supplémentaires (ou plugins), MediaSPIP utilise à partir de la version 0.2 SVP.
    SVP permet l’activation facile de plugins depuis l’espace de configuration de MediaSPIP.
    Pour y accéder, il suffit de se rendre dans l’espace de configuration puis de se rendre sur la page "Gestion des plugins".
    MediaSPIP est fourni par défaut avec l’ensemble des plugins dits "compatibles", ils ont été testés et intégrés afin de fonctionner parfaitement avec chaque (...)

Sur d’autres sites (8277)

  • ffprobe reading wrong frame rate, any workarounds besides MediaInfo ?

    20 mai 2023, par Minty

    I want to check the frame rate of many videos. I decided to employ ffprobe :

    


    ffprobe -v error -select_streams v -of default=noprint_wrappers=1:nokey=1 -show_entries stream=r_frame_rate faulty.mkv =

    


    500/21


    


    That can't be right, what kind of fps is 500/21 ?

    


    ffprobe faulty.mkv (version 4.3.5-0+deb11u1+rpt3)

    


    Stream #0:0: Video: (...), 23.81 fps, 23.81 tbr, 1k tbn, 23.98 tbc (default)


    


    At least ffprobe 4 read the correct codec timescale i.e. 23.98 tbc (default), but in later versions tbc has been deprecated :

    


    Stream #0:0: Video: (...), 23.81 fps, 23.81 tbr, 1k tbn (default)


    


    However, MediaInfo gets it right :

    


    mediainfo faulty.mkv =

    


    (...)
Frame rate mode                          : Constant
Frame rate                               : 23.976 (24000/1001) FPS
(...)


    


    I tried using -count_packets to then divide nb_read_packets of the stream by the duration of the file, I'm getting 1 second per hour error. This is much better compared to 23,8095, but packets are not frames, and only the prohibitively, unusably slow -count_frames gets me the exact value.

    


    The rest of my workflow uses ffprobe, so I'm reluctant to switch to MediaInfo completely. I get that the file is, well, faulty, but if mediainfo can do it, is there a way to make sure the correct frame rate is read with ffprobe without decoding the entire file as -count_frames seems to do ?

    


  • FFMPEG - Accurately cutting video/audio and merging multiple videos together

    8 février 2023, par 3EK

    This post has been updated since the original post

    


    thanks in advance for any help I get with this...

    


    I am working with 4 video assets....all stereo audio, same a/v spec.

    


    intro -
mainvideo -
midroll_video (advert) -
endboard

    


    I need to add an audio only cross fade between the 2 video elements part2.mp4 and pip.mp4. These 2 videos are made by the code (rather than being 2 of the 4 videos listed above). I have added in the code as kindly instructed by @Баяр Гончикжапов but unfortunately it is still not working. See conversation below for more info/ the part i need help with.

    


    Thanks in advance !

    


    This is the code I am using.

    


    
# Input parameters
mainvideo=mezzfile.mp4
endboard=endboard.mp4
intro=sting.mp4
midroll_video=midroll.mp4

tailtime=20
fadelength=0.2
midroll_edit_value=00:11:31.600

# Time calculations to define cut point
duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $mainvideo)
endboard_cut_point=$(echo "scale=2;$duration-$tailtime" | bc)

duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 $mainvideo)
midroll_cut_point=$(echo "scale=2;$duration-$midroll_edit_value" | bc)

# Safety check
tbn_main=$(ffprobe -v error -select_streams v -show_entries stream=time_base -of default=noprint_wrappers=1:nokey=1 $mainvideo)
tbn_main=${tbn_main#*/}
tbn_intro=$(ffprobe -v error -select_streams v -show_entries stream=time_base -of default=noprint_wrappers=1:nokey=1 $intro)
tbn_intro=${tbn_intro#*/}
tbn_end=$(ffprobe -v error -select_streams v -show_entries stream=time_base -of default=noprint_wrappers=1:nokey=1 $endboard)
tbn_end=${tbn_end#*/}

if [[ $(( ($tbn_intro+$tbn_main+$tbn_end)/3 )) -ne $tbn_main ]]; then
  echo "WARNING: source video files have the different timebase."
  echo "The use of the concat demuxer will produce incorrect output."
  echo "Re-encoding is highly recommended."
  read -s -k $'?Press any key to exit.\n'
  exit 1
fi

# Trim the main part of mainvideo
ffmpeg -hide_banner -y -i $mainvideo -to $midroll_edit_value -c copy part1.mp4

ffmpeg -hide_banner -y -i $mainvideo -ss $midroll_edit_value -to $endboard_cut_point -c copy part2.mp4

ffmpeg -hide_banner -y -i $mainvideo -ss $midroll_edit_value -to $duration -c copy part2av.mp4


# Trim the tail of mainvideo and overlay it onto endboard
ffmpeg -hide_banner -y \
  -i $mainvideo \
  -i $endboard \
  -filter_complex \
    "[0:v]select='gt(t,$duration-$tailtime)',scale=w=iw/2.03:h=ih/2.03,setpts=PTS-STARTPTS[v_tail]; \
     [0:a]aselect='gt(t,$duration-$tailtime)',asetpts=PTS-STARTPTS[a_out]; \
     [1:v][v_tail]overlay=format=auto[v_out]" \
  -map "[v_out]" \
  -map "[a_out]" \
  -video_track_timescale $tbn_main \
  pip.mp4

ffmpeg -hide_banner -y -i "part2.mp4" -i "part2av.mp4" -i "pip.mp4" \
  -filter_complex \
     -map "[0:v];" 
     -map "[1:a];" 
     -map "[2:v]" 
     -c copy "part2pip.mp4" \

# Pass all parts through the concat demuxer
[ -f filelist.txt ] && rm filelist.txt
for f in $intro part1.mp4 $midroll_video part2pip.mp4; do echo "file '$PWD/$f'" >> filelist.txt; done
ffmpeg -hide_banner -y -f concat -safe 0 -i filelist.txt -c copy TEST_FILE.mp4

# Sweep the table
rm pip.mp4 part1.mp4 part2.mp4 filelist.txt```


    


  • Error : Unable to extract uploader id - Youtube, Discord.py

    22 juillet 2024, par nikita goncharov

    I have a very powerful bot in discord (discord.py, PYTHON) and it can play music in voice channels. It gets the music from youtube (youtube_dl). It worked perfectly before but now it doesn't want to work with any video.
I tried updating youtube_dl but it still doesn't work
I searched everywhere but I still can't find a answer that might help me.

    


    This is the Error : Error: Unable to extract uploader id

    


    After and before the error log there is no more information.
Can anyone help ?

    


    I will leave some of the code that I use for my bot...
The youtube setup settings :

    


    youtube_dl.utils.bug_reports_message = lambda: ''


ytdl_format_options = {
    'format': 'bestaudio/best',
    'outtmpl': '%(extractor)s-%(id)s-%(title)s.%(ext)s',
    'restrictfilenames': True,
    'noplaylist': True,
    'nocheckcertificate': True,
    'ignoreerrors': False,
    'logtostderr': False,
    'quiet': True,
    'no_warnings': True,
    'default_search': 'auto',
    'source_address': '0.0.0.0',  # bind to ipv4 since ipv6 addresses cause issues sometimes
}

ffmpeg_options = {
    'options': '-vn',
}

ytdl = youtube_dl.YoutubeDL(ytdl_format_options)


class YTDLSource(discord.PCMVolumeTransformer):
    def __init__(self, source, *, data, volume=0.5):
        super().__init__(source, volume)

        self.data = data

        self.title = data.get('title')
        self.url = data.get('url')
        self.duration = data.get('duration')
        self.image = data.get("thumbnails")[0]["url"]
    @classmethod
    async def from_url(cls, url, *, loop=None, stream=False):
        loop = loop or asyncio.get_event_loop()
        data = await loop.run_in_executor(None, lambda: ytdl.extract_info(url, download=not stream))
        #print(data)

        if 'entries' in data:
            # take first item from a playlist
            data = data['entries'][0]
        #print(data["thumbnails"][0]["url"])
        #print(data["duration"])
        filename = data['url'] if stream else ytdl.prepare_filename(data)
        return cls(discord.FFmpegPCMAudio(filename, **ffmpeg_options), data=data)



    


    Approximately the command to run the audio (from my bot) :

    


    sessionChanel = message.author.voice.channel
await sessionChannel.connect()
url = matched.group(1)
player = await YTDLSource.from_url(url, loop=client.loop, stream=True)
sessionChannel.guild.voice_client.play(player, after=lambda e: print(
                                       f'Player error: {e}') if e else None)