Recherche avancée

Médias (33)

Mot : - Tags -/creative commons

Autres articles (46)

  • Ecrire une actualité

    21 juin 2013, par

    Présentez les changements dans votre MédiaSPIP ou les actualités de vos projets sur votre MédiaSPIP grâce à la rubrique actualités.
    Dans le thème par défaut spipeo de MédiaSPIP, les actualités sont affichées en bas de la page principale sous les éditoriaux.
    Vous pouvez personnaliser le formulaire de création d’une actualité.
    Formulaire de création d’une actualité Dans le cas d’un document de type actualité, les champs proposés par défaut sont : Date de publication ( personnaliser la date de publication ) (...)

  • Websites made ​​with MediaSPIP

    2 mai 2011, par

    This page lists some websites based on MediaSPIP.

  • Publier sur MédiaSpip

    13 juin 2013

    Puis-je poster des contenus à partir d’une tablette Ipad ?
    Oui, si votre Médiaspip installé est à la version 0.2 ou supérieure. Contacter au besoin l’administrateur de votre MédiaSpip pour le savoir

Sur d’autres sites (8231)

  • Why MP4 generated through FFmpeg API can't be played in the Windows Media Player ?

    2 septembre 2021, par James

    I encoded some frames into a MP4 using FFmpeg API, but the MP4 could't be played in the Windows Media Player.

    


    By comparison with the normal MP4 using ffprobe, I found that the FOURCC of the problematic MP4 is 'H264' while the normal MP4 is 'AVC1'.
According to H.264 Video Types, 'AVC1' has start codes but 'H264' hasn't.I also learned that we shoud manually add sps and pps before H.264 stream when demuxing a MP4.

    


    Now I don't know how to add start code or sps/pps to my MP4, please give me a hand.
How I should do to generate a MP4 which can be played in the Windows Media Player ?

    


    I have tried to add h264 bitstream filter but it didn't work. The code below :

    


     AVBitStreamFilterContext *bsfc = NULL;
bsfc = av_bitstream_filter_init("h264_mp4toannexb");
if (bsfc == NULL) {
            printf("bsfc is NULL\n");
}
        
av_bitstream_filter_filter(bsfc, codec_ctx, NULL, &(pkt->data), &(pkt->size), pkt->data, pkt->size, 0);

av_bitstream_filter_close(bsfc);


    


    After a lot of trying, I found that manually adding sps and pps to codec_ctx->extradata effective :

    


    unsigned char sps_pps[23] = { 0x00, 0x00, 0x00, 0x01, 0x67, 0x64, 0x00, 0x29, 0xac, 0x1b, 0x1a, 0x12, 0xe0, 0x51, 0x90,
                              0x00, 0x00, 0x00, 0x01, 0x68, 0xea, 0x43, 0xcb };
codec_ctx->extradata_size = 23;
codec_ctx->extradata = (uint8_t*)av_malloc(23 + AV_INPUT_BUFFER_PADDING_SIZE);
if (codec_ctx->extradata == NULL) {
    printf("could not av_malloc the video params extradata!\n");
    ERR_NULL_EXIT
    }
memcpy(codec_ctx->extradata, sps_pps, 23);


    


    The code above refered to an answer of @szatmary

    


    Now generated MP4 can be played in Windows Media Player. But a new question emerges because I don't konw what correct value of sps/pps is. It cause that the width and height of frame presented in the Windows Explorer is incorrect. So I need to set the correct sps/pps. I also read the document of sps/pps but get confused because some parameters have variable bits. So can anybody tell me how to set the sps/pps correctly ?

    


  • vba & operator string error sending with string of arguments to processStartInfo for ffmpeg

    25 avril 2015, par Robert McCorkle

    I need to pass a string into the ProcessStartInfo for ffmpeg so that I can call the dim.Argument and have it append the strings and variables from code as I parse through the files.

    I have the current filename.mp3 that the code sees in movedFileInfo but it won’t allow me to append it to the string using & operators... help ?

    I know there may be one other way to do this utilizing the ffmpeg command in separate function to simply loop through a directory using "for" but I’ve not found a successful command for running my ffmpeg.exe nor the ffprompt in windows. I also need to append a carriage return when I write to merge.txt but can’t find an example... I’m new to vba.

    These commands work but vba is complaining about my & operator in my string. The operator ’&’ is not defined for types ’String’ and ’System.IO.FileInfo’. So what’s I understand is that the string I’m passing into psi.Arguments doesn’t like the fact that I’m sending it a string and a variable appended using the ’&’ operator... do I simply use a comma or how do I append the variable movedFileInfo to ffmpeg -i ? psi is defined above as ProcessStartInfo... so I’m not sure what types vb recognizes for it... I haven’t found info on ProcessStartInfo to kick off my ffmpeg exe.

    See code below :

    Imports System
    Imports System.IO
    Imports System.Text.RegularExpressions

    Public Class Form1

    Private Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click

       'videos are from SD card always on I:\Private\AVCHD\BDMV\STREAM\
       'store files to RAID drives in folders structured as :
       '       F:\BUILD\FLIGHT#\CAM#\_FLT__UTC__CAM_.MTS

       'set base dir as directory F:\
       Dim dir As String = "C:\"
       Dim video_card_dir As String = "C:\1bak\" '"I:\Private\AVCHD\BDMV\STREAM\"
       Directory.SetCurrentDirectory(dir)

       Dim new_flightnum_directory = dir & Me.BUILD.Text & "\" & FLT.Text & "\"
       'establish new video dir>  F: \    BUILD      \     FLIGHT # \               CAM #    \
       Dim new_video_directory = dir & Me.BUILD.Text & "\" & FLT.Text & "\" & Me.CAM.Text & "\"
       'establish new filename to rename the video file
       '                               TAIL #              FLT #
       Dim new_filename As String = TAIL.Text & "_" & FLT.Text & "_" & UTC.Text & "_" & CAM.Text
       Dim ffmpeg As String = "C:\ffmpeg\bin\ffmpeg.exe"
       '****FFMPEG required variables
       Dim psi As ProcessStartInfo = New ProcessStartInfo("C:\ffmpeg\bin\ffmpeg.exe")
       Dim proc As Process = Process.Start(psi)

       psi.UseShellExecute = True
       psi.CreateNoWindow = True
       '****end FFMPEG required variables



       '!!!!!!!!!!!!!!!!!!!!!!!!!!!need to add the processing below to the IF statement aboev so that if the folders exist, the video processing doesn't attempt to run on existing files
       ' !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!





       '~~~~~~~~~~~~~~~~~~~~~~~~~~~~START - MOVE THIS DOWN BELOW CREATION OF FILE STRUCTURE WHEN DOEN DEBUGGING************


       '***START MOVING the files from the card to the new directory****
       For Each foundFile As String In My.Computer.FileSystem.GetFiles(video_card_dir, Microsoft.VisualBasic.FileIO.SearchOption.SearchAllSubDirectories, "*.MTS")

           Dim foundFileInfo As New System.IO.FileInfo(foundFile)
           My.Computer.FileSystem.MoveFile(foundFile, new_video_directory & foundFileInfo.Name)


       Next

       For Each foundFile As String In My.Computer.FileSystem.GetFiles(video_card_dir, Microsoft.VisualBasic.FileIO.SearchOption.SearchAllSubDirectories, "*.MTS")

           Dim movedFileInfo As New System.IO.FileInfo(foundFile)
           psi.Arguments = "ffmpeg -i " & movedFileInfo & " -vcodec -c libx264 " & movedFileInfo & ".mp4"
           psi.ToString()

           'proc = Process.Start(psi)

           '***convert each MTS file in the new directory to MP4****
           'Writes filenames to merge.txt as " path\to\merge.txt ,               'file '  F:\path\to\               file1  .MP4         '"  so that ffmpeg can merge, then rename
           'My.Computer.FileSystem.WriteAllText(new_video_directory & "merge.txt", "file '" & movedFileInfo & ".mp4'" & vbCrLf, True)
           '>>>>need to add carriage return to text file

           'NOW CAPTURE FILENAMES OF MP4 and MERGE INTO 1 MP4 FILE

           '   merge all F:\path\to\merge.txt to merge the files & merge them
           'psi.Arguments = "ffmpeg -f concat -i " & new_video_directory & "merge.txt -c copy " & new_filename & ".mp4"
           proc = Process.Start(psi)

       Next

       '***END MERGE FILES***


       '~~~~~~~~~~~~~~~~~~~~~~~~~~~~* END - MOVE


       '***START CREATE STORAGE DIRECTORY STRUCTURE ***
       'Verify if the build # directory exists?
       If My.Computer.FileSystem.DirectoryExists(dir & Me.BUILD.Text) Then
           MessageBox.Show("The build directory exists, moving on to create subdirectories")
       Else
           Try
               'create the new directory                F:\    build \ FLIGHT #
               My.Computer.FileSystem.CreateDirectory(dir & Me.BUILD.Text)
               MessageBox.Show("The build directory" & dir & Me.BUILD.Text & " was created.")
           Catch ex As Exception
               MessageBox.Show("Doh! The build directory could not be created!  Error: " & ex.Message, "Error creating directory.", _
                               MessageBoxButtons.OK, MessageBoxIcon.Error)
           End Try

       End If

       'verify if the flight num directory exists - or create it
       If My.Computer.FileSystem.DirectoryExists(new_flightnum_directory) Then
           MessageBox.Show("The flight # folder already exists!  Check that you have the right Flight #.")
       Else
           Try
               'create the new directory                F:\  BUILD \  FLIGHT #
               My.Computer.FileSystem.CreateDirectory(new_flightnum_directory)

               'Now create new subDirectories  
               My.Computer.FileSystem.CreateDirectory(new_video_directory)

               MessageBox.Show("The new flight directory & video CAM subdirectories have been created!  The videos will be moved and files converted now which will take some time.")

           Catch ex As Exception
               MessageBox.Show("Doh! The flight num or CAM directory could not be created!  Error: " & ex.Message, "Error creating directory.", _
                               MessageBoxButtons.OK, MessageBoxIcon.Error)
           End Try
       End If


       '***END CREATE STORAGE DIRECTORY STRUCTURE ***  





       MessageBox.Show("new merged video file has been created in " & dir & Me.BUILD.Text & "\" & Me.CAM.Text)

    End Sub

    End Class

  • ffmpeg stops reading rtsp livestream after some seconds

    26 décembre 2020, par user3019668

    I'm trying to save locally a rtsp livestream with ffmpeg but it stops after a few seconds. It works smooth, but suddently it just stops, more or less always after 10-15 seconds.

    



    This is the command :

    



    ffmpeg -rtsp_transport tcp -i rtsp://xxx.xxx.xxx.xxx:554/test.sdp -c copy test.ts


    



    And this is the log. I tried with previous ffmpeg versions with the same result :

    



    ffmpeg version git-2020-04-26-1128aa8 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9.3.1 (GCC) 20200328
  configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libsrt --enable-libtheora --enable-libtwolame --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --enable-libspeex --enable-libxvid --enable-libaom --disable-w32threads --enable-libmfx --enable-ffnvcodec --enable-cuda-llvm --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --enable-dxva2 --enable-avisynth --enable-libopenmpt --enable-amf
  libavutil      56. 43.100 / 56. 43.100
  libavcodec     58. 82.100 / 58. 82.100
  libavformat    58. 42.101 / 58. 42.101
  libavdevice    58.  9.103 / 58.  9.103
  libavfilter     7. 79.100 /  7. 79.100
  libswscale      5.  6.101 /  5.  6.101
  libswresample   3.  6.100 /  3.  6.100
  libpostproc    55.  6.100 / 55.  6.100
Input #0, rtsp, from 'rtsp://xxx.xxx.xxx.xxx:554/test.sdp':
  Duration: N/A, start: 0.000000, bitrate: N/A
    Stream #0:0: Video: h264 (Main), yuv420p(top first), 1920x1080, 25 fps, 50 tbr, 90k tbn, 50 tbc
    Stream #0:1: Audio: aac (LC), 48000 Hz, 4.0, fltp
Output #0, mpegts, to 'test.ts':
  Metadata:
    encoder         : Lavf58.42.101
    Stream #0:0: Video: h264 (Main), yuv420p(top first), 1920x1080, q=2-31, 25 fps, 50 tbr, 90k tbn, 90k tbc
    Stream #0:1: Audio: aac (LC), 48000 Hz, 4.0, fltp
Stream mapping:
  Stream #0:0 -> #0:0 (copy)
  Stream #0:1 -> #0:1 (copy)
Press [q] to stop, [?] for help
frame=  387 fps= 21 q=-1.0 Lsize=   18405kB time=00:00:16.91 bitrate=8912.2kbits/s speed=0.923x
video:17295kB audio:575kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 2.993069%


    



    Debug shows also "No more output streams to write to, finishing" when it stops.

    



    Could you help me, please ? I don't know what else to try... Thank you.