Recherche avancée

Médias (91)

Autres articles (63)

  • Dépôt de média et thèmes par FTP

    31 mai 2013, par

    L’outil MédiaSPIP traite aussi les média transférés par la voie FTP. Si vous préférez déposer par cette voie, récupérez les identifiants d’accès vers votre site MédiaSPIP et utilisez votre client FTP favori.
    Vous trouverez dès le départ les dossiers suivants dans votre espace FTP : config/ : dossier de configuration du site IMG/ : dossier des média déjà traités et en ligne sur le site local/ : répertoire cache du site web themes/ : les thèmes ou les feuilles de style personnalisées tmp/ : dossier de travail (...)

  • Installation en mode ferme

    4 février 2011, par

    Le mode ferme permet d’héberger plusieurs sites de type MediaSPIP en n’installant qu’une seule fois son noyau fonctionnel.
    C’est la méthode que nous utilisons sur cette même plateforme.
    L’utilisation en mode ferme nécessite de connaïtre un peu le mécanisme de SPIP contrairement à la version standalone qui ne nécessite pas réellement de connaissances spécifique puisque l’espace privé habituel de SPIP n’est plus utilisé.
    Dans un premier temps, vous devez avoir installé les mêmes fichiers que l’installation (...)

  • Support audio et vidéo HTML5

    10 avril 2011

    MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
    Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
    Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
    Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...)

Sur d’autres sites (10662)

  • how to make ffmpeg transcoding from mjpeg to h264 in real time ?

    3 août 2020, par SolskGaer

    I have a mjpeg stream which output picture 10FPS(cellphone screenshot), and I use the following command to trancode it to a h264 stream and play it on my laptop

    


    ffmpeg -f mjpeg -r 20 -y -i http://127.0.0.1:53293/  -vcodec libx264 -preset veryfast -profile:v baseline -b:v 1024k -r 10 -f h264 pipe:1 | ffplay -i pipe:0


    


    but the output stream is a few seconds behind the cellphone screen. Here is the output of ffmpeg

    


    ffplay version 4.3.1 Copyright (c) 2003-2020 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.62)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple clang version 11.0.3 (clang-1103.0.32.62)
  configuration: --prefix=/usr/local/Cellar/ffmpeg/4.3.1 --enable-shared --enable-pthreads --enable-version3 --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-ffplay --enable-gnutls --enable-gpl --enable-libaom --enable-libbluray --enable-libdav1d --enable-libmp3lame --enable-libopus --enable-librav1e --enable-librubberband --enable-libsnappy --enable-libsrt --enable-libtesseract --enable-libtheora --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libxvid --enable-lzma --enable-libfontconfig --enable-libfreetype --enable-frei0r --enable-libass --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-librtmp --enable-libspeex --enable-libsoxr --enable-videotoolbox --disable-libjack --disable-indev=jack
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, mjpeg, from 'http://127.0.0.1:53293/':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Video: mjpeg (Baseline), yuvj420p(pc, bt470bg/unknown/unknown), 750x1334 [SAR 144:144 DAR 375:667], 20 tbr, 1200k tbn, 20 tbc
Stream mapping:
  Stream #0:0 -> #0:0 (mjpeg (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7f8f2900da00] using SAR=1/1
[libx264 @ 0x7f8f2900da00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7f8f2900da00] profile Constrained Baseline, level 3.2, 4:2:0, 8-bit
Output #0, h264, to 'pipe:1':
  Metadata:
    encoder         : Lavf58.45.100
    Stream #0:0: Video: h264 (libx264), yuvj420p(pc), 750x1334 [SAR 144:144 DAR 375:667], q=-1--1, 1024 kb/s, 10 fps, 10 tbn, 10 tbc
    Metadata:
      encoder         : Lavc58.91.100 libx264
    Side data:
      cpb: bitrate max/min/avg: 0/0/1024000 buffer size: 0 vbv_delay: N/A
frame=   30 fps=5.2 q=29.0 size=      97kB time=00:00:00.10 bitrate=7911.0kbits/s dup=0 drop=26 speed=0.0172
frame=   33 fps=5.2 q=41.0 size=     190kB time=00:00:00.40 bitrate=3888.2kbits/s dup=0 drop=29 speed=0.0633
frame=   35 fps=5.1 q=40.0 size=     253kB time=00:00:00.60 bitrate=3457.8kbits/s dup=0 drop=31 speed=0.0874
frame=   38 fps=5.1 q=40.0 size=     330kB time=00:00:00.90 bitrate=3006.1kbits/s dup=0 drop=34 speed=0.122x
frame=   40 fps=5.1 q=40.0 size=     381kB time=00:00:01.10 bitrate=2838.3kbits/s dup=0 drop=36 speed=0.139x
frame=   43 fps=5.1 q=39.0 size=     460kB time=00:00:01.40 bitrate=2691.3kbits/s dup=0 drop=39 speed=0.166x
frame=   45 fps=5.0 q=39.0 size=     505kB time=00:00:01.60 bitrate=2585.9kbits/s dup=0 drop=41 speed=0.178x
frame=   48 fps=5.0 q=38.0 size=     552kB time=00:00:01.90 bitrate=2381.0kbits/s dup=0 drop=44 speed= 0.2x 
frame=   50 fps=5.0 q=33.0 size=     562kB time=00:00:02.10 bitrate=2190.7kbits/s dup=0 drop=46 speed=0.209x
frame=   53 fps=5.0 q=37.0 size=     572kB time=00:00:02.40 bitrate=1951.2kbits/s dup=0 drop=49 speed=0.227x
frame=   55 fps=5.0 q=37.0 size=     581kB time=00:00:02.60 bitrate=1830.0kbits/s dup=0 drop=51 speed=0.234x
frame=   58 fps=5.0 q=36.0 size=     591kB time=00:00:02.90 bitrate=1670.8kbits/s dup=0 drop=54 speed=0.25x 
frame=   60 fps=4.9 q=35.0 size=     598kB time=00:00:03.10 bitrate=1580.2kbits/s dup=0 drop=56 speed=0.255x
frame=   63 fps=5.0 q=35.0 size=     608kB time=00:00:03.40 bitrate=1465.2kbits/s dup=0 drop=59 speed=0.268x
frame=   65 fps=4.9 q=34.0 size=     613kB time=00:00:03.60 bitrate=1395.7kbits/s dup=0 drop=61 speed=0.273x
frame=   68 fps=5.0 q=34.0 size=     659kB time=00:00:03.90 bitrate=1384.5kbits/s dup=0 drop=64 speed=0.284x
frame=   70 fps=4.9 q=34.0 size=     682kB time=00:00:04.10 bitrate=1363.2kbits/s dup=0 drop=66 speed=0.288x
frame=   73 fps=4.9 q=35.0 size=     720kB time=00:00:04.40 bitrate=1340.1kbits/s dup=0 drop=69 speed=0.298x
frame=   75 fps=4.9 q=35.0 size=     746kB time=00:00:04.60 bitrate=1329.1kbits/s dup=0 drop=71 speed=0.301x
frame=   78 fps=4.9 q=36.0 size=     786kB time=00:00:04.90 bitrate=1314.6kbits/s dup=0 drop=74 speed=0.31x 
frame=   80 fps=4.9 q=36.0 size=     811kB time=00:00:05.10 bitrate=1303.3kbits/s dup=0 drop=76 speed=0.312x


    


    I don't think the CPU of my laptop is the bottleneck of this process, here is the spec of my laptop

    


    
      Model Name: MacBook Pro
      Model Identifier: MacBookPro16,1
      Processor Name: 6-Core Intel Core i7
      Processor Speed: 2.6 GHz
      Number of Processors: 1
      Total Number of Cores: 6
      L2 Cache (per Core): 256 KB
      L3 Cache: 12 MB
      Hyper-Threading Technology: Enabled
      Memory: 16 GB


    


    but I can't track the reason why this happened. What can I make the output stream be real time ? Any suggestion would be appreciated.

    


  • Ffmpeg inaccurate cut duration with ts [duplicate]

    30 juillet 2020, par Lemon Sky

    I need to accurately seek and cut a video. Some online sources say put -ss in front or after the source. The result is the same for me. In the examples below, the start time is accurate but the duration is not accurate.

    


    ffmpeg -y -ss 00:00:05 -t 00:00:05 -i http://tyberis.com/output.ts 5s.wav
ffprobe 5s.wav

Duration: 00:00:04.74

ffmpeg -y -i http://tyberis.com/output.ts -ss 00:00:05 -t 00:00:05 5s.wav
ffprobe 5s.wav

Duration: 00:00:04.74


    


    Sometimes the starting point is not accurate but the duration is. This is clearly audible by cutting the ts file and cutting an uncompressed wav file, and listening to both.

    


    ffmpeg -y -i http://tyberis.com/output.ts -ss 00:00:15 -t 00:00:05 5s.wav

ffmpeg -y -i http://tyberis.com/output.wav -ss 00:00:15 -t 00:00:05 5s-reference.wav


    


    What fixes the starting time is if I use an m3u8 file that contains the byte offset for every keyframe AND I put the -ss option in front of the source file (if I put it after the source, the start time is inaccurate but the duration is accurate) :

    


    ffmpeg -y -ss 00:00:15 -t 00:00:05 -i http://tyberis.com/output.m3u8 5s.wav


    


    This fixes the start time but the duration is at the location that I would get had I used no m3u8 file (duration is just 4.47s).

    


    It seems different timestamps are involved, and sometimes one or the other gets used.

    


    The ts file was generated by capturing a UDP stream and storing it with ffmpeg and -codec:v copy.

    


    Is ffmpeg broken, or the ts file ? How do I work around this issue or fix the ts file ? What I realize is that the video starts later than the audio, probably because the video does not start with a keyframe. Can I get ffmpeg to start the -codec:v copy after the first keyframe ? What I also notice is that using ffprobe reports "start : 1.400000". Can I force it to start at 0 ?

    


    Any hints would be appreciated.

    


    I tried both ffmpeg 4.3.1 and ffmpeg git-2020-07-24-21442a8.

    


  • Add watermark in video with Google Cloud function python

    26 septembre 2020, par Dharmeshsharma

    I am adding watermark in uploaded video by http google cloud function but my code is return on ffmpeg non zero. my python code

    


    import os
from google.cloud import storage
from subprocess import check_output
from videoprops import get_video_properties


def hello_world(request):

client = storage.Client()
bucket = client.get_bucket('bucket_name')
request_json = request.get_json()
req_data = request.get_json()
name = req_data['file']
videofile_name = req_data['file_name']
os.makedirs('/tmp/'+os.path.dirname(name), exist_ok=True)
file_name = '/tmp/' + name
output_file_name = '/tmp/' + name.split('.')[0] + '_.'+name.split('.')[1]
print(output_file_name)
logo_path = '/temp/watermark.png'
logo_name = 'watermark.png'
print('logo found')

print(file_name)

try:
    os.remove(file_name)
except OSError:
    pass

try:
    os.remove(logo_path)
except OSError:
    pass

print("File has been removed")

# Downloading the video to the cloud functions
blob = bucket.get_blob(name)
blob.download_to_filename(file_name)

blob_logo = bucket.get_blob(logo_name)
blob_logo.download_to_filename(logo_path)

print("Video Downloaded")

props = get_video_properties(file_name)

if os.path.exists(file_name):
    print("NEW MP4 EXISTS")
    #   check_output('ffmpeg  -itsoffset -4  -i '+file_name+' -vcodec mjpeg -vframes 1 -an -f rawvideo -s '+str(props['width'])+'x'+str(props['height'])+' '+thumbnail_file_name, shell=True)
    #   thumbnail_blob = bucket.blob(os.path.dirname(name)+'/thumbnail.jpg')
    #   thumbnail_blob.upload_from_filename(thumbnail_file_name)
    # 19-7-2020
    check_output('ffmpeg  -i '+file_name+' -i '+logo_path +
                 ' -filter_complex overlay=10:10 -codec:a copy -preset ultrafast -async 1 '+output_file_name, shell=True)
    thumbnail_blob = bucket.blob(
        os.path.dirname(name) + '/'+videofile_name)
    thumbnail_blob.upload_from_filename(output_file_name)
    # -------------------------------------
else:
    print("MP4 not created")

print("uploaded")


    


    In this code accessing video add watermark also accessing from bucket and applying with ffmpeg and uploading.

    


    error is :-

    


    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError : Command 'ffmpeg -i /tmp/Upload/Video/1060/ad69ec74-49db-4fdb-b118-d23b9468a7b8.mp4 -i /temp/watermark.png -filter_complex overlay=10:10 -codec:a copy -preset ultrafast -async 1 /tmp/Upload/Video/1060/ad69ec74-49db-4fdb-b118-d23b9468a7b8_.mp4' returned non-zero exit status 1.