Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (80)

  • MediaSPIP 0.1 Beta version

    25 avril 2011, par

    MediaSPIP 0.1 beta is the first version of MediaSPIP proclaimed as "usable".
    The zip file provided here only contains the sources of MediaSPIP in its standalone version.
    To get a working installation, you must manually install all-software dependencies on the server.
    If you want to use this archive for an installation in "farm mode", you will also need to proceed to other manual (...)

  • MediaSPIP version 0.1 Beta

    16 avril 2011, par

    MediaSPIP 0.1 beta est la première version de MediaSPIP décrétée comme "utilisable".
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Pour avoir une installation fonctionnelle, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

  • 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 (...)

Sur d’autres sites (7409)

  • 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.

    


  • ffmpeg : LIVE HLS Playback getting delayed over time

    31 juillet 2020, par Krishnakumar

    We are converting UDP Input to Live HLS output and pushing the chunks to a webdav server. Initial playback works fine, But the playback was delayed by almost an hour, when we checked after 15 hours. Not sure this is caused due to network as we use internet to push the chunks. Below is the ffmpeg command used.

    


    ffmpeg -i udp://230.1.1.15:10000?fifo_size=10000000&overrun_nonfatal=1 -filter_complex [i:0xd49]yadif,setdar=256/144[v0];[i:0xd49]yadif,setdar=512/288[v1];[i:0xd49]yadif,setdar=640/360[v2];[i:0xd49]yadif,setdar=1280/720[v3] -f hls -map i:0xd4a -af aresample=async=1:min_hard_comp=0.100000:first_pts=0 -c:a:0 libfdk_aac -b:a:0 48000 -ar:0 48000 -map [v0] -b:v:0 100000 -maxrate:v:0 100000 -minrate:v:0 100000 -bufsize:v:0 200000 -s:v:0 256x144 -r:0 25 -sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop -c:v:0 libx264 -profile:v:0 baseline -level:v:0 3.0 -preset:v:0 fast -nal-hrd cbr -g 50 -map i:0xd4a -af aresample=async=1:min_hard_comp=0.100000:first_pts=0 -c:a:1 libfdk_aac -b:a:1 48000 -ar:1 48000 -map [v1] -b:v:1 200000 -maxrate:v:1 200000 -minrate:v:1 200000 -bufsize:v:1 400000 -s:v:1 512x288 -r:1 25 -sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop -c:v:1 libx264 -profile:v:1 baseline -level:v:1 3.0 -preset:v:1 fast -nal-hrd cbr -g 50 -map i:0xd4a -af aresample=async=1:min_hard_comp=0.100000:first_pts=0 -c:a:2 libfdk_aac -b:a:2 64000 -ar:2 48000 -map [v2] -b:v:2 700000 -maxrate:v:2 700000 -minrate:v:2 700000 -bufsize:v:2 1400000 -s:v:2 640x360 -r:2 25 -sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop -c:v:2 libx264 -profile:v:2 baseline -level:v:2 3.0 -preset:v:2 fast -nal-hrd cbr -g 50 -map i:0xd4a -af aresample=async=1:min_hard_comp=0.100000:first_pts=0 -c:a:3 libfdk_aac -b:a:3 64000 -ar:3 48000 -map [v3] -b:v:3 1000000 -maxrate:v:3 1000000 -minrate:v:3 1000000 -bufsize:v:3 2000000 -s:v:3 1280x720 -r:3 25 -sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop -c:v:3 libx264 -profile:v:3 high -level:v:3 4.0 -preset:v:3 fast -nal-hrd cbr -g 50 -var_stream_map a:0,v:0,name:148k a:1,v:1,name:248k a:2,v:2,name:764k a:3,v:3,name:1064k -master_pl_name master.m3u8 -hls_list_size 3 -hls_time 6 -hls_segment_filename https://usr:pass@example.com:8043/httppush/media_%v_%03d.ts -hls_flags delete_segments+independent_segments+discont_start https://usr:pass@example.com:8043/httppush/playlist_%v.m3u8


    


    FFMPEG V4.3

    


    ffmpeg version 4.3 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-36)
  configuration: --prefix=/root/ffmpeg_build --pkg-config-flags=--static --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags=-L/root/ffmpeg_build/lib --extra-libs=-lpthread --extra-libs=-lm --bindir=/root/bin --enable-gpl --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libopus --enable-libvpx --enable-libx264 --enable-libx265 --enable-nonfree --enable-openssl
  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
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100


    


    With Split Filter :

    


    ffmpeg -i "udp://230.1.1.15:10000?fifo_size=10000000&overrun_nonfatal=1" -filter_complex "[i:0xd49]yadif[v];[v]split=4[1out1][1out2][1out3][1out4];[1out1]setdar=256/144[v0];[1out2]setdar=512/288[v1];[1out3]setdar=640/360[v2];[1out4]setdar=1280/720[v3];[i:0xd4a]aresample=async=1:min_hard_comp=0.100000:first_pts=0[a];[a]asplit=4[a0][a1][a2][a3]" -f hls -map [a0] -c:a:0 libfdk_aac -b:a:0 48000 -ar:0 48000 -map [v0] -b:v:0 100000 -maxrate:v:0 100000 -minrate:v:0 100000 -bufsize:v:0 200000 -s:v:0 256x144 -r:0 25 -sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop -c:v:0 libx264 -profile:v:0 baseline -level:v:0 3.0 -preset:v:0 fast -nal-hrd cbr -g 50 -map [a1] -c:a:1 libfdk_aac -b:a:1 48000 -ar:1 48000 -map [v1] -b:v:1 200000 -maxrate:v:1 200000 -minrate:v:1 200000 -bufsize:v:1 400000 -s:v:1 512x288 -r:1 25 -sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop -c:v:1 libx264 -profile:v:1 baseline -level:v:1 3.0 -preset:v:1 fast -nal-hrd cbr -g 50 -map [a2] -c:a:2 libfdk_aac -b:a:2 64000 -ar:2 48000 -map [v2] -b:v:2 700000 -maxrate:v:2 700000 -minrate:v:2 700000 -bufsize:v:2 1400000 -s:v:2 640x360 -r:2 25 -sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop -c:v:2 libx264 -profile:v:2 baseline -level:v:2 3.0 -preset:v:2 fast -nal-hrd cbr -g 50 -map [a3] -c:a:3 libfdk_aac -b:a:3 64000 -ar:3 48000 -map [v3] -b:v:3 1000000 -maxrate:v:3 1000000 -minrate:v:3 1000000 -bufsize:v:3 2000000 -s:v:3 1280x720 -r:3 25 -sc_threshold 0 -pix_fmt yuv420p -flags +global_header+cgop -c:v:3 libx264 -profile:v:3 high -level:v:3 4.0 -preset:v:3 fast -nal-hrd cbr -g 50 -var_stream_map "a:0,v:0,name:148k a:1,v:1,name:248k a:2,v:2,name:764k a:3,v:3,name:1064k" -master_pl_name master.m3u8 -hls_list_size 3 -hls_time 6 -hls_segment_filename https://usr:pass@example.com:8043/httppush/media_%v_%03d.ts -hls_flags delete_segments+independent_segments+discont_start https://usr:pass@example.com:8043/httppush/playlist_%v.m3u8


    


  • unable to steam rtsp from mp4(h264) file using ffmpeg on os x : Connection refused Could not write header for output file

    28 janvier 2023, par TalG

    im ussing the following command on my macbook os high sierra to stream rtsp from mp4 file using ffmpeg :

    


    sudo ffmpeg -re -i ./Big_Buck_Bunny_1080_10s_1MB.mp4 -c:v libx264 -preset superfast -tune zerolatency -c:a aac -ar 44100 -f rtsp -rtsp_transport udp rtsp://127.0.0.1:8888/live


    


    but get the following error :

    


    [tcp @ 0x7fb979e22ec0] Connection to tcp://127.0.0.1:1935?timeout=0 failed: Connection refused
Could not write header for output file #0 (incorrect codec parameters ?): Connection refused
Error initializing output stream 0:0 -- 
Conversion failed!


    


    here is the whole output of the command :

    


    ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with Apple LLVM version 10.0.0 (clang-1000.11.45.5)
  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
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from './Big_Buck_Bunny_1080_10s_1MB.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    title           : Big Buck Bunny, Sunflower version
    artist          : Blender Foundation 2008, Janus Bager Kristensen 2013
    composer        : Sacha Goedegebure
    encoder         : Lavf57.63.100
    comment         : Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
    genre           : Animation
  Duration: 00:00:10.00, start: 0.000000, bitrate: 815 kb/s
    Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 812 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
    Metadata:
      handler_name    : VideoHandler
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
Press [q] to stop, [?] for help
[libx264 @ 0x7fb97a00de00] using SAR=1/1
[libx264 @ 0x7fb97a00de00] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
[libx264 @ 0x7fb97a00de00] profile High, level 4.0, 4:2:0, 8-bit
[libx264 @ 0x7fb97a00de00] 264 - core 160 r3011 cde9a93 - H.264/MPEG-4 AVC codec - Copyleft 2003-2020 - http://www.videolan.org/x264.html - options: cabac=1 ref=1 deblock=1:0:0 analyse=0x3:0x3 me=dia subme=1 psy=1 psy_rd=1.00:0.00 mixed_ref=0 me_range=16 chroma_me=1 trellis=0 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=0 threads=12 lookahead_threads=12 sliced_threads=1 slices=12 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=0 weightp=1 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc=crf mbtree=0 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[tcp @ 0x7fb979e22ec0] Connection to tcp://127.0.0.1:1935?timeout=0 failed: Connection refused
Could not write header for output file #0 (incorrect codec parameters ?): Connection refused
Error initializing output stream 0:0 -- 
Conversion failed!


    


    tried with and without sudo, tried changing rtsp ://... to http://
also tried udp but get same output..

    


    chacked that the port is not in use(8888) and different ports (1935...) but still the same.

    


    i installed ffmpeg via brew install...

    


    when i run some test server on my localhost i never have issues ussing an unused port

    


    really stuck here and any help would be amazing...thank you

    


    EDIT :
Problem was in the command i used : "rtsp ://127.0.0.1:8888/live" - but i did not have a running server capable of accepting the data from ffmpeg and redestributing it - so i had to first run such server and only after that to run ffmpeg :

    


    Servers which can receive from FFmpeg (to restream to multiple clients) include ffserver (linux only, though with cygwin it might work on windows), or ​Wowza Media Server, or ​Flash Media Server, Red5, or ​various others. Even ​VLC can pick up the stream from ffmpeg, then redistribute it, acting as a server.

    


    i used the VLC option. You can read about it here : http://trac.ffmpeg.org/wiki/StreamingGuide