Recherche avancée

Médias (1)

Mot : - Tags -/ogv

Autres articles (81)

  • Emballe médias : à quoi cela sert ?

    4 février 2011, par

    Ce plugin vise à gérer des sites de mise en ligne de documents de tous types.
    Il crée des "médias", à savoir : un "média" est un article au sens SPIP créé automatiquement lors du téléversement d’un document qu’il soit audio, vidéo, image ou textuel ; un seul document ne peut être lié à un article dit "média" ;

  • XMP PHP

    13 mai 2011, par

    Dixit Wikipedia, XMP signifie :
    Extensible Metadata Platform ou XMP est un format de métadonnées basé sur XML utilisé dans les applications PDF, de photographie et de graphisme. Il a été lancé par Adobe Systems en avril 2001 en étant intégré à la version 5.0 d’Adobe Acrobat.
    Étant basé sur XML, il gère un ensemble de tags dynamiques pour l’utilisation dans le cadre du Web sémantique.
    XMP permet d’enregistrer sous forme d’un document XML des informations relatives à un fichier : titre, auteur, historique (...)

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

Sur d’autres sites (4087)

  • 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


    


  • 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

  • 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