Advanced search

Medias (0)

Tag: - Tags -/api

No media matches your criterion on the site.

Other articles (64)

  • Other interesting software

    13 April 2011, by

    We don’t claim to be the only ones doing what we do ... and especially not to assert claims to be the best either ... What we do, we just try to do it well and getting better ...
    The following list represents softwares that tend to be more or less as MediaSPIP or that MediaSPIP tries more or less to do the same, whatever ...
    We don’t know them, we didn’t try them, but you can take a peek.
    Videopress
    Website: http://videopress.com/
    License: GNU/GPL v2
    Source code: (...)

  • Des sites réalisés avec MediaSPIP

    2 May 2011, by

    Cette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
    Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page.

  • Taille des images et des logos définissables

    9 February 2011, by

    Dans beaucoup d’endroits du site, logos et images sont redimensionnées pour correspondre aux emplacements définis par les thèmes. L’ensemble des ces tailles pouvant changer d’un thème à un autre peuvent être définies directement dans le thème et éviter ainsi à l’utilisateur de devoir les configurer manuellement après avoir changé l’apparence de son site.
    Ces tailles d’images sont également disponibles dans la configuration spécifique de MediaSPIP Core. La taille maximale du logo du site en pixels, on permet (...)

On other websites (4349)

  • 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, &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.

  • Is there problem with 'read' command in Bash, or in Bash itself when using multiprocessing, or may be I make some mistake? [duplicate]

    27 January 2023, by myQs

    First to mention that I do not have lot of experiences with Bash scripting.
    
Here is the problem that I observe:

    
When I execute read command and inside the cycle I run background processes, the read command misses some of the arguments in some very rare cases.

    
For example: if I read the output of ls -la for big number of video files and on each of them I execute ffmpeg command in a different sub-process, then in some very rare cases there are missing some of the first parameters of read command.
    
In that case the rest of parameters of the ls are wrong (having partial of their real values or wrongly assigned).

    
I most of the cases I have an output like this (which is correct):
    
p1: '-rwxr-x---.'; p2: '1'; p3: 'uman'; p4: 'uman'; p5: '1080519'; p6: 'Jan'; p7: '27'; p8: '05:49'; p9: 'origVideo_453.mp4'

    


    but for very few lines I have not correct output and it is like this:
    
p1: 'an'; p2: '1080519'; p3: 'Jan'; p4: '27'; p5: '05:49'; p6: 'origVideo_454.mp4'; p7: ''; p8: ''; p9: ''

    


    Here p1 and p2 are missing and p3 should be "uman" but is just "an". And p3 becomes p1, p4 becomes p2, etc, in this way p7, p8 and p9 remain without values.

    


    Here is my bash script:

    


    #!/bin/bash

#src_dir=/tmp/text_files
src_dir=/tmp/video_files

dest_dir=/tmp/video_files_dest

mkdir -p $dest_dir

handle_video() {
  echo "handling file: '$1'"
  ffmpeg -loglevel error -i $src_dir/$1  -acodec copy -vcodec copy $dest_dir/$1
}

generate_text() {
  str=''
  for k in {1..512}
  do
    random=$(openssl rand -hex 20)
    str="${str}${random} "

    if [ $(( $k % 4 )) -eq 0 ]; then
      str="${str} ${new_line}"
    fi
  done

  echo "${str}" > $src_dir/$1
}

while read p1 p2 p3 p4 p5 p6 p7 p8 p9; do
echo "p1: '$p1'; p2: '$p2'; p3: '$p3'; p4: '$p4'; p5: '$p5'; p6: '$p6'; p7: '$p7'; p8: '$p8'; p9: '$p9'"
  if test -f $src_dir/$p9; then
    handle_video $p9 &
#    generate_text $p9 &
  fi
done << EOF
$(ls -la $src_dir)
EOF


    

    
**When I run the `handle_video` not in background but in same thread** I do not have such problem (remove `&` from line 33).

    
First I thought the issue might be in the output of the command `la -ls` and I tried with other commands, but I saw the same kind of results - in most of the executions `read` has correct parameters but in very few cases they are wrong.

    


    I also tried the script instead with handle_video (which uses ffmpeg invocation) to run different function that is executed inside read cycle: the generate_text.
    
To do this I comment lines 3 and 33 and uncomment lines 4 and 34.
    
And the interesting thing is that when executing it with handle_video problem exists but when executing with generate_text there is no such problem at all. At least I have never observed it in all my tests.
    
When executing it with handle_video I put 1200 video .mp4 files (1.1 MB each) in directory /tmp/video_files and run bash script.

    
When executing it with generate_text I generate 1200 empty files in directory /tmp/text_files and run the bash script.

    


    I also tried to execute the read command with piping like this, but the result is the same:

    


    ls -la $src_dir | while read p1 p2 p3 p4 p5 p6 p7 p8 p9; do
  echo "p1: '$p1'; p2: '$p2'; p3: '$p3'; p4: '$p4'; p5: '$p5'; p6: '$p6'; p7: '$p7'; p8: '$p8'; p9: '$p9'"
  if test -f $src_dir/$p9; then
    handle_video $p9 &
#   generate_text $p9 &
  fi
done


    

    


    Bash version is: 5.2.15(1)-release
    
ffmpeg version 5.0.2
    
Guest OS: Fedora version: "36 (Workstation Edition)"
    
VirtualBox 7.0.2
    
Host OS: is Windows 10 version: 21H2
    


    


    Once again when I do not run the function handle_video in background (at line 33 remove the ampersand &) there are no problems.
    
And when I use instead of handle_video the function generate_text again there are no problems.

    
So I wonder is there problem in the read method and how it gets the arguments, or is there problem with bash how it is being executing multiple processes, or there is something that I do not understand.
    
Any help and tips are appreciated.

    


    Here is a snippet of real output:

    


    p1: '-rwxr-x---.'; p2: '1'; p3: 'uman'; p4: 'uman'; p5: '1080519'; p6: 'Jan'; p7: '27'; p8: '05:49'; p9: 'origVideo_453.mp4'
handling file: 'origVideo_448.mp4'
handling file: 'origVideo_449.mp4'
handling file: 'origVideo_44.mp4'
handling file: 'origVideo_450.mp4'
handling file: 'origVideo_451.mp4'
handling file: 'origVideo_452.mp4'
p1: 'an'; p2: '1080519'; p3: 'Jan'; p4: '27'; p5: '05:49'; p6: 'origVideo_454.mp4'; p7: ''; p8: ''; p9: ''
p1: '-rwxr-x---.'; p2: '1'; p3: 'uman'; p4: 'uman'; p5: '1080519'; p6: 'Jan'; p7: '27'; p8: '05:49'; p9: 'origVideo_455.mp4'
p1: '-rwxr-x---.'; p2: '1'; p3: 'uman'; p4: 'uman'; p5: '1080519'; p6: 'Jan'; p7: '27'; p8: '05:49'; p9: 'origVideo_456.mp4'


    


  • G.I. Joe Custom Multimedia

    30 March 2012, by Multimedia Mike — General

    I received this 3-disc set of G.I. Joe CD-ROMs today:



    Copyright 2003, and labeled as PC ONLY. Each disc claims to have 2 episodes. So are these some sort of video discs? Any gaming elements? I dove in to investigate.

    So, it turns out that there are some games on these discs, done in Flash Player (which tells me that these were probably available on the web at some point). Here’s a shooting gallery game from the first disc:



    As promised by the CD-ROM copy, the menu does grant access to 2 classic G.I. Joe episodes. Selecting either one launches this:



    Powered by C-ezy? Am I interpreting that correctly? Anyway, the video player goes fullscreen and looks fine (given the source material). I can’t capture screenshots and controls are limited to: space for pause, ESC to exit player, and up/down to control volume. No seeking and certainly no onscreen controls. Pretty awful player.

    Studying the first disc, I find a 550 MB file with the name 5859Hasbro.egm. Coupled with ep58.cfg and ep59.cfg files in the same directory, I gather that the disc has G.I. Joe episodes 58 and 59 (though the exact episodes, “There’s No Place Like Springfield” parts 1 and 2, are listed on Wikipedia as being episodes 154 and 155; but who’s counting?). The cfg files contain this text:

    ep58.cfg:
    EGM_GIJOE.exe
    5859Hasbro.egm /noend /track:0 /singletrack
    

    ep59.cfg:
    EGM_GIJOE.exe
    5859Hasbro.egm /noend /track:1 /singletrack

    The big EGM file starts with the string “Egenie Player”. After that, I see absolutely no clues. The supporting EGM_GIJOE.exe file has some interesting strings: “Decore Bits Per Pixel” (I know I have seen “Decore” used to mean “decoding core” in some libraries), “Egenie Player – %s, Version:%s”, “4th June 2002″, a list of common FourCC tags seen in AVI files, “Brought to you by Martin, Patrick Bob and Bren” (do you suppose “Patrick Bob” is one person’s name?), a list of command line options…

    Aha! A URL: http:\www.e-genie.tv (yep, backslashes, not forward slashes). e-genie.tv seems to redirect to mygenie.tv, which… doesn’t appear to be strictly related to video technology these days.