Recherche avancée

Médias (3)

Mot : - Tags -/collection

Autres articles (53)

  • 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

  • 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" ;

  • Contribute to a better visual interface

    13 avril 2011

    MediaSPIP is based on a system of themes and templates. Templates define the placement of information on the page, and can be adapted to a wide range of uses. Themes define the overall graphic appearance of the site.
    Anyone can submit a new graphic theme or template and make it available to the MediaSPIP community.

Sur d’autres sites (6157)

  • Using ffmpeg with Python 2.7

    1er juillet 2015, par suffa

    I have been trying to install pyffmpeg in Python 2.7 unsuccessfully. I found a package for Python 2.6, but I can’t get it to work. So, I have been mulling around with 2.7. I’ve seen previous post from others on this site, but they have not helped. Does anyone have experience with this. Ultimately, I want to develop an wxPython app that converts video formats. Thanks

    Code that I ultimately wrote that worked for me (very rudimentary, but it works ....) :

    import wx
    import os
    import sys
    import time
    import datetime
    from wx.lib.delayedresult import startWorker



    class dConvert(wx.Frame):
       def __init__(self):
           wx.Frame.__init__(self, None, -1, 'd-Converter', size=(500, 310))
           panel = wx.Panel(self, wx.ID_ANY)#Creates a panel over the widget
           toolbar = self.CreateToolBar()
           toolbar.Realize()

           #Setup Menu
           #Setting up Menu
           menuFile = wx.Menu()
           menuFile.Append(1, "&About...")
           menuFile.AppendSeparator()
           menuFile.Append(2, "E&xit")
           menuBar = wx.MenuBar()
           menuBar.Append(menuFile, "&File")

           panel.SetBackgroundColour('WHITE')

           menu2 = wx.Menu()
           menu2.Append(5, "&.mpg to dvd", ".mpg to dvd")
           menu2.AppendSeparator()
           menu2.Append(wx.NewId(), "&Options...", "Options...")
           menuBar.Append(menu2, "&DVD")


           menu3 = wx.Menu()
           menu3.Append(7, "&Audio/Video Trim")
           #menu3.AppendSeparator()
           menuBar.Append(menu3, "Media")

           self.SetMenuBar(menuBar)
           self.Bind(wx.EVT_MENU, self.OnAbout, id=1)
           self.Bind(wx.EVT_MENU, self.OnQuit, id=2)
           self.Bind(wx.EVT_MENU, self.OnDVD, id=5)
           self.Bind(wx.EVT_MENU, self.OnMedia, id=7)

           #Add icon to frame
           iconFile = "dconverter_image.jpg"
           icon1 = wx.Icon(iconFile, wx.BITMAP_TYPE_JPEG)
           self.SetIcon(icon1)


           self.statusbar = self.CreateStatusBar()
           self.statusbar.SetStatusText("Convert Audio & Video")
           self.statusbar.SetFieldsCount(3)
           self.statusbar.SetStatusWidths([200, -2, -2])



           #Panel Text
           font = wx.Font(10, wx.DEFAULT, wx.NORMAL, wx.BOLD)
           font2 = wx.Font(7, wx.DEFAULT, wx.NORMAL, wx.BOLD)

           directory = wx.StaticText(panel, -1, 'Path: c:\\ffmpeg\\bin', (300, 13))
           directory.SetFont(font2)

           convertfile = wx.StaticText(panel, -1, 'File:', (270, 53))
           convertfile.SetFont(font)

           convertfile2 = wx.StaticText(panel, -1, 'Format:', (245, 83))
           convertfile2.SetFont(font)

           convertfile3 = wx.StaticText(panel, -1, 'Quality:', (244, 113))
           convertfile3.SetFont(font)

           convertfile4 = wx.StaticText(panel, -1, 'Presets:', (239, 143))
           convertfile4.SetFont(font)

           image_file = 'cd_rom.gif'
           bmp1 = wx.Image(image_file, wx.BITMAP_TYPE_ANY).ConvertToBitmap()
           panel.bitmap1 = wx.StaticBitmap(panel, -1, bmp1, (50, 30))



           self.formats1 = []


           #Select Media path    
           os.chdir("c:\\ffmpeg\\bin")
           wrkdir = os.getcwd()
           filelist = os.listdir(wrkdir)
           #self.formats1 = []

           for filename in filelist:
               (head, filename) = os.path.split(filename)
               if filename.endswith(".avi") or filename.endswith(".mp4") or filename.endswith(".mpg") or filename.endswith(".m4A") or filename.endswith(".MTS") or filename.endswith(".flv") or filename.endswith(".mov") or filename.endswith(".mpeg4") or filename.endswith(".mpeg") or filename.endswith(".mpg2") or filename.endswith(".mkv") or filename.endswith(".m4v") or filename.endswith(".wav") or filename.endswith(".mp3"):
               self.formats1.append(filename)


           self.format_combo1=wx.ComboBox(panel, size=(140, -1),value='Select Media', choices=self.formats1, style=wx.CB_DROPDOWN, pos=(300,50))
           self.Bind(wx.EVT_COMBOBOX, self.fileFormats, self.format_combo1)


           #Media Formats
           self.formats2 = ['Select Format', '.avi','.mpeg','.mp4','.flv','.mov','.m4a','.m4v','.mkv','.mpeg4','.mpg','.mpg2','.mp3','.ogg','.wav','.wma']

           self.format_combo2=wx.ComboBox(panel, size=(100, -1),value='Select Format', choices=self.formats2, style=wx.CB_SORT, pos=(300,81))

           #Media Quality
           self.formats3 = ['-sameq','-qmax']
           self.format_combo3=wx.ComboBox(panel, size=(100, -1),value='Select Quality', choices=self.formats3, style=wx.CB_DROPDOWN, pos=(300,111))



           #-qmax settings
           self.formats4 = ['1','2','3','4','5','6','7','8']
           self.format_combo4=wx.ComboBox(panel, size=(30, -1),value='0', choices=self.formats4, style=wx.CB_DROPDOWN, pos=(405,111))
           self.format_combo4.Disable()


           #Media Quality
           self.formats5 = ['Select Preset','video to mp3']
           self.format_combo5=wx.ComboBox(panel, size=(100, -1),value='Select Preset', choices=self.formats5, style=wx.CB_DROPDOWN, pos=(300,141))

           #Bit rate
           self.formats6 = ['128000', '160000', '180000', '192000']
           self.format_combo6=wx.ComboBox(panel, size=(47, -1),value='k/bs', choices=self.formats6, style=wx.CB_DROPDOWN, pos=(405,141))
           self.format_combo6.Disable()






           #Convert Button
           self.button = wx.Button(panel, label="Convert", pos=(300, 171), size=(80, 20))
           self.Bind(wx.EVT_BUTTON, self.convertButton, self.button)

           #Abort Button
           self.button2 = wx.Button(panel, label="Abort", pos=(385, 171), size=(80, 20))
           self.Bind(wx.EVT_BUTTON, self.OnAbortButton, self.button2)
           self.button2.Disable()

           #Refresh Button
           self.button3 = wx.Button(panel, label="Refresh", pos=(215, 171), size=(80, 20))
           self.Bind(wx.EVT_BUTTON, self.file_refresh, self.button3)


           #ComboBox Event
           self.Bind(wx.EVT_COMBOBOX, self.OncomboBox, self.format_combo3)
           self.Bind(wx.EVT_COMBOBOX, self.OncomboBox2, self.format_combo5)
           self.Bind(wx.EVT_COMBOBOX, self.OncomboBox3, self.format_combo2)



       def file_refresh(self, e):
           self.format_combo1.Clear()
           os.chdir("c:\\ffmpeg\\bin")
           wrkdir = os.getcwd()
           filelist = os.listdir(wrkdir)
           for m_files in filelist:
               if m_files.endswith(".avi") or m_files.endswith(".mp4") or m_files.endswith(".mpg") or m_files.endswith(".m4A") or m_files.endswith(".MTS") or m_files.endswith(".flv") or m_files.endswith(".mov") or m_files.endswith(".mpeg4") or m_files.endswith(".mpeg") or m_files.endswith(".mpg2") or m_files.endswith(".mkv") or m_files.endswith(".m4v") or m_files.endswith(".wav") or m_files.endswith(".mp3"):
               self.format_combo1.Append(m_files)



       def file_rename(self, f_name):
           ts = time.time()
           #Capture readable timestamp
           st = datetime.datetime.fromtimestamp(ts).strftime('%Y-%m-%d_%H-%M-%S')
           os.chdir("c:\\ffmpeg\\bin")
           wrkdir = os.getcwd()

           #get file extenstion from original file
           #fileName, fileExtension = os.path.splitext(wrkdir + '\\' + f_name)

           #add file extension to timestamp
           new_file = st

           return new_file



       def fileFormats(self, e):
           myFormats = {'audio': ('Select Format', '.m4a', '.mp3', '.ogg', '.wav', '.wma'), 'video': ('Select Format', '.avi', '.flv', '.mkv', '.m4v', '.mov', '.mpg', '.mpg2', '.mpeg4', '.mp4', '.mpeg')}
           bad_file = ['Media not supported']
           myFile = self.format_combo1.GetValue()
           f_exten = (x for x in myFormats['audio'] + myFormats['video'] if myFile.endswith(x))
       extension = f_exten.next()

           if extension in myFormats['audio']:
               self.format_combo2.SetItems(myFormats['audio'])

           elif extension in myFormats['video']:
               self.format_combo2.SetItems(myFormats['video'])
           else:
               self.format_combo2.SetItems(bad_file)


       def OnQuit(self, event):
           self.Close(True)

       def OnAbout(self, event):
           wx.MessageBox("d-Converter 1.0\n\n Developer: D.Monroe\n\nCopyright 2012",
                   "About d-Converter", wx.OK | wx.ICON_INFORMATION, self)


       def OncomboBox(self, e):
           quality=self.format_combo3.GetValue()
           if quality == '-qmax':
               self.format_combo4.Enable()

           else:
               self.format_combo4.Disable()



       def OncomboBox2(self, e):
           quality=self.format_combo5.GetValue()
           if quality != 'Select Preset':
               self.format_combo1.Enable()
               self.format_combo2.Disable()
               self.format_combo3.Disable()
               self.format_combo4.Disable()
               self.format_combo6.Enable()

           elif quality == 'Select Preset':
               self.format_combo1.Enable()
               self.format_combo2.Enable()
               self.format_combo3.Enable()
               self.format_combo4.Disable()
               self.format_combo5.Enable()
               self.format_combo6.Disable()

           elif quality == 'video to mp3':
               self.format_combo6.Enable()
               self.format_combo2.Disable()
               self.format_combo3.Disable()
               self.format_combo4.Disable()

       def OncomboBox3(self, e):
           v_format=self.format_combo2.GetValue()
           if v_format != 'Select Format':
               self.format_combo1.Enable()
               self.format_combo2.Enable()
               self.format_combo3.Enable()
               self.format_combo4.Enable()
               self.format_combo5.Disable()
               self.format_combo6.Disable()

           elif v_format == 'Select Format':
               self.format_combo1.Enable()
               self.format_combo2.Enable()
               self.format_combo3.Enable()
               self.format_combo4.Disable()
               self.format_combo5.Enable()
               self.format_combo6.Disable()





       def OnMedia(self, e):
           pass

       def OnDVD(self, e):
           """ Select a directory to search"""
           os.chdir("c:\\ffmpeg\\bin")
           wrkdir = os.getcwd()
           filelist = os.listdir(wrkdir)
           progdir = 'c:\\ffmpeg\\bin\\ffmpeg.exe' + ' -i '
           prog_dir = ' -target '
           progdir3 = '-dvd -ac 2 '
           vid_format = '.mpg'


           sampleList = []
           for filename in filelist:
              (head, filename) = os.path.split(filename)
              if filename.endswith(".avi") or filename.endswith(".flv") or filename.endswith(".mpeg") or filename.endswith(".mp4") or filename.endswith(".mov") or filename.endswith(".mpg2"):
               sampleList.append(filename)

           dlg = wx.SingleChoiceDialog(
                  self, "Files in c:\\ffmpeg\\bin", 'Select video to convert',
              sampleList,
              wx.CHOICEDLG_STYLE
              )

           if dlg.ShowModal() == wx.ID_OK:
               cur_item = dlg.GetStringSelection()
               s_string = cur_item
               #f_string = self.file_rename(s_string)
               f_string = s_string.replace(' ', '')





           dlg.Destroy()


           dlg2 = wx.SingleChoiceDialog(
                  self, "Files in c:\\ffmpeg\\bin", 'Select video standard ',
              ["pal", "ntsc"],
              wx.CHOICEDLG_STYLE
              )

           if dlg2.ShowModal() == wx.ID_OK:
               cur_item2 = dlg2.GetStringSelection()
               s_string2 = cur_item2
               self.button.Disable()
               self.button2.Enable()
               self.format_combo1.Disable()
               self.format_combo2.Disable()
               self.format_combo3.Disable()
               self.format_combo4.Disable()
               self.format_combo5.Disable()
               self.format_combo6.Disable()
               startWorker(self.LongTaskDone, self.LongTask4, wargs=(progdir, wrkdir, prog_dir, progdir3, f_string, s_string2, vid_format))


           dlg2.Destroy()






       def convertButton(self, e):
           unit1 = self.format_combo1.GetValue()
           unit2 = self.format_combo2.GetValue()
           unit3 = self.format_combo3.GetValue()
           unit4 = None
           unit5 = self.format_combo5.GetValue()
           bitRate = self.format_combo6.GetValue()
           unit6 = bitRate
           if unit3 == '-qmax':
               unit4 = self.format_combo4.GetValue()
           else:
               pass

           os.chdir("c:\\ffmpeg\\bin")
           wrkdir = os.getcwd()

           newfile = unit1



           #stripped = os.path.splitext(newfile)[0] # Updated 9/26/2013 to strip extension.
           #stripped = newfile.strip('mpeg3kaviovfl4w2c.') #Strips the extension from the original file name
           stripped = self.file_rename(newfile)

           #os.rename(newfile, newfile_f)



           progname='c:\\ffmpeg\\bin\\ffmpeg.exe' + ' -i '

           preset1_a='-vn -ar 44100 -ac 2 -ab'
           preset1_b='-f mp3 '
           preset_mp3='.mp3'







            if (unit1 == 'Select Media' or unit1 == ''):
                       amsg = wx.MessageDialog(None, 'You must select a media file!', 'Media Converter', wx.ICON_INFORMATION)
                       amsg.ShowModal()
                       amsg.Destroy()



            elif (unit1 != 'Select Media' or unit1 != '') and (unit5 == 'Select Preset'):

                if (unit2 == 'Select Format' or unit2 == ''):
                   amsg = wx.MessageDialog(None, 'You must select a format', 'Media Converter', wx.ICON_INFORMATION)
                   amsg.ShowModal()
                   amsg.Destroy()

                   self.format_combo3.Enable()
                   self.format_combo4.Enable()
                   self.format_combo5.Enable()

               else:
                   pass

               if (unit3 == 'Select Quality' or unit3 == ''):
                   amsg = wx.MessageDialog(None, 'You must select quality', 'Media Converter', wx.ICON_INFORMATION)
                   amsg.ShowModal()
                   amsg.Destroy()


               elif (unit3 == '-qmax'):
                   if (unit4 == '0' or unit4 == ''):
                       amsg = wx.MessageDialog(None, 'You must select number between 1-8.', 'Media Converter', wx.ICON_INFORMATION)
                       amsg.ShowModal()
                       amsg.Destroy()
                   else:
                       self.button.Disable()
                       self.button2.Enable()
                       pass

               else:
                   self.button.Disable()
                   self.button2.Enable()
                   self.format_combo1.Disable()
                   self.format_combo2.Disable()
                   self.format_combo3.Disable()
                   self.format_combo4.Disable()
                   startWorker(self.LongTaskDone, self.LongTask, wargs=(progname,wrkdir,unit1,unit3,stripped,unit2))





           elif (unit1 != 'Select Media' or unit1 != '') and (unit5 == 'video to mp3'):
               if unit6 == 'k/bs' or unit6 == None:
                   amsg = wx.MessageDialog(None, 'You must select a bit rate.', 'Media Converter', wx.ICON_INFORMATION)
                   amsg.ShowModal()
                   amsg.Destroy()

               else:
                   self.button.Disable()
                   self.button2.Enable()
                   self.format_combo1.Disable()
                   self.format_combo2.Disable()
                   self.format_combo3.Disable()
                   self.format_combo4.Disable()
                   self.format_combo5.Disable()
                   self.format_combo6.Disable()
                   startWorker(self.LongTaskDone, self.LongTask3, wargs=(progname, wrkdir, unit1, preset1_a, unit6, preset1_b, stripped, preset_mp3))











       def LongTask(self, progname, wrkdir, unit1, unit3, stripped, unit2):
           convert_file1 = progname + wrkdir + '\\' + unit1 + ' ' + unit3 + ' ' + stripped + unit2
           self.statusbar.SetStatusText("Converting: " + unit1 + "...")
           os.system(convert_file1)
           print convert_file1





       def LongTask2(self, progname, wrkdir, unit1, unit3, unit4, stripped, unit2):
           convert_file2 = progname + wrkdir + '\\' + unit1 + ' ' + unit3 + ' ' + unit4 + ' ' + stripped + unit2
           self.statusbar.SetStatusText("Converting: " + unit1 + "...")
           os.system(convert_file2)


       def LongTask3(self, progname, wrkdir, unit1, preset1_a, unit6, preset1_b, stripped, preset_mp3):
           convert_file3 = progname + wrkdir + '\\' + unit1 + ' ' + preset1_a + ' ' + unit6 + ' ' + preset1_b + stripped + preset_mp3
           self.statusbar.SetStatusText("Converting: " + unit1 + "...")
           os.system(convert_file3)

       def LongTask4(self, progdir, wrkdir, prog_dir, progdir3, f_string, s_string2, vid_format):
           #convert_file4 = progdir + wrkdir + '\\' + s_string + prog_dir + s_string2 + progdir3 + s_string.strip('mpegaviw24ofl.') + vid_format
           convert_file4 = progdir + f_string + prog_dir + s_string2 + progdir3 + f_string.strip('mpegaviw24ofl.') + vid_format
           self.statusbar.SetStatusText("Converting: " + f_string + "...")
           os.system(convert_file4)
           print convert_file4



       def LongTaskDone(self, result):
           r = result.get()
           if r:
               amsg = wx.MessageDialog(None, 'Aborted!', 'Media Converter', wx.ICON_INFORMATION)
               self.statusbar.SetStatusText("Convert Aborted ...")
               amsg.ShowModal()
               amsg.Destroy()
               self.LongTask.terminate()
           else:
               self.statusbar.SetStatusText("Done ...")
               emsg = wx.MessageDialog(None, 'Finished Converting!', 'Media Converter', wx.ICON_INFORMATION)
               emsg.ShowModal()
               emsg.Destroy()
               self.format_combo1.Enable()
               self.format_combo2.Enable()
               self.format_combo3.Enable()
               self.format_combo5.Enable()
               self.format_combo4.Disable()
               self.format_combo6.Disable()
               self.button.Enable()
               self.button2.Disable()
               self.shouldAbort = False
           """self.progress_bar.SetValue(0)
           self.progress_bar.Hide()"""



       def OnAbortButton(self, e):
           endprogram = 'c:\\Windows\\System32\\taskkill /IM cmd.exe'
           os.system(endprogram)
           self.format_combo1.Enable()
           self.format_combo2.Enable()
           self.format_combo3.Enable()
           self.format_combo5.Enable()
           self.button.Enable()




    if __name__ == '__main__':
       app = wx.PySimpleApp()
       frame = dConvert()
       frame.SetSizeHints(500,310,500,310)
       frame.Show()
       app.MainLoop()
  • getting errors from FFMpeg when spawned from .NET

    18 mars 2014, par Brannon

    When I run FFMpeg from the command line like this

    ffmpeg.exe -hwaccel auto -re -i "C:\Users\Public\Videos\Sample Videos\Wildlife.wmv" -an -sn -c:v bmp -pix_fmt bgr24 -f rawvideo - > junk.bin

    it works fine. However, when I spawn the exact same thing (minus > junk.bin) I get this nasty "bad header" error after a few seconds of playback. What is causing this ? I have trouble believing my process blocks the pipe longer than the filesystem does, but it should be able to block the pipe indefinitely without defeating the decoding. The truncated stderr is below. My code to spawn the thing is here.

    ffmpeg version N-60761-g916a792 Copyright (c) 2000-2014 the FFmpeg developers
     built on Feb 19 2014 21:57:22 with gcc 4.8.2 (GCC)
     configuration: --target-os=mingw32 --enable-shared --enable-runtime-cpudetect
     libavutil      52. 65.100 / 52. 65.100
     libavcodec     55. 52.102 / 55. 52.102
     libavformat    55. 33.100 / 55. 33.100
     libavdevice    55. 10.100 / 55. 10.100
     libavfilter     4.  1.103 /  4.  1.103
     libswscale      2.  5.101 /  2.  5.101
     libswresample   0. 17.104 /  0. 17.104
    cygwin warning:
     MS-DOS style path detected: C:\Users\Public\Videos\Sample Videos\Wildlife.wmv
     Preferred POSIX equivalent is: /cygdrive/c/Users/Public/Videos/Sample Videos/Wildlife.wmv
     CYGWIN environment variable option "nodosfilewarning" turns off this warning.
     Consult the user's guide for more details about POSIX paths:
       http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
    [asf @ 0x600059480] Stream #0: not enough frames to estimate rate; consider increasing probesize
    Guessed Channel Layout for  Input Stream #0.0 : stereo
    Input #0, asf, from 'C:\Users\Public\Videos\Sample Videos\Wildlife.wmv':
     Metadata:
       SfOriginalFPS   : 299700
       WMFSDKVersion   : 11.0.6001.7000
       WMFSDKNeeded    : 0.0.0.0000
       comment         : Footage: Small World Productions, Inc; Tourism New Zealand | Producer: Gary F. Spradling | Music: Steve Ball
       title           : Wildlife in HD
       copyright       : © 2008 Microsoft Corporation
       IsVBR           : 0
       DeviceConformanceTemplate: AP@L3
     Duration: 00:00:30.09, start: 0.000000, bitrate: 6977 kb/s
       Stream #0:0(eng): Audio: wmav2 (a[1][0][0] / 0x0161), 44100 Hz, stereo, fltp, 192 kb/s
       Stream #0:1(eng): Video: vc1 (Advanced) (WVC1 / 0x31435657), yuv420p, 1280x720, 5942 kb/s, 29.97 tbr, 1k tbn, 1k tbc
    Output #0, rawvideo, to 'pipe:':
     Metadata:
       SfOriginalFPS   : 299700
       WMFSDKVersion   : 11.0.6001.7000
       WMFSDKNeeded    : 0.0.0.0000
       comment         : Footage: Small World Productions, Inc; Tourism New Zealand | Producer: Gary F. Spradling | Music: Steve Ball
       title           : Wildlife in HD
       copyright       : © 2008 Microsoft Corporation
       IsVBR           : 0
       DeviceConformanceTemplate: AP@L3
       encoder         : Lavf55.33.100
       Stream #0:0(eng): Video: bmp, bgr24, 1280x720, q=2-31, 200 kb/s, 90k tbn, 29.97 tbc
    Stream mapping:
     Stream #0:1 -> #0:0 (vc1 -> bmp)
    Press [q] to stop, [?] for help
    frame=    3 fps=0.0 q=0.0 size=    8100kB time=00:00:00.10 bitrate=662902.1kbits/s    
    frame=   29 fps= 26 q=0.0 size=   78302kB time=00:00:00.96 bitrate=662902.3kbits/s    
    frame=   50 fps= 30 q=0.0 size=  135003kB time=00:00:01.66 bitrate=662902.2kbits/s    
    frame=   65 fps= 30 q=0.0 size=  175503kB time=00:00:02.16 bitrate=662902.2kbits/s    
    frame=   80 fps= 30 q=0.0 size=  216004kB time=00:00:02.66 bitrate=662902.1kbits/s    
    frame=   95 fps= 30 q=0.0 size=  256505kB time=00:00:03.16 bitrate=662902.1kbits/s    
    [asf @ 0x600059480] ff asf bad header 74  at:5053733
    [asf @ 0x600059480] invalid packet_length -1908511255 at:5053740
    [asf @ 0x600059480] ff asf bad header d4  at:5053759
    [asf @ 0x600059480] ff asf skip 55629 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5181733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5189733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5197733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5205733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5213733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5221733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5229733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5237733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5245733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5357733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5365733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5373733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5381733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5493733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5501733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5509733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5517733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5629733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5637733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5645733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5653733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5701733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5709733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5717733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5725733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5805733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5813733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5821733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5829733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5877733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5885733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5893733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5901733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5949733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5957733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5965733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] ff asf bad header 0  at:5973733
    [asf @ 0x600059480] ff asf skip 7991 (unknown stream)
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 15 times
    [asf @ 0x600059480] unexpected packet_replic_size of 2
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 7 times
    [asf @ 0x600059480] ff asf skip 2562 (unknown stream)
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 3 times
    [asf @ 0x600059480] ff asf skip 448 (unknown stream)
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 9 times
    [asf @ 0x600059480] unexpected packet_replic_size of 6
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 7 times
    [asf @ 0x600059480] packet_frag_size is invalid (1749-9)
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 13 times
    [asf @ 0x600059480] packet_frag_size is invalid (1749-9)
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 24 times
    [asf @ 0x600059480] unexpected packet_replic_size of 6
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 6 times
    [asf @ 0x600059480] unexpected packet_replic_size of 5
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 6 times
    [asf @ 0x600059480] packet_frag_size is invalid (1749-9)
    [asf @ 0x600059480] packet_obj_size invalid
    [asf @ 0x600059480] packet_frag_size is invalid (1749-9)
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 2 times
    [asf @ 0x600059480] unexpected packet_replic_size of 5
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 8 times
    [asf @ 0x600059480] unexpected packet_replic_size of 5
    [asf @ 0x600059480] packet_obj_size invalid
       Last message repeated 39 times
    [asf @ 0x600059480] packet_frag_size is invalid (1749-40)
  • Building FFMpeg 1.0.1 for Android gives me an error with make install

    23 décembre 2013, par Fabien Henon

    I'm trying to build FFMpeg 1.0.1 for Android.

    I followed this tutorial : http://www.packtpub.com/sites/default/files/downloads/Developing_Multimedia_Applications_with_NDK.pdf (part Porting the ffmpeg library to Android with NDK).

    Thus, in my ffmpeg folder I have a script build_android.sh and here is the content :

    #!/bin/bash
    NDK=/Users/me/android-ndk
    SYSROOT=$NDK/platforms/android-8/arch-arm/
    TOOLCHAIN=$NDK/toolchains/arm-linux-androideabi-4.6/prebuilt/darwin-x86_64
    function build_one
    {
    ./configure \
    --prefix=$PREFIX \
    --disable-shared \
    --enable-static \
    --disable-doc \
    --disable-ffmpeg \
    --disable-ffplay \
    --disable-ffprobe \
    --disable-ffserver \
    --disable-avdevice \
    --disable-doc \
    --disable-symver \
    --cross-prefix=$TOOLCHAIN/bin/arm-linux-androideabi- \
    --target-os=linux \
    --arch=arm \
    --enable-cross-compile \
    --sysroot=$SYSROOT \
    --extra-cflags="-Os -fpic $ADDI_CFLAGS" \
    --extra-ldflags="$ADDI_LDFLAGS" \
    $ADDITIONAL_CONFIGURE_FLAG
    make clean
    make
    make install
    }
    CPU=arm
    PREFIX=$(pwd)/android/$CPU
    ADDI_CFLAGS="-marm"
    build_one

    That was working fine mith version 2.1 of ffmpeg but with version 1.0.1 and other versions it does not work.

    I have the following error :

    ...
    CC  libavutil/random_seed.o
    CC  libavutil/rational.o
    CC  libavutil/rc4.o
    CC  libavutil/samplefmt.o
    CC  libavutil/sha.o
    CC  libavutil/time.o
    CC  libavutil/timecode.o
    CC  libavutil/tree.o
    CC  libavutil/utils.o
    CC  libavutil/xtea.o
    AR  libavutil/libavutil.a
    INSTALL libavfilter/libavfilter.a
    ./install: line 2: syntax error near unexpected token `)'
    ./install: line 2: `1) Type './configure' to create the configuration. A list of configure'
    make: *** [install-libavfilter-static] Error 2

    I'm using NDK 9r and Mac OSX.

    So the configure command works fine, the make commmand too, but the make install is not working and is giving me the error.

    Can you help me with this issue ?

    For you information, ./install is (in my opinion) the INSTALL file which has this content :

    1) Type './configure' to create the configuration. A list of configure
    options is printed by running 'configure --help'.

    'configure' can be launched from a directory different from the FFmpeg
    sources to build the objects out of tree. To do this, use an absolute
    path when launching 'configure', e.g. '/ffmpegdir/ffmpeg/configure'.

    2) Then type 'make' to build FFmpeg. GNU Make 3.81 or later is required.

    3) Type 'make install' to install all binaries and libraries you built.

    NOTICE

    - Non system dependencies (e.g. libx264, libvpx) are disabled by default.

    I don't know why make install tries to execute this file. Here is the content of the Makefile :

    MAIN_MAKEFILE=1
    include config.mak

    vpath %.c    $(SRC_PATH)
    vpath %.cpp  $(SRC_PATH)
    vpath %.h    $(SRC_PATH)
    vpath %.S    $(SRC_PATH)
    vpath %.asm  $(SRC_PATH)
    vpath %.v    $(SRC_PATH)
    vpath %.texi $(SRC_PATH)
    vpath %/fate_config.sh.template $(SRC_PATH)

    PROGS-$(CONFIG_FFMPEG)   += ffmpeg
    PROGS-$(CONFIG_FFPLAY)   += ffplay
    PROGS-$(CONFIG_FFPROBE)  += ffprobe
    PROGS-$(CONFIG_FFSERVER) += ffserver

    PROGS      := $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
    INSTPROGS   = $(PROGS-yes:%=%$(PROGSSUF)$(EXESUF))
    OBJS        = cmdutils.o
    OBJS-ffmpeg = ffmpeg_opt.o ffmpeg_filter.o
    TESTTOOLS   = audiogen videogen rotozoom tiny_psnr base64
    HOSTPROGS  := $(TESTTOOLS:%=tests/%) doc/print_options
    TOOLS       = qt-faststart trasher
    TOOLS-$(CONFIG_ZLIB) += cws2fws

    BASENAMES   = ffmpeg ffplay ffprobe ffserver
    ALLPROGS    = $(BASENAMES:%=%$(PROGSSUF)$(EXESUF))
    ALLPROGS_G  = $(BASENAMES:%=%$(PROGSSUF)_g$(EXESUF))
    ALLMANPAGES = $(BASENAMES:%=%.1)

    FFLIBS-$(CONFIG_AVDEVICE) += avdevice
    FFLIBS-$(CONFIG_AVFILTER) += avfilter
    FFLIBS-$(CONFIG_AVFORMAT) += avformat
    FFLIBS-$(CONFIG_AVRESAMPLE) += avresample
    FFLIBS-$(CONFIG_AVCODEC)  += avcodec
    FFLIBS-$(CONFIG_POSTPROC) += postproc
    FFLIBS-$(CONFIG_SWRESAMPLE)+= swresample
    FFLIBS-$(CONFIG_SWSCALE)  += swscale

    FFLIBS := avutil

    DATA_FILES := $(wildcard $(SRC_PATH)/presets/*.ffpreset) $(SRC_PATH)/doc/ffprobe.xsd
    EXAMPLES_FILES := $(wildcard $(SRC_PATH)/doc/examples/*.c) $(SRC_PATH)/doc/examples/Makefile

    SKIPHEADERS = cmdutils_common_opts.h

    include $(SRC_PATH)/common.mak

    FF_EXTRALIBS := $(FFEXTRALIBS)
    FF_DEP_LIBS  := $(DEP_LIBS)

    all: $(PROGS)

    $(PROGS): %$(EXESUF): %_g$(EXESUF)
       $(CP) $< $@
       $(STRIP) $@

    $(TOOLS): %$(EXESUF): %.o
       $(LD) $(LDFLAGS) $(LD_O) $< $(ELIBS)

    tools/cws2fws$(EXESUF): ELIBS = $(ZLIB)

    config.h: .config
    .config: $(wildcard $(FFLIBS:%=$(SRC_PATH)/lib%/all*.c))
       @-tput bold 2>/dev/null
       @-printf '\nWARNING: $(?F) newer than config.h, rerun configure\n\n'
       @-tput sgr0 2>/dev/null

    SUBDIR_VARS := CLEANFILES EXAMPLES FFLIBS HOSTPROGS TESTPROGS TOOLS      \
                  ARCH_HEADERS BUILT_HEADERS SKIPHEADERS                    \
                  ARMV5TE-OBJS ARMV6-OBJS ARMVFP-OBJS NEON-OBJS             \
                  MMI-OBJS ALTIVEC-OBJS VIS-OBJS                            \
                  MMX-OBJS YASM-OBJS                                        \
                  MIPSFPU-OBJS MIPSDSPR2-OBJS MIPSDSPR1-OBJS MIPS32R2-OBJS  \
                  OBJS HOSTOBJS TESTOBJS

    define RESET
    $(1) :=
    $(1)-yes :=
    endef

    define DOSUBDIR
    $(foreach V,$(SUBDIR_VARS),$(eval $(call RESET,$(V))))
    SUBDIR := $(1)/
    include $(SRC_PATH)/$(1)/Makefile
    -include $(SRC_PATH)/$(1)/$(ARCH)/Makefile
    include $(SRC_PATH)/library.mak
    endef

    $(foreach D,$(FFLIBS),$(eval $(call DOSUBDIR,lib$(D))))

    define DOPROG
    OBJS-$(1) += $(1).o
    $(1)$(PROGSSUF)_g$(EXESUF): $(OBJS-$(1))
    $$(OBJS-$(1)): CFLAGS  += $(CFLAGS-$(1))
    $(1)$(PROGSSUF)_g$(EXESUF): LDFLAGS += $(LDFLAGS-$(1))
    $(1)$(PROGSSUF)_g$(EXESUF): FF_EXTRALIBS += $(LIBS-$(1))
    -include $$(OBJS-$(1):.o=.d)
    endef

    $(foreach P,$(PROGS-yes),$(eval $(call DOPROG,$(P))))

    %$(PROGSSUF)_g$(EXESUF): %.o cmdutils.o $(FF_DEP_LIBS)
       $(LD) $(LDFLAGS) $(LD_O) $(OBJS-$*) cmdutils.o $(FF_EXTRALIBS)

    OBJDIRS += tools

    -include $(wildcard tools/*.d)

    VERSION_SH  = $(SRC_PATH)/version.sh
    GIT_LOG     = $(SRC_PATH)/.git/logs/HEAD

    .version: $(wildcard $(GIT_LOG)) $(VERSION_SH) config.mak
    .version: M=@

    version.h .version:
       $(M)$(VERSION_SH) $(SRC_PATH) version.h $(EXTRA_VERSION)
       $(Q)touch .version

    # force version.sh to run whenever version might have changed
    -include .version

    ifdef PROGS
    install: install-progs install-data
    endif

    install: install-libs install-headers

    install-libs: install-libs-yes

    install-progs-yes:
    install-progs-$(CONFIG_SHARED): install-libs

    install-progs: install-progs-yes $(PROGS)
       $(Q)mkdir -p "$(BINDIR)"
       $(INSTALL) -c -m 755 $(INSTPROGS) "$(BINDIR)"

    install-data: $(DATA_FILES) $(EXAMPLES_FILES)
       $(Q)mkdir -p "$(DATADIR)/examples"
       $(INSTALL) -m 644 $(DATA_FILES) "$(DATADIR)"
       $(INSTALL) -m 644 $(EXAMPLES_FILES) "$(DATADIR)/examples"

    uninstall: uninstall-libs uninstall-headers uninstall-progs uninstall-data

    uninstall-progs:
       $(RM) $(addprefix "$(BINDIR)/", $(ALLPROGS))

    uninstall-data:
       $(RM) -r "$(DATADIR)"

    clean::
       $(RM) $(ALLPROGS) $(ALLPROGS_G)
       $(RM) $(CLEANSUFFIXES)
       $(RM) $(TOOLS)
       $(RM) $(CLEANSUFFIXES:%=tools/%)
       $(RM) coverage.info
       $(RM) -r coverage-html

    distclean::
       $(RM) $(DISTCLEANSUFFIXES)
       $(RM) config.* .version version.h libavutil/avconfig.h libavcodec/codec_names.h

    config:
       $(SRC_PATH)/configure $(value FFMPEG_CONFIGURATION)

    # Without the sed genthml thinks "libavutil" and "./libavutil" are two different things
    coverage.info: $(wildcard *.gcda *.gcno */*.gcda */*.gcno */*/*.gcda */*/*.gcno)
       $(Q)lcov -c -d . -b . | sed -e 's#/./#/#g' > $@

    coverage-html: coverage.info
       $(Q)mkdir -p $@
       $(Q)genhtml -o $@ $<
       $(Q)touch $@

    check: all alltools examples testprogs fate

    include $(SRC_PATH)/doc/Makefile
    include $(SRC_PATH)/tests/Makefile

    $(sort $(OBJDIRS)):
       $(Q)mkdir -p $@

    # Dummy rule to stop make trying to rebuild removed or renamed headers
    %.h:
       @:

    # Disable suffix rules.  Most of the builtin rules are suffix rules,
    # so this saves some time on slow systems.
    .SUFFIXES:

    .PHONY: all all-yes alltools check *clean config install*
    .PHONY: testprogs uninstall*