Recherche avancée

Médias (1)

Mot : - Tags -/biomaping

Autres articles (80)

  • Personnaliser en ajoutant son logo, sa bannière ou son image de fond

    5 septembre 2013, par

    Certains thèmes prennent en compte trois éléments de personnalisation : l’ajout d’un logo ; l’ajout d’une bannière l’ajout d’une image de fond ;

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

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

Sur d’autres sites (3877)

  • How to increase my sever ability to run ffmpeg command faster and then execute my php code

    9 janvier 2018, par Femzy

    Hello I have a problem with the ffmpeg command, when i tried to use a text file that has plenty of words like more than 300 words, it generate the video but also the rest of my code did not executed, i wanted to save the path of the generated video to the database after it is created and then move to the next page but the server stop after it execute the command and not run the rest of the code.
    Also i tried to use "text" only and pass the string to the Text intead of "textfile" but I Got the Below error

    Error reinitializing filters!
    Failed to inject frame into filter network: Invalid argument
    Error while processing the decoded data for stream #0:0
    [AVIOContext @ 0x329ca80] Statistics: 0 seeks, 0 writeouts
    [AVIOContext @ 0x3293680] Statistics: 32768 bytes read, 0 seeks
    Conversion failed!

    Please i want to know which one is the best practice either to use "text" or "textfile" and how i can use them to not having any error.. Thanks For helping me in advance
    This is my PHP codes that includes the ffmpeg commands

    $cmds ='ffmpeg -loop 1 -i '.$image_file.' -vf scale=-2:1080,drawtext="text='.$directory.':expansion=normal:fontfile=FreeSerif.otf: y=h-line_h-20:x=-100*t: fontcolor=white: fontsize=50" -pix_fmt yuv420p -t '.$words_count.' -movflags +faststart '.$file_dir.' -report';
                                    echo shell_exec($cmds);
                                    $video_files = array(
                                            'user_id' => $_SESSION['user_id'],
                                            'text_file_id' => $user_id,
                                            'video_file' => $file_name,
                                            'created' => time()
                                    );
                                    if($user->insert('db_table', $video_files)){
                                            if (file_exists($file_dir)) {
                                                $_SESSION['d_file'] = $file_dir;
                                                $msg['success'] = "Success";
                                            } else {
                                                $msg['error'] = "Sorry the file was not created";
                                            }                                               
                                    }else{
                                            $msg['error'] = "Sorry there was database error";
                                    }
  • How to record a webcam to a file outside of X11 ?

    13 décembre 2017, par Dav Clark

    I’m working with teachers to automatically record their classes, so we can review them and improve the quality of teaching. We have computers running Ubuntu 17.10 with multiple webcams in a couple of classrooms - but I could run other software if it makes this task easier.

    I can successfully record a stream from the webcam to an h264 encoded file using gstreamer. The following should work for most people with gstreamer installed, but I’ve got fancier pipelines using vaapi that can simultaneously encode multiple 4k streams on a NUC with room to spare ! My point is that Gstreamer works great when I’m typing at a terminal in the GUI. The example :

    .\gst-launch-1.0.exe -e autovideosrc ! videoconvert ! \
     openh264enc max-bitrate=256000 ! h264parse ! \
     mp4mux ! filesink location=somefile.mp4

    I imagine I could also do this with ffmpeg, or OpenCV, or maybe even VLC (I can record a webcam via the GUI, so I guess I could use that to generate a command line ?).

    But when I tried any of the above, for example, via SSH, I get errors from GStreamer and OpenCV, and blank videos from ffmpeg (I haven’t tried VLC because I don’t currently have access to these machines). I need to automate - but I could potentially leave a user logged in. I just need to have some way to capture webcam to disk with some amount of reasonable compression.

    I naively thought I could throw something like the above into a cron job and I’d be good to go (intending to send a SIGINT to end recording). But anything that can be automatically scheduled somehow would be great.

    EDIT : Below is an approach I’m trying using ffmpeg. You can see from the output that I can’t figure out how to specify pixel_format in a way that ffmpeg pays attention to ! First, the command (using mkv because that seems to be a "low-stress" format, but have also tried mov and mp4) :

    ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128 \
     -f v4l2 -framerate 30 -video_size hd720 -pixel_format yuv420p -i /dev/video1 output.mkv

    Like I said, I’m trying to get hardware acceleration, and you can see below that VAAPI is working (but I think just for decoding). You can easily remove the options from the first line, and I get similar results either way. I didn’t include the header with compile options and library versions, as it’s standard Ubuntu 17.10.

    libva info: VA-API version 0.40.0
    libva info: va_getDriverName() returns 0
    libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
    libva info: Found init function __vaDriverInit_0_40
    libva info: va_openDriver() returns 0
    Input #0, video4linux2,v4l2, from '/dev/video1':
     Duration: N/A, start: 42437.238243, bitrate: 442368 kb/s
       Stream #0:0: Video: rawvideo (YUY2 / 0x32595559), yuyv422, 1280x720, 442368 kb/s, 30 fps, 30 tbr, 1000k tbn, 1000k tbc
    File 'output.mkv' already exists. Overwrite ? [y/N] y
    Stream mapping:
     Stream #0:0 -> #0:0 (rawvideo (native) -> h264 (libx264))
    Press [q] to stop, [?] for help
    No pixel format specified, yuv422p for H.264 encoding chosen.
    Use -pix_fmt yuv420p for compatibility with outdated media players.
    [libx264 @ 0x55d1a26a71a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
    [libx264 @ 0x55d1a26a71a0] profile High 4:2:2, level 3.1, 4:2:2 8-bit
    [libx264 @ 0x55d1a26a71a0] 264 - core 148 r2795 aaa9aa8 - H.264/MPEG-4 AVC codec - Copyleft 2003-2017 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
    Output #0, matroska, to 'output.mkv':
     Metadata:
       encoder         : Lavf57.71.100
       Stream #0:0: Video: h264 (libx264) (H264 / 0x34363248), yuv422p, 1280x720, q=-1--1, 30 fps, 1k tbn, 30 tbc
       Metadata:
         encoder         : Lavc57.89.100 libx264
       Side data:
         cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: -1
    Past duration 0.717049 too large
    Past duration 0.879128 too large
    frame=  567 fps= 16 q=27.0 size=    2156kB time=00:00:34.16 bitrate= 516.9kbits/s speed=0.938x

    I exit with ctrl-C. Which results in what appears to be an orderly exit :

    [libx264 @ 0x55d1a26a71a0] frame I:11    Avg QP:15.75  size: 18573
    [libx264 @ 0x55d1a26a71a0] frame P:2176  Avg QP:19.91  size:  4435
    [libx264 @ 0x55d1a26a71a0] frame B:173   Avg QP:20.00  size:  3232
    [libx264 @ 0x55d1a26a71a0] consecutive B-frames: 90.1%  0.1%  0.6%  9.2%
    [libx264 @ 0x55d1a26a71a0] mb I  I16..4: 34.0% 56.1%  9.8%
    [libx264 @ 0x55d1a26a71a0] mb P  I16..4:  0.1%  1.2%  0.0%  P16..4: 32.7%  3.1%  6.1%  0.0%  0.0%    skip:56.8%
    [libx264 @ 0x55d1a26a71a0] mb B  I16..4:  0.0%  0.3%  0.0%  B16..8: 31.9%  0.7%  0.1%  direct: 1.4%  skip:65.6%  L0:41.8% L1:57.9% BI: 0.3%
    [libx264 @ 0x55d1a26a71a0] 8x8 transform intra:81.2% inter:92.4%
    [libx264 @ 0x55d1a26a71a0] coded y,uvDC,uvAC intra: 25.4% 20.1% 2.1% inter: 10.2% 7.4% 0.0%
    [libx264 @ 0x55d1a26a71a0] i16 v,h,dc,p: 78% 10%  7%  5%
    [libx264 @ 0x55d1a26a71a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  7%  6% 72%  2%  3%  3%  2%  2%  3%
    [libx264 @ 0x55d1a26a71a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 34% 21% 25%  4%  5%  3%  4%  1%  3%
    [libx264 @ 0x55d1a26a71a0] i8c dc,h,v,p: 69% 14% 15%  2%
    [libx264 @ 0x55d1a26a71a0] Weighted P-Frames: Y:1.7% UV:0.1%
    [libx264 @ 0x55d1a26a71a0] ref P L0: 49.3%  2.7% 29.6% 18.1%  0.3%
    [libx264 @ 0x55d1a26a71a0] ref B L0: 69.3% 24.1%  6.6%
    [libx264 @ 0x55d1a26a71a0] ref B L1: 86.6% 13.4%
    [libx264 @ 0x55d1a26a71a0] kb/s:529.95
    Exiting normally, received signal 2.
  • FFmpeg, MPEG4 video rotate and Windows

    25 décembre 2017, par user3768884

    I have this kind of video recorded in some Samsung Galaxy phone (info from : "ffprobe -v error -show_format -show_streams filename.mp4")

    [STREAM]
    index=0
    codec_name=h264
    codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    profile=High
    codec_type=video
    codec_time_base=7048499/423000000
    codec_tag_string=avc1
    codec_tag=0x31637661
    width=1920
    height=1080
    coded_width=1920
    coded_height=1080
    has_b_frames=0
    sample_aspect_ratio=0:1
    display_aspect_ratio=0:1
    pix_fmt=yuv420p
    level=40
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=unknown
    timecode=N/A
    refs=1
    is_avc=true
    nal_length_size=4
    id=N/A
    r_frame_rate=30/1
    avg_frame_rate=211500000/7048499
    time_base=1/90000
    start_pts=0
    start_time=0.000000
    duration_ts=7048499
    duration=78.316656
    bit_rate=17010472
    max_bit_rate=N/A
    bits_per_raw_sample=8
    nb_frames=2350
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:rotate=90
    TAG:creation_time=2017-12-17T13:42:14.000000Z
    TAG:language=eng
    TAG:handler_name=VideoHandle
    [SIDE_DATA]
    side_data_type=Display Matrix
    displaymatrix=
    00000000:            0       65536           0
    00000001:       -65536           0           0
    00000002:            0           0  1073741824

    rotation=-90
    [/SIDE_DATA]
    [/STREAM]
    [STREAM]
    index=1
    codec_name=aac
    codec_long_name=AAC (Advanced Audio Coding)
    profile=LC
    codec_type=audio
    codec_time_base=1/48000
    codec_tag_string=mp4a
    codec_tag=0x6134706d
    sample_fmt=fltp
    sample_rate=48000
    channels=2
    channel_layout=stereo
    bits_per_sample=0
    id=N/A
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/48000
    start_pts=0
    start_time=0.000000
    duration_ts=3772416
    duration=78.592000
    bit_rate=126154
    max_bit_rate=128000
    bits_per_raw_sample=N/A
    nb_frames=3684
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:creation_time=2017-12-17T13:42:14.000000Z
    TAG:language=eng
    TAG:handler_name=SoundHandle
    [/STREAM]
    [FORMAT]
    filename=original_galaxy.mp4
    nb_streams=2
    nb_programs=0
    format_name=mov,mp4,m4a,3gp,3g2,mj2
    format_long_name=QuickTime / MOV
    start_time=0.000000
    duration=78.592000
    size=167808936
    bit_rate=17081528
    probe_score=100
    TAG:major_brand=isom
    TAG:minor_version=0
    TAG:compatible_brands=isom3gp4
    TAG:creation_time=2017-12-17T13:42:14.000000Z
    [/FORMAT]

    Since all my media players does not support rotate-knowledge, I have turned the video over again, and at the same time slightly decreased the resolution of command "ffmpeg -i "input.mp4" -vf "scale=720:1280,transpose=0,transpose=0" -c:a copy "output.mp4""

    [STREAM]
    index=0
    codec_name=h264
    codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    profile=High
    codec_type=video
    codec_time_base=1/60
    codec_tag_string=avc1
    codec_tag=0x31637661
    width=720
    height=1280
    coded_width=720
    coded_height=1280
    has_b_frames=2
    sample_aspect_ratio=0:1
    display_aspect_ratio=0:1
    pix_fmt=yuv420p
    level=31
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=unknown
    timecode=N/A
    refs=1
    is_avc=true
    nal_length_size=4
    id=N/A
    r_frame_rate=30/1
    avg_frame_rate=30/1
    time_base=1/15360
    start_pts=0
    start_time=0.000000
    duration_ts=1203717
    duration=78.366992
    bit_rate=2570692
    max_bit_rate=N/A
    bits_per_raw_sample=8
    nb_frames=2351
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=eng
    TAG:handler_name=VideoHandler
    [/STREAM]
    [STREAM]
    index=1
    codec_name=aac
    codec_long_name=AAC (Advanced Audio Coding)
    profile=LC
    codec_type=audio
    codec_time_base=1/48000
    codec_tag_string=mp4a
    codec_tag=0x6134706d
    sample_fmt=fltp
    sample_rate=48000
    channels=2
    channel_layout=stereo
    bits_per_sample=0
    id=N/A
    r_frame_rate=0/0
    avg_frame_rate=0/0
    time_base=1/48000
    start_pts=0
    start_time=0.000000
    duration_ts=3772416
    duration=78.592000
    bit_rate=126154
    max_bit_rate=126154
    bits_per_raw_sample=N/A
    nb_frames=3684
    nb_read_frames=N/A
    nb_read_packets=N/A
    DISPOSITION:default=1
    DISPOSITION:dub=0
    DISPOSITION:original=0
    DISPOSITION:comment=0
    DISPOSITION:lyrics=0
    DISPOSITION:karaoke=0
    DISPOSITION:forced=0
    DISPOSITION:hearing_impaired=0
    DISPOSITION:visual_impaired=0
    DISPOSITION:clean_effects=0
    DISPOSITION:attached_pic=0
    DISPOSITION:timed_thumbnails=0
    TAG:language=eng
    TAG:handler_name=SoundHandler
    [/STREAM]
    [FORMAT]
    filename=from_ffmpeg.mp4
    nb_streams=2
    nb_programs=0
    format_name=mov,mp4,m4a,3gp,3g2,mj2
    format_long_name=QuickTime / MOV
    start_time=0.000000
    duration=78.592000
    size=26503544
    bit_rate=2697836
    probe_score=100
    TAG:major_brand=isom
    TAG:minor_version=512
    TAG:compatible_brands=isomiso2avc1mp41
    TAG:encoder=Lavf57.41.100
    [/FORMAT]

    This works very well in VLC, for example. However, Windows Media Player or Samsung TV does not play it. Windows Explorer does not even show a video thumbnail, so the video file is broken by Windows.

    Is not FFmpeg able to produce a standard MPEG4 file, or what the hell is this about ? I’ve tried all the alternatives presented, such as "-fflags +genpts", "-fflags genpts", "-movflags faststart", "-movflags +faststart", "pix_fmt=yuv420p" etc. but nothing worked.

    The sound I copied directly.