Recherche avancée

Médias (0)

Mot : - Tags -/metadatas

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

Autres articles (112)

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

  • Personnaliser les catégories

    21 juin 2013, par

    Formulaire de création d’une catégorie
    Pour ceux qui connaissent bien SPIP, une catégorie peut être assimilée à une rubrique.
    Dans le cas d’un document de type catégorie, les champs proposés par défaut sont : Texte
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire.
    Dans le cas d’un document de type média, les champs non affichés par défaut sont : Descriptif rapide
    Par ailleurs, c’est dans cette partie configuration qu’on peut indiquer le (...)

  • 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

Sur d’autres sites (10829)

  • ffmpeg how to encode first then use it for another output

    10 août 2017, par mahdi gh

    I’m trying to capture screen with gdigrab and combine int with a sound and then send it on my decklink sdi device.

    here is my code to capture :

    ffmpeg -framerate 25 -thread_queue_size 512 -f gdigrab -i title="Play" -f dshow -i audio="CABLE Output (VB-Audio Virtual Cable)" -af aresample=resampler=soxr -ar 48000 -acodec pcm_s16le -ac 2 -c:v libx264 -qp 0 -preset ultrafast "output.avi"

    here is my code for output to ffmpeg :

    ffmpeg -i output.avi -f decklink -pix_fmt uyvy422 "DeckLink SDI (2)"

    this way it works, but when I combine these two arguments to send the output to decklink card on the fly, ffmpeg stops working. here is the combination code :

    ffmpeg -framerate 25 -thread_queue_size 512 -f gdigrab -i title="Play" -f dshow -i audio="CABLE Output (VB-Audio Virtual Cable)" -af aresample=resampler=soxr -ar 48000 -acodec pcm_s16le -ac 2  -f decklink -pix_fmt uyvy422 "DeckLink SDI (2)"

    I have tried so many different combinations but no luck. it works only if i store it on a file then use that file as input. Is there a way to tell ffmpeg to use the result of first command as input of second command ?

    Thanks

    Update :
    Here is log report :

       ffmpeg started on 2017-08-08 at 12:26:36
    Report written to "ffmpeg-20170808-122636.log"
    Command line:
    ffmpeg -framerate 25 -thread_queue_size 512 -f gdigrab -i "title=Play" -c:v rawvideo -f dshow -i "audio=CABLE Output (VB-Audio Virtual Cable)" -af "aresample=resampler=soxr" -ar 48000 -acodec pcm_s16le -ac 2 -map 0:v:0 -map 1:a:0 -f decklink -pix_fmt uyvy422 "DeckLink SDI (2)" -report
    ffmpeg version N-71608-ga924b83 Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.9.2 (GCC)
     configuration: --enable-gpl --enable-version3 --disable-w32threads --enable-avisynth --enable-bzlib --enable-fontconfig --enable-frei0r --enable-gnutls --enable-iconv --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libdcadec --enable-libfreetype --enable-libgme --enable-libgsm --enable-libilbc --enable-libmodplug --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvo-aacenc --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-lzma --enable-decklink --enable-zlib
     libavutil      54. 23.101 / 54. 23.101
     libavcodec     56. 35.101 / 56. 35.101
     libavformat    56. 30.100 / 56. 30.100
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 14.100 /  5. 14.100
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Splitting the commandline.
    Reading option '-framerate' ... matched as AVOption 'framerate' with argument '25'.
    Reading option '-thread_queue_size' ... matched as option 'thread_queue_size' (set the maximum number of queued packets from the demuxer) with argument '512'.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'gdigrab'.
    Reading option '-i' ... matched as input file with argument 'title=Play'.
    Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'rawvideo'.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'dshow'.
    Reading option '-i' ... matched as input file with argument 'audio=CABLE Output (VB-Audio Virtual Cable)'.
    Reading option '-af' ... matched as option 'af' (set audio filters) with argument 'aresample=resampler=soxr'.
    Reading option '-ar' ... matched as option 'ar' (set audio sampling rate (in Hz)) with argument '48000'.
    Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'pcm_s16le'.
    Reading option '-ac' ... matched as option 'ac' (set number of audio channels) with argument '2'.
    Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '0:v:0'.
    Reading option '-map' ... matched as option 'map' (set input stream mapping) with argument '1:a:0'.
    Reading option '-f' ... matched as option 'f' (force format) with argument 'decklink'.
    Reading option '-pix_fmt' ... matched as option 'pix_fmt' (set pixel format) with argument 'uyvy422'.
    Reading option 'DeckLink SDI (2)' ... matched as output file.
    Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'.
    Finished splitting the commandline.
    Parsing a group of options: global .
    Applying option report (generate a report) with argument 1.
    Successfully parsed a group of options.
    Parsing a group of options: input file title=Play.
    Applying option thread_queue_size (set the maximum number of queued packets from the demuxer) with argument 512.
    Applying option f (force format) with argument gdigrab.
    Successfully parsed a group of options.
    Opening an input file: title=Play.
    [gdigrab @ 0000000002d3f2a0] Found window Play, capturing 720x576x32 at (0,0)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (588,602) -> (-271,597)
    [gdigrab @ 0000000002d3f2a0] All info found
    Input #0, gdigrab, from 'title=Play':
     Duration: N/A, start: 1502178996.958615, bitrate: 331786 kb/s
       Stream #0:0, 1, 1/1000000: Video: bmp, bgra, 720x576, 331786 kb/s, 25 tbr, 1000k tbn, 25 tbc
    Successfully opened the file.
    Parsing a group of options: input file audio=CABLE Output (VB-Audio Virtual Cable).
    Applying option c:v (codec name) with argument rawvideo.
    Applying option f (force format) with argument dshow.
    Successfully parsed a group of options.
    Opening an input file: audio=CABLE Output (VB-Audio Virtual Cable).
    [dshow @ 0000000002d3c340] Selecting pin Capture on audio only
    dshow passing through packet of type audio size  88200 timestamp 111632750000 orig timestamp 111632750000
    [dshow @ 0000000002d3c340] All info found
    Guessed Channel Layout for  Input Stream #1.0 : stereo
    Input #1, dshow, from 'audio=CABLE Output (VB-Audio Virtual Cable)':
     Duration: N/A, start: 11163.275000, bitrate: 1411 kb/s
       Stream #1:0, 1, 1/10000000: Audio: pcm_s16le, 44100 Hz, 2 channels, s16, 1411 kb/s
    Successfully opened the file.
    Parsing a group of options: output file DeckLink SDI (2).
    Applying option af (set audio filters) with argument aresample=resampler=soxr.
    Applying option ar (set audio sampling rate (in Hz)) with argument 48000.
    Applying option acodec (force audio codec ('copy' to copy stream)) with argument pcm_s16le.
    Applying option ac (set number of audio channels) with argument 2.
    Applying option map (set input stream mapping) with argument 0:v:0.
    Applying option map (set input stream mapping) with argument 1:a:0.
    Applying option f (force format) with argument decklink.
    Applying option pix_fmt (set pixel format) with argument uyvy422.
    Successfully parsed a group of options.
    Opening an output file: DeckLink SDI (2).
    Successfully opened the file.
    detected 2 logical cores
    [graph 0 input from stream 0:0 @ 0000000002dd7ea0] Setting 'video_size' to value '720x576'
    [graph 0 input from stream 0:0 @ 0000000002dd7ea0] Setting 'pix_fmt' to value '30'
    [graph 0 input from stream 0:0 @ 0000000002dd7ea0] Setting 'time_base' to value '1/1000000'
    [graph 0 input from stream 0:0 @ 0000000002dd7ea0] Setting 'pixel_aspect' to value '0/1'
    [graph 0 input from stream 0:0 @ 0000000002dd7ea0] Setting 'sws_param' to value 'flags=2'
    [graph 0 input from stream 0:0 @ 0000000002dd7ea0] Setting 'frame_rate' to value '25/1'
    [graph 0 input from stream 0:0 @ 0000000002dd7ea0] w:720 h:576 pixfmt:bgra tb:1/1000000 fr:25/1 sar:0/1 sws_param:flags=2
    [format @ 0000000002d3df00] compat: called with args=[uyvy422]
    [format @ 0000000002d3df00] Setting 'pix_fmts' to value 'uyvy422'
    [auto-inserted scaler 0 @ 0000000002d44ca0] Setting 'flags' to value '0x4'
    [auto-inserted scaler 0 @ 0000000002d44ca0] w:iw h:ih flags:'0x4' interl:0
    [format @ 0000000002d3df00] auto-inserting filter 'auto-inserted scaler 0' between the filter 'Parsed_null_0' and the filter 'format'
    [AVFilterGraph @ 0000000002e586c0] query_formats: 4 queried, 2 merged, 1 already done, 0 delayed
    [auto-inserted scaler 0 @ 0000000002d44ca0] w:720 h:576 fmt:bgra sar:0/1 -> w:720 h:576 fmt:uyvy422 sar:0/1 flags:0x4
    [Parsed_aresample_0 @ 0000000002d513a0] Setting 'resampler' to value 'soxr'
    [graph 1 input from stream 1:0 @ 0000000002d51460] Setting 'time_base' to value '1/44100'
    [graph 1 input from stream 1:0 @ 0000000002d51460] Setting 'sample_rate' to value '44100'
    [graph 1 input from stream 1:0 @ 0000000002d51460] Setting 'sample_fmt' to value 's16'
    [graph 1 input from stream 1:0 @ 0000000002d51460] Setting 'channel_layout' to value '0x3'
    [graph 1 input from stream 1:0 @ 0000000002d51460] tb:1/44100 samplefmt:s16 samplerate:44100 chlayout:0x3
    [audio format for output stream 0:1 @ 0000000002d51520] Setting 'sample_fmts' to value 's16'
    [audio format for output stream 0:1 @ 0000000002d51520] Setting 'sample_rates' to value '48000'
    [audio format for output stream 0:1 @ 0000000002d51520] Setting 'channel_layouts' to value '0x3'
    [AVFilterGraph @ 0000000002d4d0c0] query_formats: 4 queried, 9 merged, 0 already done, 0 delayed
    [Parsed_aresample_0 @ 0000000002d513a0] ch:2 chl:stereo fmt:s16 r:44100Hz -> ch:2 chl:stereo fmt:s16 r:48000Hz
    dshow passing through packet of type audio size  88200 timestamp 111637810000 orig timestamp 111637810000
    [decklink @ 0000000002dd6a00] Found Decklink mode 720 x 576 with rate 25.00(i)
    Output #0, decklink, to 'DeckLink SDI (2)':
     Metadata:
       encoder         : Lavf56.30.100
       Stream #0:0, 0, 1/25: Video: rawvideo (UYVY / 0x59565955), uyvy422, 720x576, q=2-31, 200 kb/s, 25 fps, 25 tbn, 25 tbc
       Metadata:
         encoder         : Lavc56.35.101 rawvideo
       Stream #0:1, 0, 1/48000: Audio: pcm_s16le, 48000 Hz, stereo, s16, 1536 kb/s
       Metadata:
         encoder         : Lavc56.35.101 pcm_s16le
    Stream mapping:
     Stream #0:0 -> #0:0 (bmp (native) -> rawvideo (native))
     Stream #1:0 -> #0:1 (pcm_s16le (native) -> pcm_s16le (native))
    Press [q] to stop, [?] for help
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    Cliping frame in rate conversion by 0.000008
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Encoder did not produce proper pts, making some up.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    *** 40 dup!
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Buffered video frames: 1.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Buffered video frames: 2.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Buffered video frames: 3.
    [decklink @ 0000000002dd6a00] Buffered video frames: 4.
    [decklink @ 0000000002dd6a00] Buffered video frames: 5.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Buffered video frames: 6.
    [decklink @ 0000000002dd6a00] Buffered video frames: 7.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Buffered video frames: 8.
    [decklink @ 0000000002dd6a00] Buffered video frames: 9.
    [decklink @ 0000000002dd6a00] Buffered video frames: 10.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Buffered video frames: 11.
    [decklink @ 0000000002dd6a00] Buffered video frames: 12.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Buffered video frames: 13.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    dshow passing through packet of type audio size  88200 timestamp 111642810000 orig timestamp 111642810000
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Buffered video frames: 14.
    [decklink @ 0000000002dd6a00] Ending audio preroll.
    [decklink @ 0000000002dd6a00] Starting scheduled playback.
    [decklink @ 0000000002dd6a00] Buffered video frames: 15.
    [decklink @ 0000000002dd6a00] Buffered video frames: 16.
    [decklink @ 0000000002dd6a00] Buffered video frames: 17.
    [decklink @ 0000000002dd6a00] Buffered video frames: 18.
    [decklink @ 0000000002dd6a00] Buffered video frames: 19.
    [decklink @ 0000000002dd6a00] Buffered video frames: 20.
    [decklink @ 0000000002dd6a00] Buffered video frames: 21.
    [decklink @ 0000000002dd6a00] Buffered video frames: 22.
    [decklink @ 0000000002dd6a00] Buffered video frames: 23.
    [decklink @ 0000000002dd6a00] Buffered video frames: 24.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [decklink @ 0000000002dd6a00] Buffered video frames: 24.
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    frame=   42 fps=0.0 q=0.0 size=N/A time=00:00:01.68 bitrate=N/A dup=40 drop=0    
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    dshow passing through packet of type audio size  88200 timestamp 111647710000 orig timestamp 111647710000
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (689,472) -> (-170,467)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (814,496) -> (-45,491)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (814,496) -> (-45,491)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (811,497) -> (-48,492)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (811,497) -> (-48,492)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (811,497) -> (-48,492)
    [gdigrab @ 0000000002d3f2a0] Cursor pos (806,497) -> (-53,492)
  • where to put the watermark png file in this code ?

    15 août 2017, par asif

    this is a line from ffmpeg video converter php script ;

    $ffmpeg." -i ".$video_to_convert." -vcodec flv -f flv -r 30 -b ".$quality."-ab 128000 -ar".$audio." -s ".$size." ".$converted_vids.$name.".".$new_format."

    where :

    .$video_to_convert. = input file

    .$converted_vids.$name. = output file

    .$new_format. ; = file extention format

    now i want to add watermark.png file, if i put any where i got error conversion
    as i added the line logo.png -filter_complex 'overlay in video quality line, i got error

    Error ;

    ffmpeg version N-71954-gbc6f84f Copyright (c) 2000-2015 the FFmpeg developers
     built with gcc 4.4.7 (GCC) 20120313 (Red Hat 4.4.7-16)
     configuration: --prefix=/usr --enable-version3 --enable-gpl --enable-shared --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libvpx --enable-libx264 --enable-libxvid --enable-libopencore-amrwb --enable-libopencore-amrnb --enable-postproc --enable-nonfree --enable-pthreads --enable-x11grab --enable-libfaac --enable-libopenjpeg --enable-zlib --disable-doc
     libavutil      54. 23.101 / 54. 23.101
     libavcodec     56. 37.101 / 56. 37.101
     libavformat    56. 31.102 / 56. 31.102
     libavdevice    56.  4.100 / 56.  4.100
     libavfilter     5. 16.101 /  5. 16.101
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'uploaded/1502801111_21.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.31.102
     Duration: 00:02:27.32, start: 0.023220, bitrate: 635 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 480x320 [SAR 1:1 DAR 3:2], 476 kb/s, 25 fps, 25 tbr, 12800 tbn, 50 tbc (default)
       Metadata:
         handler_name    : VideoHandler
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 151 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Please use -b:a or -b:v, -b is ambiguous
    Cannot find a matching stream for unlabeled input pad 1 on filter Parsed_overlay_0

    This is index.php file scipt of conversion :

       v<?php include("templates/header.php");?>

    <div>



    &lt;?php

    require_once('languages/en.php');
    include ("includes/settings.php");
    include("includes/functions.php");
    include("includes/LIB_parse.php");
    include("classes/other.php");
    cron(); // to run cron job to delete all files
    if(isset($_POST['uploader_0_name']) or isset ($_GET['uploaded_name']))
       {
       if(isset($_POST['uploader_0_name']))
       {
    list($_SESSION['original_name'], $ext) = explode('.',$_POST['uploader_0_name']);
    }else{
    $fullname=$_GET['uploaded_name'];
    }
    if(isset($_POST['uploader_0_name']))
       {
    list($_SESSION['original_name'], $ext) = explode('.',$_POST['uploader_0_name']);
    }else{
    list($_SESSION['original_name'], $ext) = explode('.',$_GET['uploaded_name']);
    $_SESSION['original_name']= return_between($_GET['uploaded_name'], '_', "$ext", 'EXCL') ;
    $_SESSION['original_name']= str_replace(".","",$_SESSION['original_name']);
    }
    if(isset($_POST['uploader_0_name']))
       {  
    $fullname=  $_POST['uploader_0_tmpname'];
    }else{
    $fullname=$_GET['uploaded_name'];
    }
    $ext= pathinfo($fullname, PATHINFO_EXTENSION);
    $_SESSION['name']=RemoveExtension($fullname);
    $store_dir="uploaded/";
    $_SESSION['converted_vids']=$converted_vids;
    $_SESSION['temp_dir']=$store_dir;
    // if those directotires don't exist - create them and give them read/write permissions
    if(!is_dir($store_dir)) mkdir($store_dir, 0777);
    if(!is_dir($converted_vids)) mkdir($converted_vids, 0777);
    $extension = substr($fullname, strrpos($fullname, "."));
    $extension = strtolower($extension);
    $video_to_convert=$store_dir.$_SESSION['name'];
    $_SESSION['video_to_convert']=$video_to_convert;
    $_SESSION['extension']=$extension;
    /*******************************
    check extenxions
    ***************************************************/    
                     if (!in_array($ext, $allowedExtensions))
                     {
                       echo '<div style="text-align:center"><strong>'.$ext."</strong><br /> is an invalid file type!<br />Supported files are:<br /><strong>";
                       foreach ($allowedExtensions as $value) { echo $value . "<br />"; }
                       echo "</strong><br />";
           echo "<a href="http://stackoverflow.com/feeds/tag/\&#034;index.php\&#034;">"."<img src="http://stackoverflow.com/feeds/tag/\&#034;images/red-back.png\&#034;" border="\&quot;0\&quot;" style='max-width: 300px; max-height: 300px' /></a></div>";
            include("templates/footer.php");
                          exit;
                     }


               ?>

               <center>
    <form action="index.php" method="post" target="_self">
                   <br />
                                   <fieldset>
                               <legend class="show_legend">Convert To</legend>

                   <div class="radio_buttons">
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/flv.jpg" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" class="blue_font" value="flv" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/mp4.jpg" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="mp4" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/wmv.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="wmv" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/avi.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="avi" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/mp3.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="mp3" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/ogg.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="ogg" />
                   <img alt="" src="http://stackoverflow.com/feeds/tag/images/webm.png" class="format_button" style='max-width: 300px; max-height: 300px' />
                   <input type="radio" value="webm" />
                   </div>
                   </fieldset>
                       <fieldset>
                               <legend class="show_legend">Optional settings</legend>

                   <div class="radio_buttons" style="display:inline;padding:10px">
                   <br />Video quality:
                   <select class="radio_buttons" disabled="disabled">
                     <option value="2000000">high</option>
                     <option value="logo.png -filter_complex 'overlay' ">medium</option>

                     <option value="-i seen.png \-filter_complex '[0:v][1:v]overlay=10:10:enable=between(t\,15\,25)' -c:v libx264 -pix_fmt yuv420p -movflags faststart">Seen</option>
                     <option value="-i logo2.png \-filter_complex '[0:v][1:v]overlay=10:10:enable=between(t\,10\,20)'">HD Watermark</option>
                     <option value="-i logo.png -filter_complex 'overlay'">Watermark</option>
                     <option value="-vf drawtext='fontsize=20:y=h-line_h-10:x=(2*n)-tw:fontfile='op.ttf':text='DesiBombs.com'' -c:v libx264 -pix_fmt yuv420p -movflags faststart">Watermark</option>
                   </select>
                   </div>

                   <div class="radio_buttons" style="display:inline;padding:10px">Audio quality:
                   <select class="radio_buttons" disabled="disabled">
                     <option value="44100">high</option>
                     <option value="22050">medium</option>
                     <option value="11025">low</option>
                   </select>




                   <div class="radio_buttons" style="display:inline;padding:10px">Video size:
                   <select class="radio_buttons" disabled="disabled">
                     <option value="320x240">320x240</option>
                     <option value="512x384" selected="selected">512x384</option>
                     <option value="640x360">640x360</option>
                     <option value="854x480">854x480</option>
                     <option value="1280x720">1280x720</option>
                   </select>
                   </div>

                   </div></fieldset>
                   <div class="radio_buttons">


                      <input type="submit" disabled="disabled" value="" style="display:none" />
                   </div>
     

     </form></center>
    &lt;?php
       }
       elseif(isset($_POST['type']))
           {


           $new_format=htmlspecialchars($_POST['type']); // read output format from form
           $name=$_SESSION['name'];
           //$_SESSION['extension'];
           $video_to_convert=$store_dir.$_SESSION['name'].$_SESSION['extension'];


           if (isset($_POST['size'])) {$size=$_POST['size'];}
           if (isset($_POST['quality'])) {$quality=$_POST['quality'];}
           if (isset($_POST['audio'])) {$audio=$_POST['audio'];}

           if($new_format=="webm" &amp;&amp; $audio=="11025"){$audio="22050";$new_format="webm"; }// for webm  and ogg audio can not be 11050
           if($new_format=="ogg" &amp;&amp; $audio=="11025"){$audio="22050"; $new_format="ogg"; }// for webm  and ogg audio can not be 11050

           $_SESSION['type']=$new_format;


           if($new_format=="flv"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec flv -f flv -r 30 -b ".$quality."-ab 128000 -ar".$audio." -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}


       if($new_format=="avi"){ $call=$ffmpeg." -i ".$video_to_convert."  -vcodec mjpeg -f avi -acodec libmp3lame -b ".$quality." -s ".$size." -r 30 -g 12 -qmin 3 -qmax 13 -ab 224 -ar ".$audio." -ac 2 ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="mp3"){ $call=$ffmpeg." -i ".$video_to_convert." -vn -acodec libmp3lame -ac 2 -ab 128000 -ar ".$audio."  ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="mp4"){ $call=$ffmpeg." -i ".$video_to_convert." -vf logo.png -vcodec mpeg4 -r 30 -b ".$quality." -acodec libmp3lame -ab 126000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="wmv"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec wmv1 -r 30 -b ".$quality." -acodec wmav2 -ab 128000 -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="ogg"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec libtheora -r 30 -b ".$quality." -acodec libvorbis -ab 128000   -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}

       if($new_format=="webm"){ $call=$ffmpeg." -i ".$video_to_convert." -vcodec libvpx  -r 30 -b ".$quality." -acodec libvorbis -ab 128000   -ar ".$audio." -ac 2 -s ".$size." ".$converted_vids.$name.".".$new_format." -y 2> log/".$name.".txt";}


    /* START CONVERTING The Video */

       require_once("includes/ffmpeg_cmd.php");

       $convert = (popen($convert_call, "r"));

       pclose($convert);
       flush();    
    // define sessions


       $_SESSION['dest_file']=$converted_vids.$name.".".$new_format;

        echo "<code class="echappe-js">&lt;script&gt;\n&quot;;<br />
        echo &quot;counter = 5\n&quot;;<br />
         echo &quot;var redirect = 0; \n&quot;;<br />
         echo &quot;$(document).ready(function()\n&quot;;<br />
     echo &quot;{\n&quot;;<br />
       echo &quot;var refreshId = setInterval(function() \n&quot;;<br />
        echo &quot;{\n&quot;;<br />
        echo &quot;if(redirect == 0) \n { \n&quot;;<br />
        echo &quot;$('#timeval').load('progress_bar.php');\n&quot;;<br />
        echo &quot;}\n&quot;;<br />
        echo &quot;else \n&quot;;<br />
        echo &quot;{\n&quot;;<br />
        echo &quot;$('#timeval').load('progress_bar.php?counter='+ counter--);\n&quot;;<br />
        echo &quot;}\n&quot;;<br />
        echo &quot;}, 1000);\n&quot;;<br />
       echo &quot;});\n&quot;;   <br />
       echo &quot;&lt;/script&gt;

    \n" ;

    //
    /************************* for debug *************************************
    echo "

    " ;
        print_r ($_SESSION) ;
        echo "
    " ;
        **********************************************************************************/
    

     ?>

    wait please

    < ?php

    else if(isset($_GET[’finished’]))

    echo "

    " ; if(!isset($_SESSION[’name’])) echo "please convert new video" ;include("templates/footer.php") ; ;exit ; $filepath=$converted_vids."./".$_SESSION[’name’].".".$_SESSION[’type’] ;

    echo " " ;

    require_once"video_duration.php" ;

    $_SESSION[’duration’]=$hours." :".$minutes." :".$seconds ;

    $vid_name=$_SESSION[’name’] ;
    $vid_src=$_SESSION[’extension’] ;
    $vid_new=$_SESSION[’type’] ;
    if (isset($_SESSION[’duration’])) $duration=$_SESSION[’duration’] ;else $duration="unknown" ;
    if(file_exists($converted_vids.$vid_name.".".$vid_new))

    $vid_size=get_size($converted_vids.$vid_name.".".$vid_new) ;
    else $vid_size=0 ;

     ?>

    your video information
    Video duration < ?php echo $hours." :".$minutes." :".$seconds ; ?>
    original video name < ?php if(isset($_SESSION[’original_name’]))echo $_SESSION[’original_name’] ; ?>
    video size < ?php echo $vid_size." MB
    " ; ?>
    source extension < ?php echo str_replace(".","","$vid_src") ; ?>
    new extension < ?php echo $vid_new ; ?>

    < ?php

    echo "

    " ;

    session_unset() ;

    else

     ?>

    &lt;script type=&quot;text/javascript&quot;&gt;<br />
    // Convert divs to queue widgets when the DOM is ready<br />
    $(function() {<br />
       $(&quot;#uploader&quot;).pluploadQueue({<br />
           // General settings<br />
           runtimes : 'flash',<br />
           url : 'upload.php',<br />
           max_file_size : '&amp;lt;?php echo $max_file_size ;?&gt;mb',<br />
           chunk_size : '1mb',<br />
           unique_names : true,<br />
    <br />
           // Resize images on clientside if we can<br />
           resize : {width : 320, height : 240, quality : 90},<br />
    init : {<br />
                 FilesAdded: function(up, files) {<br />
                   plupload.each(files, function(file) {<br />
                     if (up.files.length &gt; 1) {<br />
                       up.removeFile(file);<br />
                     }<br />
                   });<br />
                   if (up.files.length &gt;= 1) {<br />
                     $('#pickfiles').hide('slow');<br />
                   }<br />
                 },<br />
                 FilesRemoved: function(up, files) {<br />
                   if (up.files.length &lt; 1) {<br />
                     $('#pickfiles').fadeIn('slow');<br />
                   }<br />
                 }<br />
               },<br />
               multi_selection: false,<br />
           // Specify what files to browse for<br />
           filters : [<br />
               {title : &quot;Video files&quot;, extensions : &quot;&amp;lt;?php foreach ($allowedExtensions as $value) { echo $value . &quot;,&quot;; }?&gt;&quot;}<br />
    <br />
           ],<br />
    <br />
           // Flash settings<br />
           flash_swf_url : 'js/plupload.flash.swf',<br />
    <br />
           // Silverlight settings<br />
           silverlight_xap_url : 'js/plupload.silverlight.xap'<br />
       });<br />
    <br />
       // Client side form validation<br />
       $('form').submit(function(e) {<br />
           var uploader = $('#uploader').pluploadQueue();<br />
    <br />
           // Files in queue upload them first<br />
           if (uploader.files.length &gt; 0) {<br />
               // When all files are uploaded submit form<br />
               uploader.bind('StateChanged', function() {<br />
                   if (uploader.files.length === (uploader.total.uploaded + uploader.total.failed)) {<br />
                       $('form')[0].submit();<br />
                   }<br />
               });<br />
    <br />
               uploader.start();<br />
           } else {<br />
               alert('You must queue at least one video.');<br />
           }<br />
    <br />
           return false;<br />
       });<br />
    });<br />
    &lt;/script&gt;

    You browser doesn’t have Flash, Silverlight, Gears, BrowserPlus or HTML5 support.

    Maximum upload size < ?php echo $max_file_size ; ?> MB

    < ?php include("templates/info.php") ; ?>
    < ?php

    //End Body Area/

     ?>

  • Ffmpeg/Fluent-Ffmpeg : Output file #0 does not contain any stream

    16 août 2017, par Code Sherpa

    Use Case

    When a user records an audio file and uploads to firebase storage, run a trigger that crops a clip of that file and saves it to a "preview" directory.

    Problem

    Getting Output file #0 does not contain any stream after static .AAC file is downloaded to temp directory and ffmpeg command is run.

    Environment

    • mac client / firebase storage
    • node v8.1.0
    • ffmpeg v3.2.2
    • fluent-ffmpeg v2.1.2

    Node Code

     var command = new ffmpeg({ source: tempFilePath, timeout: 0 })
         .setFfmpegPath(ffmpegPath)
         .setFfprobePath(ffprobePath)
         .inputOption('-t', '10')
         .inputOption('-ss', '10')
         .outputOption('-acodec', 'copy')
         .on('start', function(commandLine) {
               console.log('Spawned Ffmpeg with command: ', commandLine);
          })
         .on('end', function() {
             console.log('Preview file cropping done successfully');
          })
         .on('error', function(err, stdout, stderr) {
             var build = err;
             if (!stdout === '') { build = build + '\n' + stdout; }
             build = build + '\n' + stderr;

             console.log(build);
          }).save(tempFilePath);

    Ffmpeg Command

    Spawned Ffmpeg with command : ffmpeg -t 10 -ss 10 -i
    /tmp/2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac -y -acodec
    copy /tmp/2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac

    Debug Output From Firebase

    Error : ffmpeg exited with code 1 : Output #0, adts, to
    ’/tmp/2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac’ : Output
    file #0 does not contain any stream

    ffmpeg version 3.2.2-static http://johnvansickle.com/ffmpeg/
    Copyright (c) 2000-2016 the FFmpeg developers built with gcc 5.4.1
    (Debian 5.4.1-4) 20161202 configuration : —enable-gpl
    —enable-version3 —enable-static —disable-debug —disable-ffplay —disable-indev=sndio —disable-outdev=sndio —cc=gcc-5 —enable-fontconfig —enable-frei0r —enable-gnutls —enable-gray —enable-libass —enable-libfreetype —enable-libfribidi —enable-libmp3lame —enable-libopencore-amrnb —enable-libopencore-amrwb —enable-libopenjpeg —enable-libopus —enable-librtmp —enable-libsoxr —enable-libspeex —enable-libtheora —enable-libvidstab —enable-libvo-amrwbenc —enable-libvorbis —enable-libvpx —enable-libwebp —enable-libx264 —enable-libx265 —enable-libxvid —enable-libzimg libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.100 / 57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 /
    4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 [aac @ 0x3a00e60] Format aac detected only with low score of 1, misdetection possible ! [aac @ 0x3a00e60] Could
    not find codec parameters for stream 0 (Audio : aac, 0 channels, fltp) :
    unspecified sample rate Consider increasing the value for the
    ’analyzeduration’ and ’probesize’ options
    /tmp/2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac : could not
    seek to position 10.000 Input #0, aac, from
    ’/tmp/2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac’ :
    Duration : N/A, bitrate : N/A
    Stream #0:0 : Audio : aac, 0 channels, fltp Output #0, adts, to ’/tmp/2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac’ : Output
    file #0 does not contain any stream

    Console Output

    | $ ffmpeg -t 10 -ss 10 -i 2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac -y -acodec aac
    output_file.aac

    ffmpeg version 3.2.2 Copyright (c) 2000-2016 the
    FFmpeg developers built with llvm-gcc 4.2.1 (LLVM build 2336.11.00)
    configuration : —prefix=/Volumes/Ramdisk/sw —enable-gpl
    —enable-pthreads —enable-version3 —enable-libspeex —enable-libvpx —disable-decoder=libvpx —enable-libmp3lame —enable-libtheora —enable-libvorbis —enable-libx264 —enable-avfilter —enable-libopencore_amrwb —enable-libopencore_amrnb —enable-filters —enable-libgsm —enable-libvidstab —enable-libx265 —disable-doc —arch=x86_64 —enable-runtime-cpudetect libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.100 / 57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 /
    4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 [aac @ 0x7fac6c800a00] Estimating duration from bitrate, this may be inaccurate Input #0, aac, from
    ’2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac’ : Duration :
    00:01:07.71, bitrate : 223 kb/s
    Stream #0:0 : Audio : aac (LC), 44100 Hz, stereo, fltp, 277 kb/s Output #0, adts, to ’output_file.aac’ : Metadata :
    encoder : Lavf57.56.100
    Stream #0:0 : Audio : aac (LC), 44100 Hz, stereo, fltp, 128 kb/s
    Metadata :
    encoder : Lavc57.64.101 aac Stream mapping : Stream #0:0 -> #0:0 (aac (native) -> aac (native)) Press [q] to stop, [?] for help size= 159kB time=00:00:10.00 bitrate= 130.5kbits/s
    speed=12.7x video:0kB audio:156kB subtitle:0kB other streams:0kB
    global headers:0kB muxing overhead : 1.887004% [aac @ 0x7fac6d004600]
    Qavg : 383.548

    Origin File Format

    $ ffprobe -show_format
    2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac

    ffprobe version 3.2.2 Copyright (c) 2007-2016 the FFmpeg developers
    built with llvm-gcc 4.2.1 (LLVM build 2336.11.00) configuration :
    —prefix=/Volumes/Ramdisk/sw —enable-gpl —enable-pthreads —enable-version3 —enable-libspeex —enable-libvpx —disable-decoder=libvpx —enable-libmp3lame —enable-libtheora —enable-libvorbis —enable-libx264 —enable-avfilter —enable-libopencore_amrwb —enable-libopencore_amrnb —enable-filters —enable-libgsm —enable-libvidstab —enable-libx265 —disable-doc —arch=x86_64 —enable-runtime-cpudetect libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.100 / 57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 /
    4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 / 54. 1.100 [aac @ 0x7fefbd001400] Estimating duration from bitrate, this may be inaccurate Input #0, aac, from
    ’2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac’ : Duration :
    00:01:07.71, bitrate : 223 kb/s
    Stream #0:0 : Audio : aac (LC), 44100 Hz, stereo, fltp, 223 kb/s [FORMAT]
    filename=2EB100B0-6C1E-4D51-9087-764CA653AFC720170711232034.aac
    nb_streams=1 nb_programs=0 format_name=aac format_long_name=raw ADTS
    AAC (Advanced Audio Coding) start_time=N/A duration=67.706333
    size=1892392 bit_rate=223599 probe_score=51 [/FORMAT]

    Output File Format

    $ ffprobe -show_format output_file.aac ffprobe version 3.2.2 Copyright
    (c) 2007-2016 the FFmpeg developers built with llvm-gcc 4.2.1 (LLVM
    build 2336.11.00) configuration : —prefix=/Volumes/Ramdisk/sw
    —enable-gpl —enable-pthreads —enable-version3 —enable-libspeex —enable-libvpx —disable-decoder=libvpx —enable-libmp3lame —enable-libtheora —enable-libvorbis —enable-libx264 —enable-avfilter —enable-libopencore_amrwb —enable-libopencore_amrnb —enable-filters —enable-libgsm —enable-libvidstab —enable-libx265 —disable-doc —arch=x86_64 —enable-runtime-cpudetect libavutil 55. 34.100 / 55. 34.100 libavcodec 57. 64.101 / 57. 64.101 libavformat 57. 56.100 /
    57. 56.100 libavdevice 57. 1.100 / 57. 1.100 libavfilter 6. 65.100 / 6. 65.100 libswscale 4. 2.100 / 4. 2.100 libswresample 2. 3.100 / 2. 3.100 libpostproc 54. 1.100 /
    54. 1.100 [aac @ 0x7fa904802a00] Estimating duration from bitrate, this may be inaccurate Input #0, aac, from ’output_file.aac’ :
    Duration : 00:00:09.45, bitrate : 138 kb/s
    Stream #0:0 : Audio : aac (LC), 44100 Hz, stereo, fltp, 138 kb/s [FORMAT] filename=output_file.aac nb_streams=1 nb_programs=0
    format_name=aac format_long_name=raw ADTS AAC (Advanced Audio Coding)
    start_time=N/A duration=9.454635 size=163278 bit_rate=138156
    probe_score=51 [/FORMAT]

    Comments & Observations

    • I am able to run the ffmpeg command (provided above) locally and get the results I want.

    • The origin file is AAC. I have verified that it is, indeed, an AAC file and not a different file type masquerading as an AAC.

    • The output file format appears as audio/x-aac in firebase. I would expect it to be the same as the origin file - audio/aac.

  • Boussole SPIP

    SPIP.net-La documentation officielle et téléchargement de (...) SPIP Code-La documentation du code de SPIP Programmer SPIP-La documentation pour développer avec (...) Traduire SPIP-Espace de traduction de SPIP et de ses (...) Plugins SPIP-L'annuaire des plugins SPIP SPIP-Contrib-L'espace des contributions à SPIP Forge SPIP-L'espace de développement de SPIP et de ses (...) Discuter sur SPIP-Les nouveaux forums de la communauté (...) SPIP Party-L'agenda des apéros et autres rencontres (...) Médias SPIP-La médiathèque de SPIP SPIP Syntaxe-Tester l'édition de texte dans SPIP