Recherche avancée

Médias (17)

Mot : - Tags -/wired

Autres articles (35)

  • De l’upload à la vidéo finale [version standalone]

    31 janvier 2010, par

    Le chemin d’un document audio ou vidéo dans SPIPMotion est divisé en trois étapes distinctes.
    Upload et récupération d’informations de la vidéo source
    Dans un premier temps, il est nécessaire de créer un article SPIP et de lui joindre le document vidéo "source".
    Au moment où ce document est joint à l’article, deux actions supplémentaires au comportement normal sont exécutées : La récupération des informations techniques des flux audio et video du fichier ; La génération d’une vignette : extraction d’une (...)

  • HTML5 audio and video support

    13 avril 2011, par

    MediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
    The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
    For older browsers the Flowplayer flash fallback is used.
    MediaSPIP allows for media playback on major mobile platforms with the above (...)

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

  • Adding audio to video without re encoding [migrated]

    4 mars 2015, par user1503606

    I am looking to add audio to a video without having to re encode the two pieces.

    I have looked at a few questions on stack overflow followed the answers and i still cant seemed to get it to work, if anyone can spot what i am missing please help.

    I am running this code.

    ffmpeg -i DJ_Mes_Rescue-Some_Day-Guesthouse_Music.mp3 -i output.mp4 -map 0:0 -map 1:0 -acodec copy -vcodec copy -shortest edit2.mp4

    Now from what i understand ffmpeg is mapping the stream over the top ffmpeg info for the audio track is.

    Input #0, mp3, from 'DJ_Mes_Rescue-Some_Day-Guesthouse_Music.mp3':
     Metadata:
       encoder         : LAME 64bits version 3.98.4 (http://www.mp3dev.org/)
       title           : Some Day
       artist          : DJ Mes, Rescue
       TLEN            : 378750
       genre           : House
       track           : 1/0
       date            : 2015
     Duration: 00:06:18.80, start: 0.025056, bitrate: 320 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
       Metadata:
         encoder         : LAME3.98r
       Side data:
         replaygain: track gain - -10.100000, track peak - unknown, album gain - unknown, album peak - unknown,
       Stream #0:1: Video: png, rgb24, 225x225, 90k tbr, 90k tbn, 90k tbc
       Metadata:
         title           :
         comment         : Other

    And for the video it is.

    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.15.102
     Duration: 00:00:49.46, start: 0.046440, bitrate: 566 kb/s
       Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 568x320, 462 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
       Metadata:
         rotate          : 90
         handler_name    : VideoHandler
       Side data:
         displaymatrix: rotation of -90.00 degrees
       Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 96 kb/s (default)
       Metadata:
         handler_name    : SoundHandler

    So i am mapping the stream 0:0 from the audio file to 1:0 from the video file, but all i seem to get is a video with no audio.

    Can someone help ?

    UPDATE whole output added

    ffmpeg -i Saison-Please_Don%27t_Go-Guesthouse_Music.mp3 -i output.mp4 -c copy -map 0:0 -map 1:0 -shortest mixed.mp4
    ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
     built on Jan 12 2015 10:15:06 with Apple LLVM version 6.0 (clang-600.0.56) (based on LLVM 3.5svn)
     configuration: --prefix=/usr/local/Cellar/ffmpeg/2.5.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-hardcoded-tables --enable-avresample --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libmp3lame --enable-libxvid --enable-libfreetype --enable-libtheora --enable-libvorbis --enable-libvpx --enable-librtmp --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvo-aacenc --enable-libass --enable-ffplay --enable-libspeex --enable-libschroedinger --enable-libfdk-aac --enable-libopus --enable-frei0r --enable-libopenjpeg --disable-decoder=jpeg2000 --extra-cflags='-I/usr/local/Cellar/openjpeg/1.5.1_1/include/openjpeg-1.5 ' --enable-nonfree --enable-vda
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libavresample   2.  1.  0 /  2.  1.  0
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Input #0, mp3, from 'Saison-Please_Don%27t_Go-Guesthouse_Music.mp3':
     Metadata:
       encoder         : LAME 64bits version 3.98.4 (http://www.mp3dev.org/)
       title           : Please Donât Go
       artist          : Saison
       TLEN            : 408492
       genre           : House
       track           : 1/0
       date            : 2015
     Duration: 00:06:48.53, start: 0.025056, bitrate: 320 kb/s
       Stream #0:0: Audio: mp3, 44100 Hz, stereo, s16p, 320 kb/s
       Metadata:
         encoder         : LAME3.98r
       Side data:
         replaygain: track gain - -8.400000, track peak - unknown, album gain - unknown, album peak - unknown,
       Stream #0:1: Video: png, rgb24, 225x225, 90k tbr, 90k tbn, 90k tbc
       Metadata:
         title           :
         comment         : Other
    Input #1, mov,mp4,m4a,3gp,3g2,mj2, from 'output.mp4':
     Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.15.102
     Duration: 00:00:49.46, start: 0.046440, bitrate: 566 kb/s
       Stream #1:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 568x320, 462 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
       Metadata:
         rotate          : 90
         handler_name    : VideoHandler
       Side data:
         displaymatrix: rotation of -90.00 degrees
       Stream #1:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 96 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
    Output #0, mp4, to 'mixed.mp4':
     Metadata:
       date            : 2015
       title           : Please Donât Go
       artist          : Saison
       TLEN            : 408492
       genre           : House
       track           : 1/0
       encoder         : Lavf56.15.102
       Stream #0:0: Audio: mp3 (i[0][0][0] / 0x0069), 44100 Hz, stereo, 320 kb/s
       Metadata:
         encoder         : LAME3.98r
       Side data:
         replaygain: track gain - -8.400000, track peak - unknown, album gain - unknown, album peak - unknown,
       Stream #0:1(und): Video: h264 ([33][0][0][0] / 0x0021), yuv420p, 568x320, q=2-31, 462 kb/s, 30 fps, 15360 tbn, 15360 tbc (default)
       Metadata:
         rotate          : 90
         handler_name    : VideoHandler
       Side data:
         displaymatrix: rotation of -90.00 degrees
    Stream mapping:
     Stream #0:0 -> #0:0 (copy)
     Stream #1:0 -> #0:1 (copy)
    Press [q] to stop, [?] for help
    frame= 1481 fps=0.0 q=-1.0 Lsize=    4759kB time=00:00:49.34 bitrate= 790.0kbits/s    
    video:2785kB audio:1929kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.960839%

    ANOTHER UPDATE :

    So i have tried the following

    ffmpeg -i 3.mp4 -i Saison-Please_Don%27t_Go-Guesthouse_Music.mp3 -i Saison-Please_Don%27t_Go-Guesthouse_Music.mp3 -map 0:0 -map 0:1 -map 1:0 -map 2:0 -c:v copy -c:a copy 23.mp4

    and if i run.

    ffmpeg -i 23.mp4

    You can see the streams/audio has been added but it is not playing ?

    Metadata:
       major_brand     : isom
       minor_version   : 512
       compatible_brands: isomiso2avc1mp41
       encoder         : Lavf56.15.102
     Duration: 00:06:48.53, start: 0.025057, bitrate: 713 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 568x320, 462 kb/s, 30 fps, 30 tbr, 15360 tbn, 60 tbc (default)
       Metadata:
         rotate          : 90
         handler_name    : VideoHandler
       Side data:
         displaymatrix: rotation of -90.00 degrees
       Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 96 kb/s (default)
       Metadata:
         handler_name    : SoundHandler
       Stream #0:2(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, s16p, 319 kb/s
       Metadata:
         handler_name    : SoundHandler
       Stream #0:3(und): Audio: mp3 (mp4a / 0x6134706D), 44100 Hz, stereo, s16p, 319 kb/s
       Metadata:
         handler_name    : SoundHandler

    ONE MORE UPDATE THIS SEEMS TO WORK :

    ffmpeg -i 3.mp4 -i Saison-Please_Don%27t_Go-Guesthouse_Music.mp3 -map 0:0 -map 0:1 -map 1:0  -c:v copy -c:a copy 234.mp4 && ffmpeg -i 234.mp4 -map 0:0 -map 0:2 -acodec copy -vcodec copy new_file3.mp4
  • FFmpeg muxing to avi

    2 septembre 2015, par Uncia

    sI have program, that succefully shows h264 stream using SDL : I’m getting h264 frame, decode it using ffmpeg and draw using SDL.
    Also I can write frames to file (using fwrite) and play this file through ffplay.

    But I want to mux data to the avi and face some problems in av_write_frame.

    Here is my code :

    ...
    /*Initializing format context - outFormatContext is the member of my class*/
    AVOutputFormat *outFormat;
    outFormat = av_guess_format(NULL,"out.avi",NULL);
    outFormat->video_codec = AV_CODEC_ID_H264;
    outFormat->audio_codec = AV_CODEC_ID_NONE;
    avformat_alloc_output_context2(&outFormatContext, outFormat, NULL, "out.avi");
    AVCodec *outCodec;
    AVStream *outStream = add_stream(outFormatContext, &outCodec, outFormatContext->oformat->video_codec);
    avcodec_open2(outStream->codec, outCodec, NULL);
    av_dump_format(outFormatContext, 0, "out.avi", 1);
    if (avio_open(&outFormatContext->pb, "out.avi", AVIO_FLAG_WRITE) < 0)
       throw Exception("Couldn't open file");
    if (avformat_write_header(outFormatContext, NULL) < 0)
       throw Exception("Couldn't write to file");
    //I don't have exceptions here - so there is 6KB header in out.avi.
    ...

    static AVStream *add_stream(AVFormatContext *oc, AVCodec **codec,
                           enum AVCodecID codec_id)
    {
    AVCodecContext *c;
    AVStream *st;
    /* find the encoder */
    *codec = avcodec_find_encoder(codec_id);
    if (!(*codec))
       throw("Could not find encoder");
    st = avformat_new_stream(oc, *codec);
    if (!st)
       throw ("Could not allocate stream");
    st->id = oc->nb_streams-1;
    c = st->codec;
    c->bit_rate = 400000;
    /* Resolution must be a multiple of two. */
    c->width    = 1920;
    c->height   = 1080;
    c->pix_fmt  = PIX_FMT_YUV420P;
    c->flags = 0;
    c->time_base.num = 1;
    c->time_base.den = 25;
    c->gop_size      = 12; /* emit one intra frame every twelve frames at most */
    return st;
    }
    ...
    /* Part of decoding loop. There is AVPacket packet - h264 packet;
    int ret = av_write_frame(outFormatContext, &packet); //it return -22 code - Invadlid argument;
    if (avcodec_decode_video2(pCodecCtx, pFrame, &frameDecoded, &packet) < 0)
       return;
    if (frameDecoded)
    {
      //SDL stuff
    }

    Also i tried to use avcodec_encode_video2 (encode pFrame back to the H264) next to the SDL stuff but encoding is not working - i’ve got empty packets :( It is the second problem.

    Using av_interleaved_write_frame causes acces violation.

    Code of the muxing part i copied from ffmpeg muxing example (https://www.ffmpeg.org/doxygen/2.1/doc_2examples_2muxing_8c-example.html)

  • Use ffmpeg to stream live content to azure media services

    9 juin 2016, par Dadicool

    I’ve been trying to stream content to azure media services using ffmpeg as it’s one of the options described here : http://azure.microsoft.com/blog/2014/09/18/azure-media-services-rtmp-support-and-live-encoders/

    My command is :

    ffmpeg -v verbose -i 300.mp4 -strict -2 -c:a aac -b:a 128k -ar 44100 -r 30 -g 60 -keyint_min 60 -b:v 400000 -c:v libx264 -preset medium -bufsize 400k -maxrate 400k -f flv rtmp://nessma-****.channel.mediaservices.windows.net:1935/live/584c99f5c47f424d9e83ac95364331e7

    I have made sure that the streaming endpoint has one active streaming unit, I also made sure that the channel is actually Ready and I even get it to start streaming (which makes a PublishURL available).

    When I execute the ffmpeg command to start streaming, I keep getting the following error :

    ffmpeg version 2.5.2 Copyright (c) 2000-2014 the FFmpeg developers
     built on Dec 30 2014 11:31:18 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 --arch=x86_64 --enable-runtime-cpudetect
     libavutil      54. 15.100 / 54. 15.100
     libavcodec     56. 13.100 / 56. 13.100
     libavformat    56. 15.102 / 56. 15.102
     libavdevice    56.  3.100 / 56.  3.100
     libavfilter     5.  2.103 /  5.  2.103
     libswscale      3.  1.101 /  3.  1.101
     libswresample   1.  1.100 /  1.  1.100
     libpostproc    53.  3.100 / 53.  3.100
    Routing option strict to both codec and muxer layer
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9a0a002c00] overread end of atom 'colr' by 1 bytes
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9a0a002c00] stream 0, timescale not set
    [mov,mp4,m4a,3gp,3g2,mj2 @ 0x7f9a0a002c00] max_analyze_duration 5000000 reached at 5003637 microseconds
    Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '300.mp4':
     Metadata:
       major_brand     : mp42
       minor_version   : 0
       compatible_brands: mp42isomavc1
       creation_time   : 2014-01-11 05:39:32
       genre           : Trailer
       artist          : Warner Bros.
       title           : 300: Rise of an Empire - Trailer 2
       encoder         : HandBrake 0.9.9 2013051800
       date            : 2014
     Duration: 00:02:33.24, start: 0.000000, bitrate: 7377 kb/s
       Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1920x1080 (1920x1088), 7219 kb/s, 23.98 fps, 23.98 tbr, 90k tbn, 47.95 tbc (default)
       Metadata:
         creation_time   : 2014-01-11 05:39:32
         encoder         : JVT/AVC Coding
       Stream #0:1(eng): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 157 kb/s (default)
       Metadata:
         creation_time   : 2014-01-11 05:39:32
       Stream #0:2: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 101x150 [SAR 72:72 DAR 101:150], 90k tbr, 90k tbn, 90k tbc
    rtmp://nessma-****.channel.mediaservices.windows.net:1935/live/584c99f5c47f424d9e83ac95364331e7: Input/output error

    The Azure blog post clearly states that this should be possible but I can’t find a working example anywhere.

    Environment :

    • MacOS Maverick
    • FFMPEG installed from official build
    • 300.mp4 : 1080p trailer of the latest 300 movie