Recherche avancée

Médias (91)

Autres articles (68)

  • Use, discuss, criticize

    13 avril 2011, par

    Talk to people directly involved in MediaSPIP’s development, or to people around you who could use MediaSPIP to share, enhance or develop their creative projects.
    The bigger the community, the more MediaSPIP’s potential will be explored and the faster the software will evolve.
    A discussion list is available for all exchanges between users.

  • Formulaire personnalisable

    21 juin 2013, par

    Cette page présente les champs disponibles dans le formulaire de publication d’un média et il indique les différents champs qu’on peut ajouter. Formulaire de création d’un Media
    Dans le cas d’un document de type média, les champs proposés par défaut sont : Texte Activer/Désactiver le forum ( on peut désactiver l’invite au commentaire pour chaque article ) Licence Ajout/suppression d’auteurs Tags
    On peut modifier ce formulaire dans la partie :
    Administration > Configuration des masques de formulaire. (...)

  • MediaSPIP v0.2

    21 juin 2013, par

    MediaSPIP 0.2 est la première version de MediaSPIP stable.
    Sa date de sortie officielle est le 21 juin 2013 et est annoncée ici.
    Le fichier zip ici présent contient uniquement les sources de MediaSPIP en version standalone.
    Comme pour la version précédente, il est nécessaire d’installer manuellement l’ensemble des dépendances logicielles sur le serveur.
    Si vous souhaitez utiliser cette archive pour une installation en mode ferme, il vous faudra également procéder à d’autres modifications (...)

Sur d’autres sites (10698)

  • Using ffmpeg dll's from a windows 32 bit app

    8 avril 2020, par Derek

    I am trying to use ffmpeg via dll calls from a win32 app (compiled in clarion)

    



    I transcoded the example file encode_video.c and that worked 100% however I was left with a .h264 file instead of a .mp4 file.

    



    I then transcoded the example muxing.c however it crashes and I am at a loss for options.

    



    Any help would be most appreciated.

    



    Encode_mp4 ROUTINE
! avformat_alloc_output_context2 *******************************************************************************************
file_name = 'myvideo.mp4'
! Try guess format from filename
if CHECK_STACK then ds_SaveStack .
Result = avformat_alloc_output_context2(ThisPtrPtr, 0, NullCString, file_name);
if CHECK_STACK then ds_TestStack .
if Result < 0
    ds_OutputDebugString('avformat_alloc_output_context2 Try guess format failed, try mpeg', TRUE)
    CString1 = 'mpeg'
    if CHECK_STACK then ds_SaveStack .
    Result = avformat_alloc_output_context2(ThisPtrPtr, 0, CString1, file_name);
    if CHECK_STACK then ds_TestStack .
    if Result < 0
        ds_OutputDebugString('avformat_alloc_output_context2 failed', TRUE)
        stop('Could not allocate output format context')
        exit
    end
end
formater_ctxt &= (ThisPtrPtr)
!ds_OutputDebugString('formater_ctxt=' & address(formater_ctxt), TRUE)
assert(not(formater_ctxt &= NULL), 'Check AVFormatContext formater_ctxt')
do VerifyFormatContext
assert(formater_ctxt.oformat > 0, 'Check AVFormatContext formater_ctxt.oformat')
formater &= (formater_ctxt.oformat)
do VerifyFormat
ds_OutputDebugString('avformat_alloc_output_context2 OK', TRUE)

! avcodec_find_encoder *******************************************************************************************
if CHECK_STACK then ds_SaveStack .
encoder &= avcodec_find_encoder(formater.video_codec)
if CHECK_STACK then ds_TestStack .
if encoder &= NULL
    ds_OutputDebugString('avcodec_find_encoder failed', TRUE)
    stop('Could not find encoder')
    exit
end
do VerifyEncoder
ds_OutputDebugString('avcodec_find_encoder OK', TRUE)

! avformat_new_stream *******************************************************************************************
if CHECK_STACK then ds_SaveStack .
stream &= avformat_new_stream(formater_ctxt, encoder)
if CHECK_STACK then ds_TestStack .
if stream &= NULL 
    ds_OutputDebugString('avformat_new_stream failed', TRUE)
    stop('Could not create new stream')
    exit
end
do VerifyStream
stream.id = formater_ctxt.nb_streams-1
ds_OutputDebugString('avformat_new_stream OK', TRUE)

! avcodec_alloc_context3 *******************************************************************************************
if CHECK_STACK then ds_SaveStack .
encoder_ctxt &= avcodec_alloc_context3(encoder)
if CHECK_STACK then ds_TestStack .
if encoder_ctxt &= NULL 
    ds_OutputDebugString('avcodec_alloc_context3 failed', TRUE)
    stop('Could not allocate video codec context')
    exit
end
do VerifyEncoderContext
ds_OutputDebugString('avcodec_alloc_context3 OK', TRUE)

! Video settings *******************************************************************************************
do InitVideoSettings

assert(AV_CODEC_FLAG_GLOBAL_HEADER = bshift(1, 22), 'Check AV_CODEC_FLAG_GLOBAL_HEADER')
if band(formater.flags, AVFMT_GLOBALHEADER)
   encoder_ctxt.flags = bor(encoder_ctxt.flags, AV_CODEC_FLAG_GLOBAL_HEADER) !avctx->flags |= AV_CODEC_FLAG_GLOBAL_HEADER;
end

! avcodec_open2 *******************************************************************************************
if CHECK_STACK then ds_SaveStack .
Result = avcodec_open2(encoder_ctxt, encoder, 0)
if CHECK_STACK then ds_TestStack .
if Result < 0
    ds_OutputDebugString('avcodec_open2 failed.  Result=' & Result, TRUE)
    stop('Could not open codec')
    exit
end
ds_OutputDebugString('avcodec_open2 OK', TRUE)

! av_frame_alloc *******************************************************************************************
if CHECK_STACK then ds_SaveStack .
frame &= av_frame_alloc();
if CHECK_STACK then ds_TestStack .
if frame &= NULL
    ds_OutputDebugString('av_frame_alloc failed', TRUE)
    stop('Could not allocate video frame')
    exit
end
do VerifyFrame
frame.format = encoder_ctxt.pix_fmt
frame.width = encoder_ctxt.width
frame.height = encoder_ctxt.height
ds_OutputDebugString('av_frame_alloc OK', TRUE)

! av_frame_get_buffer *******************************************************************************************
if CHECK_STACK then ds_SaveStack .
Result = av_frame_get_buffer(frame, 32)
if CHECK_STACK then ds_TestStack .
if Result < 0
    ds_OutputDebugString('av_frame_get_buffer failed', TRUE)
    stop('Could not allocate video frame buffer Error = ' & Result)
    exit
end
do VerifyFrameBuffer
ds_OutputDebugString('av_frame_get_buffer OK', TRUE)

!frame->data offset=0  Array[8] of *int8_t
UseData0 &= (frame.data[1])
UseData1 &= (frame.data[2])
UseData2 &= (frame.data[3])

if CHECK_STACK then ds_SaveStack .
Result = avcodec_parameters_from_context(stream.codecpar, encoder_ctxt);
if CHECK_STACK then ds_TestStack .
if Result < 0
    ds_OutputDebugString('avcodec_parameters_from_context failed', TRUE)
    stop('Could not initialize stream parameters')
    exit
end
ds_OutputDebugString('avcodec_parameters_from_context OK', TRUE)

! av_dump_format *******************************************************************************************
ds_OutputDebugString('before call to av_dump_format  file_name=' & file_name, TRUE)
av_dump_format(formater_ctxt, 0, file_name, 1)


    



    I get a crash at last line - call to av_dump_format()

    



    If I comment this code then I get a crash on the very next lib call :

    



        ! avio_open *******************************************************************************************
if not(band(formater.flags, AVFMT_NOFILE)) 
    ds_OutputDebugString('before call to avio_open  file_name=' & file_name, TRUE)
    ThisInt &= address(formater_ctxt.pb)
    Result = avio_open(ThisInt, file_name, AVIO_FLAG_WRITE)


    



    Strangely if I comment the setup call to av_log_set_callback(my_log_callback) then the crash moves down to the next lib call : avformat_write_header

    


  • problem with "subprocess.Popen" AFTER make .exe file

    1er février 2020, par afcc0060

    im try to convert mp3 to mp4 with ffmpeg (command line)
    everything is well and program runs correctly.
    i have one progressbar and handle it from this function by reading ffmpeg command line output

    cls_wnd.pbar_step(line.lower())

    but after make (single) .exe file with pyinstaller program not run and did not convert anything

           def _cli(self ,cls_wnd ,cmd):
               errors = False
               cmd_output=""

               line=''
               try:
                       p = subprocess.Popen(cmd ,stdout=subprocess.PIPE ,
                                                 stderr=subprocess.STDOUT ,
                                                 universal_newlines=True ,
                                                 shell=False ,
                                                 creationflags = subprocess.CREATE_NO_WINDOW)

                       for line in p.stdout:
                               if cls_wnd.bt02.cget('text').lower()!="cancel":
                                       p.kill()
                                       return cmd_output, True ,'cancel'
                               cmd_output+=line
                               if line.lower().find('duration:')>-1 or line.lower().find('frame=')<1:
                                       cls_wnd.pbar_step(line.lower())
                               cls_wnd.root.update()

                       stdoutdata, stderrdata = p.communicate()
                       if p.wait() != 0:
                               p.kill()
                               return cmd_output, True ,line
                       p.kill()
                       return cmd_output, errors ,' '
               except OSError as e:
                       p.kill()
                       return cmd_output,True,' exit from except '
               return '',True,'exit from _cli end'

    cmd is somthnig like this

    cmd='ffmpeg -y -loop 1 -i 1.jpg -i 1.mp3 -c:a copy -c:v libx264 -shortest 1.mp4'

    make .exe file with this command

    pyinstaller -w --onefile  mp3tomp4.py --onefile

    if i dont use’-w’ every thing is well .. but that ugly black cmd-windows shown and i can not close or hide it

  • Why are there multiple timescale specified in a MP4/AVC container file ?

    24 juin 2021, par Lexx32117

    I am currently parsing a MPEG-DASH stream initialization segment (generated by FFMPEG) and I noticed that the timescale is specified at multiple different places in my file :

    


      

    • In the movie header box (mvhd) : 1000
    • 


    • In the media header box of my video track (mdhd) : 15360
    • 


    • In the AVC Configuration box (avcC) more precisely in the VUI section of the sequence parameter set NAL unit : 60
    • 


    


    Why is it specified in so many different places ? Why do they have different values ? Is there a hierarchy in these value ? For example does 60 overrides 15360 and 15360 overrides 1000 ?

    


    Here's the command I used to generate the file I am looking at :

    


    ffmpeg -f v4l2 -pixel_format yuyv422 -vcodec rawvideo -framerate 30 -video_size 640x360 -i /dev/video0 \
        -f dash -remove_at_exit false -use_template true -use_timeline true -streaming true -window_size 5 -extra_window_size 5 -seg_duration 5 -vcodec libx264 -b:v 1M -maxrate 1M -bufsize 2M  -pix_fmt yuv420p -r 30 -s 640x360 -aspect 16:9 /var/www/html/media/live.mpd