Recherche avancée

Médias (0)

Mot : - Tags -/masques

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

Autres articles (72)

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

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Sélection de projets utilisant MediaSPIP

    29 avril 2011, par

    Les exemples cités ci-dessous sont des éléments représentatifs d’usages spécifiques de MediaSPIP pour certains projets.
    Vous pensez avoir un site "remarquable" réalisé avec MediaSPIP ? Faites le nous savoir ici.
    Ferme MediaSPIP @ Infini
    L’Association Infini développe des activités d’accueil, de point d’accès internet, de formation, de conduite de projets innovants dans le domaine des Technologies de l’Information et de la Communication, et l’hébergement de sites. Elle joue en la matière un rôle unique (...)

Sur d’autres sites (6717)

  • Uploading video with Rails/Paperclip to Heroku/S3

    17 octobre 2015, par Corey Tegeler

    I’ve been failing at uploading a video in production mode on Heroku for way too long, testing local works great with resizing and thumbnail creation. Images also work fine going to my S3 bucket, so the credentials are all okay.

    Here are the logs I usually get from the code used below. Incidentally, the attempt right before I got these logs (without changing any code and using the same test video), the video made it to AWS, just without the resizing or thumbnail creation. But that was the only time I have even made it that far, and this failed upload and 500 error immediately happened after.

    $ heroku logs

    2015-08-06T15:38:39.732913+00:00 app[web.1]: Started POST "/work/create" for 104.162.101.0 at 2015-08-06 15:38:39 +0000
    2015-08-06T15:38:39.696998+00:00 app[web.1]: source=rack-timeout id=dd06eb06-cad5-4236-8788-e5f59f7fe631 wait=7850ms timeout=15000ms service=0ms state=active
    2015-08-06T15:38:39.734677+00:00 app[web.1]: Processing by WorksController#create as HTML
    2015-08-06T15:38:39.734744+00:00 app[web.1]:   Parameters: {"utf8"=>"✓", "authenticity_token"=>"9edyQVZm68aW+majARmNcDR1dwpE59ZrWEZ4/G07ADYhlZyYiJ+RwYK4GBguQZbrlS6J4yDbMsMIxcvWLD3aUA==", "work"=>{"position"=>"", "media_type"=>"video", "video"=>#, @original_filename="FA14 final_compilation_mg4d_H.264.mp4", @content_type="video/mp4", @headers="Content-Disposition: form-data; name=\"work[video]\"; filename=\"FA14 final_compilation_mg4d_H.264.mp4\"\r\nContent-Type: video/mp4\r\n">, "designer"=>""}}
    2015-08-06T15:38:40.030596+00:00 heroku[router]: at=info method=POST path="/work/create" host=purchasedesign.herokuapp.com request_id=dd06eb06-cad5-4236-8788-e5f59f7fe631 fwd="104.162.101.0" dyno=web.1 connect=1ms service=8181ms status=500 bytes=192
    2015-08-06T15:38:40.017315+00:00 app[web.1]: Command :: file -b --mime '/tmp/9b4d56c6bf75dc6718768cda6940025a20150806-3-14gq1uq.mp4'
    2015-08-06T15:38:40.025037+00:00 app[web.1]: [AV] Running command: if command -v ffmpeg 2>/dev/null; then echo "true"; else echo "false"; fi
    2015-08-06T15:38:40.028329+00:00 app[web.1]:
    2015-08-06T15:38:40.028332+00:00 app[web.1]: Av::UnableToDetect (Unable to detect any supported library):
    2015-08-06T15:38:40.028333+00:00 app[web.1]:   app/controllers/works_controller.rb:18:in `create'
    2015-08-06T15:38:40.028335+00:00 app[web.1]:
    2015-08-06T15:38:40.028336+00:00 app[web.1]:
    2015-08-06T15:38:40.028629+00:00 app[web.1]: source=rack-timeout id=dd06eb06-cad5-4236-8788-e5f59f7fe631 wait=7850ms timeout=15000ms service=332ms state=completed
    2015-08-06T15:38:40.023226+00:00 app[web.1]: [AV] Running command: if command -v avprobe 2>/dev/null; then echo "true"; else echo "false"; fi
    2015-08-06T15:38:40.027118+00:00 app[web.1]: Completed 500 Internal Server Error in 292ms

    models/work.rb

    has_attached_file :video,
       :styles => {
           :mp4 => {
               :geometry => "640x480",
               :format => 'mp4',
           },
           :thumb => {
               :geometry => '300x300',
               :format => 'jpg',
               :time => 10
           }
       },
       :processors => [:transcoder]

    Gemfile

    gem 'aws-sdk', '< 2.0'
    gem 'paperclip', '~> 4.2'
    gem 'paperclip-ffmpeg', '~> 1.0.0'
    gem 'paperclip-av-transcoder'
    gem 'delayed_paperclip'
    gem 'rmagick', '~> 2.13.4'

    config/environments/production.rb

    config.paperclip_defaults = {
      :storage => :s3,
      :s3_credentials => {
        :bucket => ENV['S3_BUCKET_NAME'],
        :access_key_id => ENV['AWS_ACCESS_KEY_ID'],
        :secret_access_key => ENV['AWS_SECRET_ACCESS_KEY']
      }
    }

    Any help would be incredible

  • Anomalie #2013 : Limiter la previsu en redaction à ses propres articles

    27 septembre 2015, par realet RealET

    Un autre bug constaté sur une 3.1 (svn 22423) avec le var_previewtoken activé : pour les gens non connectés à qui on communique l’URL avec le var_previewtoken, c’est une page 404 qui est vue si l’article est en cours de rédaction.
    Et si l’article est proposé à l’évaluation, alors c’est bon.

    (j’ai eu un sacré qui-proquo en demandant une relecture d’un article dans cette situation !).

    Pour mémoire :
    define(’_PREVIEW_TOKEN’, true) ; // introduit par http://core.spip.org/projects/spip/repository/revisions/21077 et http://core.spip.org/projects/spip/repository/revisions/21084

    (c’est un define que je garde depuis SPIP 2.1, ne sachant si c’est natif en SPIP 3.1)

  • FFmpeg encoding produces slightly incompatible MKV/MP4 container

    11 juin 2018, par james2048

    I’ve been using the FFmpeg libraries to read and write media files using the C API.

    So far, reading seems to be pretty straightforward. I am able to read frames which I can then process, convert to RGB, process, and then convert back to YUV420 to be encoded.

    The encoded files play back with VLC media player fine, and Windows Media Player if I have a codec pack installed. However, they do behave strangely : the stock Windows 10 player won’t play them, same for Adobe Premiere. Also thumbnailers don’t work on it.
    Basically it seems like nothing other than VLC or FFmpeg itself can play/process the file. I have seen this with both MP4 and MKV, so it is not a format-specific issue.

    The problems go away once you remux the file with FFmpeg, for example "ffmpeg -i input.mkv -c copy output.mkv". Everything can play the file correctly.
    Also, the "remuxing.c" sample from the official samples works as well, with the same library version and compilers that I’m using (Visual Studio 2017, FFmpeg compiled with MinGW). It will fix the file and make it playable in all software.

    I’m not sure what could be causing this. I also don’t understand what the remuxing "fixed". It must be a container issue as the frames aren’t touched by remuxing.
    I have analysed the output MKVs with FFprobe -show_packets. It seems to have budged the packet timestamps a little constant factor, and the output stream now has
    is_avc=true and nal_length_size=4 instead of is_avc=false and nal_length_size=0, but apart from that the files are identical.

    Now here’s the output of FFprobe with the 3 last test packets, stream info and format info for both streams. As you can see, they are identical except for a couple of field. But something in here must have been "fixed" during remuxing to make it work.

    [PACKET]
    codec_type=video
    stream_index=0
    pts=59050
    pts_time=59.050000
    dts=58890
    dts_time=58.890000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=427
    pos=277358
    flags=__
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=58970
    pts_time=58.970000
    dts=58970
    dts_time=58.970000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=205
    pos=277792
    flags=__
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=59130
    pts_time=59.130000
    dts=59050
    dts_time=59.050000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=268
    pos=278004
    flags=__
    [/PACKET]
    [STREAM]
    index=0
    codec_name=h264
    codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    profile=Main
    codec_type=video
    codec_time_base=1/2000
    codec_tag_string=[0][0][0][0]
    codec_tag=0x0000
    width=720
    height=576
    coded_width=720
    coded_height=576
    has_b_frames=2
    sample_aspect_ratio=N/A
    display_aspect_ratio=N/A
    pix_fmt=yuv420p
    level=50
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=progressive
    timecode=N/A
    refs=1
    is_avc=false
    nal_length_size=0
    id=N/A
    r_frame_rate=299/12
    avg_frame_rate=1000/1
    time_base=1/1000
    start_pts=0
    start_time=0.000000
    duration_ts=N/A
    duration=N/A
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=8
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=737
    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:DURATION=00:00:59.211000000
    [/STREAM]
    [FORMAT]
    filename=testEncLeft.mkv
    nb_streams=1
    nb_programs=0
    format_name=matroska,webm
    format_long_name=Matroska / WebM
    start_time=0.000000
    duration=59.211000
    size=278349
    bit_rate=37607
    probe_score=100
    TAG:COMMENT=Slickline Player Export
    TAG:ENCODER=Lavf57.83.100
    [/FORMAT]

    And the info after remuxing, which works :

    [PACKET]
    codec_type=video
    stream_index=0
    pts=59050
    pts_time=59.050000
    dts=58890
    dts_time=58.890000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=427
    pos=277418
    flags=__
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=58970
    pts_time=58.970000
    dts=58970
    dts_time=58.970000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=205
    pos=277852
    flags=__
    [/PACKET]
    [PACKET]
    codec_type=video
    stream_index=0
    pts=59130
    pts_time=59.130000
    dts=59050
    dts_time=59.050000
    duration=1
    duration_time=0.001000
    convergence_duration=N/A
    convergence_duration_time=N/A
    size=268
    pos=278064
    flags=__
    [/PACKET]
    [STREAM]
    index=0
    codec_name=h264
    codec_long_name=H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
    profile=Main
    codec_type=video
    codec_time_base=1/2000
    codec_tag_string=[0][0][0][0]
    codec_tag=0x0000
    width=720
    height=576
    coded_width=720
    coded_height=576
    has_b_frames=2
    sample_aspect_ratio=N/A
    display_aspect_ratio=N/A
    pix_fmt=yuv420p
    level=50
    color_range=unknown
    color_space=unknown
    color_transfer=unknown
    color_primaries=unknown
    chroma_location=left
    field_order=progressive
    timecode=N/A
    refs=1
    is_avc=true
    nal_length_size=4
    id=N/A
    r_frame_rate=299/12
    avg_frame_rate=1000/1
    time_base=1/1000
    start_pts=0
    start_time=0.000000
    duration_ts=N/A
    duration=N/A
    bit_rate=N/A
    max_bit_rate=N/A
    bits_per_raw_sample=8
    nb_frames=N/A
    nb_read_frames=N/A
    nb_read_packets=737
    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:DURATION=00:00:59.212000000
    [/STREAM]
    [FORMAT]
    filename=fixedLeft.mkv
    nb_streams=1
    nb_programs=0
    format_name=matroska,webm
    format_long_name=Matroska / WebM
    start_time=0.000000
    duration=59.212000
    size=278409
    bit_rate=37615
    probe_score=100
    TAG:COMMENT=Slickline Player Export
    TAG:ENCODER=Lavf58.12.100
    [/FORMAT]

    Here is how I’m setting up the output context, for reference : it’s pretty standard, following the sample code.

    int ret;

    avformat_alloc_output_context2(&outputFormatCtx, nullptr, nullptr, outFilePath.c_str());

    av_dict_set(&outputFormatCtx->metadata, "comment", "FFmpeg Export", 0);

    if (!outputFormatCtx)
    {
       LOG_AND_THROW("Could not allocate output context");
    }

    outputVideoStream = avformat_new_stream(outputFormatCtx, nullptr);
    outputVideoStream->time_base = AVRational{ 1, AV_TIME_BASE }; // Stream timebase will be used by codec

    if (!outputVideoStream)
    {
       LOG_AND_THROW("Failed allocating output stream");
    }

    // defaults to "libx264"
    AVCodec *outCodec = avcodec_find_encoder_by_name(selectedCodecName.c_str());

    if (!outCodec)
    {
       LOG_AND_THROW("Failed finding output codec");
    }

    AVDictionary *opts = nullptr;

    if (selectedCodecName == "libx264")
    {
       opts = getX264CodecOptions();
    }

    encoderCtx = avcodec_alloc_context3(outCodec);

    if (!encoderCtx)
    {
       LOG_AND_THROW("Failed to allocate the encoder context");
    }

    encoderCtx->width = width;
    encoderCtx->height = height;
    encoderCtx->pix_fmt = AV_PIX_FMT_YUV420P;
    // time base for the frames we will provide to the encoder
    encoderCtx->time_base = AVRational{ 1, AV_TIME_BASE };
    // convert framerate from double to rational
    encoderCtx->framerate = AVRational{ (int)(frameRate * AV_TIME_BASE), AV_TIME_BASE};

    // Match encoderCtx time base for the stream
    outputVideoStream->time_base = encoderCtx->time_base;

    ret = avcodec_open2(encoderCtx, outCodec, &opts);

    if (ret < 0)
    {
       LOG_AND_THROW_PARAM("Cannot open video encoder for stream: %d", ret);
    }

    // Fill in some params for MP4 stream, details about encoder
    ret = avcodec_parameters_from_context(outputVideoStream->codecpar, encoderCtx);

    if (ret < 0)
    {
       LOG_AND_THROW_PARAM("Failed to copy encoder parameters to output stream: %d", ret);
    }

    if (outputFormatCtx->oformat->flags & AVFMT_GLOBALHEADER)
    {
       encoderCtx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
    }

    av_dump_format(outputFormatCtx, 0, filePath.c_str(), 1);

    // End of encoder settings, setting up MP4
    if (!(outputFormatCtx->oformat->flags & AVFMT_NOFILE))
    {
       ret = avio_open(&outputFormatCtx->pb, outFilePath.c_str(), AVIO_FLAG_WRITE);

       if (ret < 0)
       {
           LOG_AND_THROW_PARAMSTR("Could not open output file '%s'", outFilePath.c_str());
       }
    }

    ret = avformat_write_header(outputFormatCtx, nullptr);

    if (ret < 0)
    {
       LOG_AND_THROW_PARAM("Error occurred when opening output file for writing: %d", ret);
    }

    Can anyone help me figure out why the container is not playing properly ?

    Thanks in advance.

    -James