Advanced search

Medias (17)

Tag: - Tags -/wired

Other articles (73)

  • Le profil des utilisateurs

    12 April 2011, by

    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 November 2010, by

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

  • Submit bugs and patches

    13 April 2011

    Unfortunately a software is never perfect.
    If you think you have found a bug, report it using our ticket system. Please to help us to fix it by providing the following information: the browser you are using, including the exact version as precise an explanation as possible of the problem if possible, the steps taken resulting in the problem a link to the site / page in question
    If you think you have solved the bug, fill in a ticket and attach to it a corrective patch.
    You may also (...)

On other websites (6131)

  • FFMPEG Cutting Commercials puts audio out of sync

    11 September 2014, by JaBbA

    Ubuntu 14.04.1 with the real ffmpeg loaded (same problem with the avconv version).

    I’m trying to take files created in MythTV with a HDPVR, cut the commercials and put the video into an MP4 container for use with MythRoku.

    the command

    ffmpeg -i $file -acodec copy -vcodec copy -f mp4 file.mp4

    Works fine. Once I update the database, I can watch the file in MythRoku or Plex.

    However, when I try to cut out the commercials, the audio gets out of sync by just over 1 second (audio delayed) whenever I cut past the 0 mark. Totem Video player and VLC both play the resulting video fine, but I can see a "hitch" at the beginning while they are syncing the audio, so I know the information on the audio sync is in the file somewhere. Mythroku and Plex both are out of sync when playing the file. The MythTV Frontend player actually does play it correctly, and I can hear the "hitch" as it syncs the audio.

    After hours of reading posts and playing with settings, I’ve got it down to this:

    If I say:

    ffmpeg -i $file -acodec copy -vcodec copy -f mp4 -ss 0 -t <anything> out.mp4</anything>

    The file is fine, plays both locally and in MythRoku/Plex

    But if I advance the start any amount - even 1 second - audio is out of sync

    ffmpeg -i $file -acodec copy -vcodec copy -f mp4 -ss 1 -t <anything> out.mp4</anything>

    I’ve tried splitting the video (as mp4) and audio (as ac3) first, splitting them separately, and then putting them back together as the last step, but I get the same results.

    The information is in the file - Totem, VLC and the Frontend all can figure it out. How can I get ffmpeg to figure out the sync and write the file so it’s correct?

    Original file:

    mythtv@marvin:~$ mediainfo /var/lib/mythtv/recordings/2225_20140824001500.mpg
    General
    ID                                       : 0 (0x0)
    Complete name                            :     /var/lib/mythtv/recordings/2225_20140824001500.mpg
    Format                                   : MPEG-TS
    File size                                : 4.03 GiB
    Duration                                 : 1h 45mn
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 5 491 Kbps

    Video
    ID                                       : 4113 (0x1011)
    Menu ID                                  : 1 (0x1)
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Main@L4.0
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Format settings, GOP                     : M=4, N=32
    Codec ID                                 : 27
    Duration                                 : 1h 45mn
    Bit rate mode                            : Variable
    Bit rate                                 : 4 831 Kbps
    Maximum bit rate                         : 20.0 Mbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate                               : 59.940 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.087
    Stream size                              : 3.55 GiB (88%)
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709

    Audio
    ID                                       : 4352 (0x1100)
    Menu ID                                  : 1 (0x1)
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Format settings, Endianness              : Big
    Codec ID                                 : 129
    Duration                                 : 1h 45mn
    Bit rate mode                            : Constant
    Bit rate                                 : 384 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Delay relative to video                  : -6ms
    Stream size                              : 289 MiB (7%)

    File cut from 0:

    mythtv@marvin:~$ mediainfo 2225_20140824001500_1.mp4
    General
    Complete name                            : 2225_20140824001500_1.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 58.5 MiB
    Duration                                 : 1mn 45s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 4 676 Kbps
    Writing application                      : Lavf54.63.104

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Main@L4.0
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Format settings, GOP                     : M=4, N=32
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 1mn 45s
    Bit rate mode                            : Variable
    Bit rate                                 : 4 281 Kbps
    Maximum bit rate                         : 20.0 Mbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Variable
    Frame rate                               : 59.940 fps
    Minimum frame rate                       : 59.920 fps
    Maximum frame rate                       : 59.960 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.077
    Stream size                              : 53.6 MiB (92%)
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709

    Audio
    ID                                       : 2
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Format settings, Endianness              : Big
    Codec ID                                 : ac-3
    Duration                                 : 1mn 45s
    Bit rate mode                            : Constant
    Bit rate                                 : 384 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Stream size                              : 4.81 MiB (8%)

    File cut from 1 second with audio sync problem:

    mythtv@marvin:~$ mediainfo 2225_20140824001500_2.mp4
    General
    Complete name                            : 2225_20140824001500_2.mp4
    Format                                   : MPEG-4
    Format profile                           : Base Media
    Codec ID                                 : isom
    File size                                : 68.0 MiB
    Duration                                 : 2mn 0s
    Overall bit rate mode                    : Variable
    Overall bit rate                         : 4 750 Kbps
    Writing application                      : Lavf54.63.104

    Video
    ID                                       : 1
    Format                                   : AVC
    Format/Info                              : Advanced Video Codec
    Format profile                           : Main@L4.0
    Format settings, CABAC                   : Yes
    Format settings, ReFrames                : 4 frames
    Format settings, GOP                     : M=4, N=32
    Codec ID                                 : avc1
    Codec ID/Info                            : Advanced Video Coding
    Duration                                 : 1mn 58s
    Bit rate mode                            : Variable
    Bit rate                                 : 4 394 Kbps
    Maximum bit rate                         : 20.0 Mbps
    Width                                    : 1 280 pixels
    Height                                   : 720 pixels
    Display aspect ratio                     : 16:9
    Frame rate mode                          : Variable
    Frame rate                               : 59.940 fps
    Minimum frame rate                       : 59.920 fps
    Maximum frame rate                       : 59.960 fps
    Color space                              : YUV
    Chroma subsampling                       : 4:2:0
    Bit depth                                : 8 bits
    Scan type                                : Progressive
    Bits/(Pixel*Frame)                       : 0.080
    Stream size                              : 62.3 MiB (92%)
    Color primaries                          : BT.709
    Transfer characteristics                 : BT.709
    Matrix coefficients                      : BT.709

    Audio
    ID                                       : 2
    Format                                   : AC-3
    Format/Info                              : Audio Coding 3
    Mode extension                           : CM (complete main)
    Format settings, Endianness              : Big
    Codec ID                                 : ac-3
    Duration                                 : 2mn 0s
    Bit rate mode                            : Constant
    Bit rate                                 : 384 Kbps
    Channel(s)                               : 2 channels
    Channel positions                        : Front: L R
    Sampling rate                            : 48.0 KHz
    Bit depth                                : 16 bits
    Compression mode                         : Lossy
    Stream size                              : 5.49 MiB (8%)
  • How to reencode flash stream to MP4 or/and WebM inside server implementation?

    18 April 2013, by user2294505

    Hi guys, lets start with this that I'm totally new in video streaming.

    Currently I have to support one server implemented in C that work as mediator between stream producers and stream consumers. In my case I have one remote machine that generate flash stream and one or more clients that can watch it. The server work as proxy for all of them. We are using our server side implementation for rtmp protocol and for asynchronous work over HTTP we are using libevent library. All this construction work fine in common case.

    Now we need to transfer this stream to HTML5 clients and we need to support new formats. Our decision was that MP4 and WebM are enough for us. Base of the HTTP request our internal implementation recognized what type of stream client need. For example when the client need MP4 URI is something like this:

    http://192.168.0.5/video.mp4?blah-blah-blah

    where "blah-blah-blah" are few parameters to impersonate client. We have already implemented mechanism that convert input frames to raw pictures and this implementation work fine when we stream JPEGs as again we are using libavformat library to encode raw picture to JPEG. In case with JPEGs the contents of the stream data must contain HTTP meta data with description of every picture. The client stream request is same as this for MP4 stream but instead video.mp4 we are uising jpegstream.htm

    Now I need to convert this input stream to MP4 and/or WebM and here start my problems. For generating Mp4 and WebM videos I'm using ffmpeg libraries and base of one of ffmpeg examples (muxing) I'm trying to convert already generated pictures to currently selected new format. More or less this conversion is OK but after than I don't know why I can't send video to consumer. I'm using next code to prepare avio context:

    int iSize = 4 * 1024;
    unsigned char *ptrBuf = ( unsigned char * )av_malloc( iSize );
    ptrOFC->pb = avio_alloc_context( ptrBuf, iSize, 1, ptrTCDObj, NULL, write_pkg, NULL );
    if ( !ptrTCDObj->ptrOFC->pb ) {
       goto ERROR;
    }
    avformat_write_header( ptrOFC, NULL );

    When the server receive frame from flash we are converting it to corresponding output format with code like this:

    iResult = avcodec_encode_video2( ptrTCDataObj->m_ptrOCC, &packet, pictureFrame, &iGotPacket );

    and write it to stream when succeed and packet exist with:

    av_interleaved_write_frame( ptrOFC, &amp;packet );

    Here our code expect to receive in one moment call to write_pkg function. But nothing happen here :-(. Situation is 100% same if I'm using direct write with av_write_frame. The write_pkg function has very simple body:

    int write_pkg( void *ptrOpaque, uint8_t *ptrBuffer, int iBufferSize )
    {
       STransCoderData_t *ptrTCDObj = ( STransCoderData_t * ) ptrOpaque;
       struct evbuffer *ptrFrameOut;
       ptrFrameOut = evbuffer_new();
       evbuffer_add( ptrFrameOut, ptrBuffer,( size_t ) iBufferSize );
       http_client_write_video( ptrFrameOut, ptrTCDObj->m_ptrHTTPClient, NULL );
       evbuffer_free( ptrFrameOut );
       return iBufferSize;
    }

    Structure STransCoderData_t and function http_client_write_video is not interesting in this moment because we don't reach them for now :-(

    For test consumer I'm using VLC player as open network stream :

    http://192.168.0.5/video.mp4?blah-blah-blah

    VLC don't show anything even errors.

    Any ideas, comments and help are welcome.

  • Ffmpeg set duration using node-fluent-ffmpeg

    23 May 2013, by Vprnl

    I'm really new to the world of ffmpeg so please excuses me if this is a stupid queston.

    I'm using the module Node-fluent-ffmpeg to stream a movie and convert it from avi to webm.
    So far so good (it plays the video), but I'm having trouble parsing the duration to the player. My ultimate goal is to be able to skip ahead in the movie. But first the player needs to know how long the video is.

    my code is as followed:

    var stat = fs.statSync(movie);

    var start = 0;
    var end = 0;
    var range = req.header(&#39;Range&#39;);
    if (range != null) {
    start = parseInt(range.slice(range.indexOf(&#39;bytes=&#39;)+6,
     range.indexOf(&#39;-&#39;)));
    end = parseInt(range.slice(range.indexOf(&#39;-&#39;)+1,
     range.length));
    }
    if (isNaN(end) || end == 0) end = stat.size-1;
    if (start > end) return;

    res.writeHead(206, { // NOTE: a partial http response
       &#39;Connection&#39;:&#39;close&#39;,
       &#39;Content-Type&#39;:&#39;video/webm&#39;,
       &#39;Content-Length&#39;:end - start,
       &#39;Content-Range&#39;:&#39;bytes &#39;+start+&#39;-&#39;+end+&#39;/&#39;+stat.size,
       &#39;Transfer-Encoding&#39;:&#39;chunked&#39;
    });

    var  proc = new ffmpeg({ source: movie, nolog: true, priority: 1, timeout:15000})
       .toFormat(&#39;webm&#39;)
       .withVideoBitrate(&#39;1024k&#39;)
       .addOptions([&#39;-probesize 900000&#39;, &#39;-analyzeduration 0&#39;, &#39;-bufsize 14000&#39;])
       .writeToStream(res, function(retcode, error){
       if (!error){
           console.log(&#39;file has been converted succesfully&#39;,retcode);
       }else{
           console.log(&#39;file conversion error&#39;,error);
       }
    });

    I tried to set the header with a start and a end based on this article: http://delog.wordpress.com/2011/04/25/stream-webm-file-to-chrome-using-node-js/

    I also looked in the FFmpeg documentation and found -f duration and -ss.
    But I don't quite know how to convert the byte range to seconds.

    I feel like I'm pretty close to a solution but my inexperience with the subject matter prohibits me from getting it to work. If I'm unclear in any way please let me know. (I have a tendency of explaining things fuzzy.)

    Thanks in advance!