Recherche avancée

Médias (0)

Mot : - Tags -/diogene

Aucun média correspondant à vos critères n’est disponible sur le site.

Autres articles (73)

  • Configurer la prise en compte des langues

    15 novembre 2010, par

    Accéder à la configuration et ajouter des langues prises en compte
    Afin de configurer la prise en compte de nouvelles langues, il est nécessaire de se rendre dans la partie "Administrer" du site.
    De là, dans le menu de navigation, vous pouvez accéder à une partie "Gestion des langues" permettant d’activer la prise en compte de nouvelles langues.
    Chaque nouvelle langue ajoutée reste désactivable tant qu’aucun objet n’est créé dans cette langue. Dans ce cas, elle devient grisée dans la configuration et (...)

  • Les formats acceptés

    28 janvier 2010, par

    Les commandes suivantes permettent d’avoir des informations sur les formats et codecs gérés par l’installation local de ffmpeg :
    ffmpeg -codecs ffmpeg -formats
    Les format videos acceptés en entrée
    Cette liste est non exhaustive, elle met en exergue les principaux formats utilisés : h264 : H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 m4v : raw MPEG-4 video format flv : Flash Video (FLV) / Sorenson Spark / Sorenson H.263 Theora wmv :
    Les formats vidéos de sortie possibles
    Dans un premier temps on (...)

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

Sur d’autres sites (7243)

  • FFMPEG error with avformat_open_input returning -135

    28 avril 2015, par LawfulEvil

    I have a DLL one of my applications uses to receive video from RTSP cameras. Under the hood, the DLL uses FFMPEG libs from this release zip :

    ffmpeg-20141022-git-6dc99fd-win64-shared.7z

    We have a wide variety of cameras in house and most of them work just fine. However, on one particular Pelco Model Number : IXE20DN-OCP, I am unable to connect. I tested the camera and rtsp connection string on VLC and it connects to the camera just fine.

    I found the connection string here : http://www.ispyconnect.com/man.aspx?n=Pelco

    rtsp://IPADDRESS:554/1/stream1

    Oddly, even if I leave the port off of VLC, it connects, so I’m guessing its the default RTSP port or that VLC tries a variety of things based on your input.

    In any case, when I attempt to connect, I get an error from av_format_open_input. It returns a code of -135. When I looked in the error code list I didn’t see that listed. For good measure, I printed out all the errors in error.h just to see what their values were.

    DumpErrorCodes - Error Code : AVERROR_BSF_NOT_FOUND = -1179861752
    DumpErrorCodes - Error Code : AVERROR_BUG = -558323010
    DumpErrorCodes - Error Code : AVERROR_BUFFER_TOO_SMALL = -1397118274
    DumpErrorCodes - Error Code : AVERROR_DECODER_NOT_FOUND = -1128613112
    DumpErrorCodes - Error Code : AVERROR_DEMUXER_NOT_FOUND = -1296385272
    DumpErrorCodes - Error Code : AVERROR_ENCODER_NOT_FOUND = -1129203192
    DumpErrorCodes - Error Code : AVERROR_EOF = -541478725
    DumpErrorCodes - Error Code : AVERROR_EXIT = -1414092869
    DumpErrorCodes - Error Code : AVERROR_EXTERNAL = -542398533
    DumpErrorCodes - Error Code : AVERROR_FILTER_NOT_FOUND = -1279870712
    DumpErrorCodes - Error Code : AVERROR_INVALIDDATA = -1094995529
    DumpErrorCodes - Error Code : AVERROR_MUXER_NOT_FOUND = -1481985528
    DumpErrorCodes - Error Code : AVERROR_OPTION_NOT_FOUND = -1414549496
    DumpErrorCodes - Error Code : AVERROR_PATCHWELCOME = -1163346256
    DumpErrorCodes - Error Code : AVERROR_PROTOCOL_NOT_FOUND = -1330794744
    DumpErrorCodes - Error Code : AVERROR_STREAM_NOT_FOUND = -1381258232
    DumpErrorCodes - Error Code : AVERROR_BUG2 = -541545794
    DumpErrorCodes - Error Code : AVERROR_UNKNOWN = -1313558101
    DumpErrorCodes - Error Code : AVERROR_EXPERIMENTAL = -733130664
    DumpErrorCodes - Error Code : AVERROR_INPUT_CHANGED = -1668179713
    DumpErrorCodes - Error Code : AVERROR_OUTPUT_CHANGED = -1668179714
    DumpErrorCodes - Error Code : AVERROR_HTTP_BAD_REQUEST = -808465656
    DumpErrorCodes - Error Code : AVERROR_HTTP_UNAUTHORIZED = -825242872
    DumpErrorCodes - Error Code : AVERROR_HTTP_FORBIDDEN = -858797304
    DumpErrorCodes - Error Code : AVERROR_HTTP_NOT_FOUND = -875574520
    DumpErrorCodes - Error Code : AVERROR_HTTP_OTHER_4XX = -1482175736
    DumpErrorCodes - Error Code : AVERROR_HTTP_SERVER_ERROR = -1482175992

    Nothing even close to -135. I did find this error, sort of on stack overflow, here runtime error when linking ffmpeg libraries in qt creator where the author claims it is a DLL loading problem error. I’m not sure what led him to think that, but I followed the advice and used the dependency walker (http://www.dependencywalker.com/) to checkout what dependencies it thought my DLL needed. It listed a few, but they were already provided in my install package.

    To make sure it was picking them up, I manually removed them from the install and observed a radical change in program behavior(that being my DLL didn’t load and start to run at all).

    So, I’ve got a bit of init code :

    void FfmpegInitialize()
    {
    av_lockmgr_register(&LockManagerCb);
    av_register_all();
    LOG_DEBUG0("av_register_all returned\n");
    }

    Then I’ve got my main open connection routine ...

    int RTSPConnect(const char *URL, int width, int height, frameReceived callbackFunction)
    {

       int errCode =0;
       if ((errCode = avformat_network_init()) != 0)
       {
           LOG_ERROR1("avformat_network_init returned error code %d\n", errCode);  
       }
       LOG_DEBUG0("avformat_network_init returned\n");
       //Allocate space and setup the the object to be used for storing all info needed for this connection
       fContextReadFrame = avformat_alloc_context(); // free'd in the Close method

       if (fContextReadFrame == 0)
       {
           LOG_ERROR1("Unable to set rtsp_transport options.   Error code = %d\n", errCode);
           return FFMPEG_OPTION_SET_FAILURE;
       }

       LOG_DEBUG1("avformat_alloc_context returned %p\n", fContextReadFrame);

       AVDictionary *opts = 0;
       if ((errCode = av_dict_set(&opts, "rtsp_transport", "tcp", 0)) < 0)
       {
           LOG_ERROR1("Unable to set rtsp_transport options.   Error code = %d\n", errCode);
           return FFMPEG_OPTION_SET_FAILURE;
       }
       LOG_DEBUG1("av_dict_set returned %d\n", errCode);

       //open rtsp
       DumpErrorCodes();
       if ((errCode = avformat_open_input(&fContextReadFrame, URL, NULL, &opts)) < 0)
       {
           LOG_ERROR2("Unable to open avFormat RF inputs.   URL = %s, and Error code = %d\n", URL, errCode);      
           LOG_ERROR2("Error Code %d = %s\n", errCode, errMsg(errCode));      
           // NOTE context is free'd on failure.
           return FFMPEG_FORMAT_OPEN_FAILURE;
       }
    ...

    To be sure I didn’t misunderstand the error code I printed the error message from ffmpeg but the error isn’t found and my canned error message is returned instead.

    My next step was going to be hooking up wireshark on my connection attempt and on the VLC connection attempt and trying to figure out what differences(if any) are causing the problem and what I can do to ffmpeg to make it work. As I said, I’ve got a dozen other cameras in house that use RTSP and they work with my DLL. Some utilize usernames/passwords/etc as well(so I know that isn’t the problem).

    Also, my run logs :

    FfmpegInitialize - av_register_all returned
    Open - Open called.  Pointers valid, passing control.
    Rtsp::RtspInterface::Open - Rtsp::RtspInterface::Open called
    Rtsp::RtspInterface::Open - VideoSourceString(35) = rtsp://192.168.14.60:554/1/stream1
    Rtsp::RtspInterface::Open - Base URL = (192.168.14.60:554/1/stream1)
    Rtsp::RtspInterface::Open - Attempting to open (rtsp://192.168.14.60:554/1/stream1) for WxH(320x240) video
    RTSPSetFormatH264 - RTSPSetFormatH264
    RTSPConnect - Called
    LockManagerCb - LockManagerCb invoked for op 1
    LockManagerCb - LockManagerCb invoked for op 2
    RTSPConnect - avformat_network_init returned
    RTSPConnect - avformat_alloc_context returned 019E6000
    RTSPConnect - av_dict_set returned 0
    DumpErrorCodes - Error Code : AVERROR_BSF_NOT_FOUND = -1179861752
    ...
    DumpErrorCodes - Error Code : AVERROR_HTTP_SERVER_ERROR = -1482175992
    RTSPConnect - Unable to open avFormat RF inputs.   URL = rtsp://192.168.14.60:554/1/stream1, and Error code = -135
    RTSPConnect - Error Code -135 = No Error Message Available

    I’m going to move forward with wireshark but would like to know the origin of the -135 error code from ffmpeg. When I look at the code if ’ret’ is getting set to -135, it must be happening as a result of the return code from a helper method and not directly in the avformat_open_input method.

    https://www.ffmpeg.org/doxygen/2.5/libavformat_2utils_8c_source.html#l00398

    After upgrading to the latest daily ffmpeg build, I get data on wireshark. Real Time Streaming Protocol :

    Request: SETUP rtsp://192.168.14.60/stream1/track1 RTSP/1.0\r\n
    Method: SETUP
    URL: rtsp://192.168.14.60/stream1/track1
    Transport: RTP/AVP/TCP;unicast;interleaved=0-1
    CSeq: 3\r\n
    User-Agent: Lavf56.31.100\r\n
    \r\n

    The response to that is the first ’error’ that I can detect in the initiation.

    Response: RTSP/1.0 461 Unsupported Transport\r\n
    Status: 461
    CSeq: 3\r\n
    Date: Sun, Jan 04 1970 16:03:05 GMT\r\n
    \r\n

    I’m going to guess that... it means the transport we selected was unsupported. I quick check of the code reveals I picked ’tcp’. Looking through the reply to the DESCRIBE command, it appears :

    Media Protocol: RTP/AVP

    Further, when SETUP is issued by ffmpeg, it specifies :

    Transport: RTP/AVP/TCP;unicast;interleaved=0-1

    I’m going to try, on failure here to pick another transport type and see how that works. Still don’t know where the -135 comes from.

  • vc1 : Use logical instead of bitwise or for twomv

    21 septembre 2014, par Michael Niedermayer
    vc1 : Use logical instead of bitwise or for twomv
    

    CC : libav-stable@libav.org
    Signed-off-by : Michael Niedermayer <michaelni@gmx.at>
    Signed-off-by : Tim Walker <tdskywalker@gmail.com>

    • [DH] libavcodec/vc1dec.c
  • Reverse Engineering Italian Literature

    1er juillet 2014, par Multimedia Mike — Reverse Engineering

    Some time ago, Diego “Flameeyes” Pettenò tried his hand at reverse engineering a set of really old CD-ROMs containing even older Italian literature. The goal of this RE endeavor would be to extract the useful literature along with any structural metadata (chapters, etc.) and convert it to a more open format suitable for publication at, e.g., Project Gutenberg or Archive.org.

    Unfortunately, the structure of the data thwarted the more simplistic analysis attempts (like inspecting for blocks of textual data). This will require deeper RE techniques. Further frustrating the effort, however, is the fact that the binaries that implement the reading program are written for the now-archaic Windows 3.1 operating system.

    In pursuit of this RE goal, I recently thought of a way to glean more intelligence using DOSBox.

    Prior Work
    There are 6 discs in the full set (distributed along with 6 sequential issues of a print magazine named L’Espresso). Analysis of the contents of the various discs reveals that many of the files are the same on each disc. It was straightforward to identify the set of files which are unique on each disc. This set of files all end with the extension “LZn”, where n = 1..6 depending on the disc number. Further, the root directory of each disc has a file indicating the sequence number (1..6) of the CD. Obviously, these are the interesting targets.

    The LZ file extensions stand out to an individual skilled in the art of compression– could it be a variation of the venerable LZ compression ? That’s actually unlikely because LZ — also seen as LIZ — stands for Letteratura Italiana Zanichelli (Zanichelli’s Italian Literature).

    The Unix ‘file’ command was of limited utility, unable to plausibly identify any of the files.

    Progress was stalled.

    Saying Hello To An Old Frenemy
    I have been showing this screenshot to younger coworkers to see if any of them recognize it :


    DOSBox running Window 3.1

    Not a single one has seen it before. Senior computer citizen status : Confirmed.

    I recently watched an Ancient DOS Games video about Windows 3.1 games. This episode showed Windows 3.1 running under DOSBox. I had heard this was possible but that it took a little work to get running. I had a hunch that someone else had probably already done the hard stuff so I took to the BitTorrent networks and quickly found a download that had the goods ready to go– a directory of Windows 3.1 files that just had to be dropped into a DOSBox directory and they would be ready to run.

    Aside : Running OS software procured from a BitTorrent network ? Isn’t that an insane security nightmare ? I’m not too worried since it effectively runs under a sandboxed virtual machine, courtesy of DOSBox. I suppose there’s the risk of trojan’d OS software infecting binaries that eventually leave the sandbox.

    Using DOSBox Like ‘strace’
    strace is a tool available on some Unix systems, including Linux, which is able to monitor the system calls that a program makes. In reverse engineering contexts, it can be useful to monitor an opaque, binary program to see the names of the files it opens and how many bytes it reads, and from which locations. I have written examples of this before (wow, almost 10 years ago to the day ; now I feel old for the second time in this post).

    Here’s the pitch : Make DOSBox perform as strace in order to serve as a platform for reverse engineering Windows 3.1 applications. I formed a mental model about how DOSBox operates — abstracted file system classes with methods for opening and reading files — and then jumped into the source code. Sure enough, the code was exactly as I suspected and a few strategic print statements gave me the data I was looking for.

    Eventually, I even took to running DOSBox under the GNU Debugger (GDB). This hasn’t proven especially useful yet, but it has led to an absurd level of nesting :


    GDB runs DOSBox runs Windows 3.1

    The target application runs under Windows 3.1, which is running under DOSBox, which is running under GDB. This led to a crazy situation in which DOSBox had the mouse focus when a GDB breakpoint was triggered. At this point, DOSBox had all desktop input focus and couldn’t surrender it because it wasn’t running. I had no way to interact with the Linux desktop and had to reboot the computer. The next time, I took care to only use the keyboard to navigate the application and trigger the breakpoint and not allow DOSBox to consume the mouse focus.

    New Intelligence

    By instrumenting the local file class (virtual HD files) and the ISO file class (CD-ROM files), I was able to watch which programs and dynamic libraries are loaded and which data files the code cares about. I was able to narrow down the fact that the most interesting programs are called LEGGENDO.EXE (‘reading’) and LEGGENDA.EXE (‘legend’ ; this has been a great Italian lesson as well as RE puzzle). The first calls the latter, which displays this view of the data we are trying to get at :


    LIZ: Authors index

    When first run, the program takes an interest in a file called DBBIBLIO (‘database library’, I suspect) :

    === Read(’LIZ98\DBBIBLIO.LZ1’) : req 337 bytes ; read 337 bytes from pos 0x0
    === Read(’LIZ98\DBBIBLIO.LZ1’) : req 337 bytes ; read 337 bytes from pos 0x151
    === Read(’LIZ98\DBBIBLIO.LZ1’) : req 337 bytes ; read 337 bytes from pos 0x2A2
    [...]
    

    While we were unable to sort out all of the data files in our cursory investigation, a few things were obvious. The structure of this file looked to contain 336-byte records. Turns out I was off by 1– the records are actually 337 bytes each. The count of records read from disc is equal to the number of items shown in the UI.

    Next, the program is interested in a few more files :

    *** isoFile() : ’DEPOSITO\BLOKCTC.LZ1’, offset 0x27D6000, 2911488 bytes large
    === Read(’DEPOSITO\BLOKCTC.LZ1’) : req 96 bytes ; read 96 bytes from pos 0x0
    *** isoFile() : ’DEPOSITO\BLOKCTX0.LZ1’, offset 0x2A9D000, 17152 bytes large
    === Read(’DEPOSITO\BLOKCTX0.LZ1’) : req 128 bytes ; read 128 bytes from pos 0x0
    === Seek(’DEPOSITO\BLOKCTX0.LZ1’) : seek 384 (0x180) bytes, type 0
    === Read(’DEPOSITO\BLOKCTX0.LZ1’) : req 256 bytes ; read 256 bytes from pos 0x180
    === Seek(’DEPOSITO\BLOKCTC.LZ1’) : seek 1152 (0x480) bytes, type 0
    === Read(’DEPOSITO\BLOKCTC.LZ1’) : req 32 bytes ; read 32 bytes from pos 0x480
    === Read(’DEPOSITO\BLOKCTC.LZ1’) : req 1504 bytes ; read 1504 bytes from pos 0x4A0
    [...]

    Eventually, it becomes obvious that BLOKCTC has the juicy meat. There are 32-byte records followed by variable-length encoded text sections. Since there is no text to be found in these files, the text is either compressed, encrypted, or both. Some rough counting (the program seems to disable copy/paste, which thwarts more precise counting), indicates that the text size is larger than the data chunks being read from disc, so compression seems likely. Encryption isn’t out of the question (especially since the program deems it necessary to disable copy and pasting of this public domain literary data), and if it’s in use, that means the key is being read from one of these files.

    Blocked On Disassembly
    So I’m a bit blocked right now. I know exactly where the data lives, but it’s clear that I need to reverse engineer some binary code. The big problem is that I have no idea how to disassemble Windows 3.1 binaries. These are NE-type executable files. Disassemblers abound for MZ files (MS-DOS executables) and PE files (executables for Windows 95 and beyond). NE files get no respect. It’s difficult (but not impossible) to even find data about the format anymore, and details are incomplete. It should be noted, however, the DOSBox-as-strace method described here lends insight into how Windows 3.1 processes NE-type EXEs. You can’t get any more authoritative than that.

    So far, I have tried the freeware version of IDA Pro. Unfortunately, I haven’t been able to get the program to work on my Windows machine for a long time. Even if I could, I can’t find any evidence that it actually supports NE files (the free version specifically mentions MZ and PE, but does not mention NE or LE).

    I found an old copy of Borland’s beloved Turbo Assembler and Debugger package. It has Turbo Debugger for Windows, both regular and 32-bit versions. Unfortunately, the normal version just hangs Windows 3.1 in DOSBox. The 32-bit Turbo Debugger loads just fine but can’t load the NE file.

    I’ve also wondered if DOSBox contains any advanced features for trapping program execution and disassembling. I haven’t looked too deeply into this yet.

    Future Work
    NE files seem to be the executable format that time forgot. I have a crazy brainstorm about repacking NE files as MZ executables so that they could be taken apart with an MZ disassembler. But this will take some experimenting.

    If anyone else has any ideas about ripping open these binaries, I would appreciate hearing them.

    And I guess I shouldn’t be too surprised to learn that all the literature in this corpus is already freely available and easily downloadable anyway. But you shouldn’t be too surprised if that doesn’t discourage me from trying to crack the format that’s keeping this particular copy of the data locked up.