{"id":726,"date":"2008-12-09T19:06:54","date_gmt":"2008-12-10T03:06:54","guid":{"rendered":"http:\/\/multimedia.cx\/eggs\/?p=726"},"modified":"2020-07-25T22:26:03","modified_gmt":"2020-07-26T05:26:03","slug":"parsing-in-python","status":"publish","type":"post","link":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/","title":{"rendered":"Parsing In Python"},"content":{"rendered":"<p>I wanted to see if the video frames inside these newly discovered <a href=\"http:\/\/wiki.multimedia.cx\/index.php?title=ACD_Systems_Digital_Imaging\">ACDV-AVI files<\/a> were just regular JPEG frames stuffed inside an AVI file. JPEG is a picky matter and many companies have derived their own custom bastardizations of the format. So I just wanted to separate out the data frames into individual JPEG files and see if they could be decoded with other picture viewers. Maybe <a href=\"http:\/\/ffmpeg.org\/\">FFmpeg<\/a> can already do it using the right combination of command line options. Or maybe it&#8217;s trivial to hook up the &#8216;ACDV&#8217; FourCC to the JPEG decoder in the source code. What can I say? FFmpeg intimidates me just as much as it does any of you mere mortals.<\/p>\n<p>Plus, I&#8217;m getting a big kick out of writing little tools in Python. For a long time, I had a fear of processing binary data in very high level languages like Perl, believing that they should be left to text processing tasks. This needn&#8217;t be the case. pack() and unpack() make binary data manipulation quite simple in Perl and Python. Here&#8217;s a naive utility that loads an AVI file in one go, digs through it until it finds a video frame marker (either &#8217;00dc&#8217; or &#8212; and I have never seen this marker before &#8212; &#8217;00AC&#8217;) and writes the frame to its own file.<\/p>\n<p>acdv.py:<br \/>\n<script src=\"https:\/\/gist.github.com\/multimediamike\/e87ab641d834dbbededd61b462e3eae8.js\"><\/script><\/p>\n<p>BTW, the experiment revealed that, indeed, the ACDV video frames can each stand alone as separate JPEG files.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Is this ACDV data standard JPEG data? Rather than going through the bother of trying to make FFmpeg test it, I wrote a Python utility to split the frames from an AVI file.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[28,55],"tags":[105,107,285,106],"class_list":["post-726","post","type-post","status-publish","format-standard","hentry","category-programming","category-python","tag-avi","tag-parsing","tag-python","tag-video-codec"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 5.0.4 - aioseo.com -->\n\t<meta name=\"description\" content=\"Is this ACDV data standard JPEG data? Rather than going through the bother of trying to make FFmpeg test it, I wrote a Python utility to split the frames from an AVI file.\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Multimedia Mike\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/\" \/>\n\t\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 5.0.4\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Breaking Eggs And Making Omelettes | Topics On Multimedia Technology and Reverse Engineering\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Parsing AVI Files In Python | Breaking Eggs And Making Omelettes\" \/>\n\t\t<meta property=\"og:description\" content=\"Is this ACDV data standard JPEG data? Rather than going through the bother of trying to make FFmpeg test it, I wrote a Python utility to split the frames from an AVI file.\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2008-12-10T03:06:54+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2020-07-26T05:26:03+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Parsing AVI Files In Python | Breaking Eggs And Making Omelettes\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Is this ACDV data standard JPEG data? Rather than going through the bother of trying to make FFmpeg test it, I wrote a Python utility to split the frames from an AVI file.\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/#article\",\"name\":\"Parsing AVI Files In Python | Breaking Eggs And Making Omelettes\",\"headline\":\"Parsing In Python\",\"author\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"publisher\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\"},\"datePublished\":\"2008-12-09T19:06:54-08:00\",\"dateModified\":\"2020-07-25T22:26:03-07:00\",\"inLanguage\":\"en-US\",\"commentCount\":10,\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/#webpage\"},\"isPartOf\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/#webpage\"},\"articleSection\":\"Programming, Python, avi, parsing, Python, video codec\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/programming\\\/#listItem\",\"name\":\"Programming\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/programming\\\/#listItem\",\"position\":2,\"name\":\"Programming\",\"item\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/programming\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/#listItem\",\"name\":\"Parsing In Python\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/#listItem\",\"position\":3,\"name\":\"Parsing In Python\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/category\\\/programming\\\/#listItem\",\"name\":\"Programming\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\",\"name\":\"Breaking Eggs And Making Omelettes\",\"description\":\"Topics On Multimedia Technology and Reverse Engineering\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/\",\"name\":\"Multimedia Mike\",\"image\":{\"@type\":\"ImageObject\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/#authorImage\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/2eb93f7cada658f7986b5092062849fa255779eada3342c8f6b9a40764b95fdd?s=96&d=identicon&r=g\",\"width\":96,\"height\":96,\"caption\":\"Multimedia Mike\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/#webpage\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/\",\"name\":\"Parsing AVI Files In Python | Breaking Eggs And Making Omelettes\",\"description\":\"Is this ACDV data standard JPEG data? Rather than going through the bother of trying to make FFmpeg test it, I wrote a Python utility to split the frames from an AVI file.\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/parsing-in-python\\\/#breadcrumblist\"},\"author\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"creator\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/author\\\/multimedia-mike\\\/#author\"},\"datePublished\":\"2008-12-09T19:06:54-08:00\",\"dateModified\":\"2020-07-25T22:26:03-07:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#website\",\"url\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/\",\"name\":\"Breaking Eggs And Making Omelettes\",\"description\":\"Topics On Multimedia Technology and Reverse Engineering\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/multimedia.cx\\\/eggs\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Parsing AVI Files In Python | Breaking Eggs And Making Omelettes","description":"Is this ACDV data standard JPEG data? Rather than going through the bother of trying to make FFmpeg test it, I wrote a Python utility to split the frames from an AVI file.","canonical_url":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/#article","name":"Parsing AVI Files In Python | Breaking Eggs And Making Omelettes","headline":"Parsing In Python","author":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"publisher":{"@id":"https:\/\/multimedia.cx\/eggs\/#organization"},"datePublished":"2008-12-09T19:06:54-08:00","dateModified":"2020-07-25T22:26:03-07:00","inLanguage":"en-US","commentCount":10,"mainEntityOfPage":{"@id":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/#webpage"},"isPartOf":{"@id":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/#webpage"},"articleSection":"Programming, Python, avi, parsing, Python, video codec"},{"@type":"BreadcrumbList","@id":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/#listItem","position":1,"name":"Home","item":"https:\/\/multimedia.cx\/eggs\/","nextItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/programming\/#listItem","name":"Programming"}},{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/programming\/#listItem","position":2,"name":"Programming","item":"https:\/\/multimedia.cx\/eggs\/category\/programming\/","nextItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/#listItem","name":"Parsing In Python"},"previousItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/#listItem","position":3,"name":"Parsing In Python","previousItem":{"@type":"ListItem","@id":"https:\/\/multimedia.cx\/eggs\/category\/programming\/#listItem","name":"Programming"}}]},{"@type":"Organization","@id":"https:\/\/multimedia.cx\/eggs\/#organization","name":"Breaking Eggs And Making Omelettes","description":"Topics On Multimedia Technology and Reverse Engineering","url":"https:\/\/multimedia.cx\/eggs\/"},{"@type":"Person","@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author","url":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/","name":"Multimedia Mike","image":{"@type":"ImageObject","@id":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/#authorImage","url":"https:\/\/secure.gravatar.com\/avatar\/2eb93f7cada658f7986b5092062849fa255779eada3342c8f6b9a40764b95fdd?s=96&d=identicon&r=g","width":96,"height":96,"caption":"Multimedia Mike"}},{"@type":"WebPage","@id":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/#webpage","url":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/","name":"Parsing AVI Files In Python | Breaking Eggs And Making Omelettes","description":"Is this ACDV data standard JPEG data? Rather than going through the bother of trying to make FFmpeg test it, I wrote a Python utility to split the frames from an AVI file.","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/multimedia.cx\/eggs\/#website"},"breadcrumb":{"@id":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/#breadcrumblist"},"author":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"creator":{"@id":"https:\/\/multimedia.cx\/eggs\/author\/multimedia-mike\/#author"},"datePublished":"2008-12-09T19:06:54-08:00","dateModified":"2020-07-25T22:26:03-07:00"},{"@type":"WebSite","@id":"https:\/\/multimedia.cx\/eggs\/#website","url":"https:\/\/multimedia.cx\/eggs\/","name":"Breaking Eggs And Making Omelettes","description":"Topics On Multimedia Technology and Reverse Engineering","inLanguage":"en-US","publisher":{"@id":"https:\/\/multimedia.cx\/eggs\/#organization"}}]},"og:locale":"en_US","og:site_name":"Breaking Eggs And Making Omelettes | Topics On Multimedia Technology and Reverse Engineering","og:type":"article","og:title":"Parsing AVI Files In Python | Breaking Eggs And Making Omelettes","og:description":"Is this ACDV data standard JPEG data? Rather than going through the bother of trying to make FFmpeg test it, I wrote a Python utility to split the frames from an AVI file.","og:url":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/","article:published_time":"2008-12-10T03:06:54+00:00","article:modified_time":"2020-07-26T05:26:03+00:00","twitter:card":"summary","twitter:title":"Parsing AVI Files In Python | Breaking Eggs And Making Omelettes","twitter:description":"Is this ACDV data standard JPEG data? Rather than going through the bother of trying to make FFmpeg test it, I wrote a Python utility to split the frames from an AVI file."},"aioseo_meta_data":{"post_id":"726","title":"Parsing AVI Files In Python | #site_title","description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":null,"schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"location":null,"local_seo":null,"breadcrumb_settings":null,"limit_modified_date":false,"ai":null,"created":"2020-12-31 22:01:17","updated":"2025-12-31 19:01:11","seo_analyzer_scan_date":null,"focus_keyword":null,"additional_keywords":null,"truseo_locale":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/multimedia.cx\/eggs\/\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/multimedia.cx\/eggs\/category\/programming\/\" title=\"Programming\">Programming<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">\u00bb<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tParsing In Python\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/multimedia.cx\/eggs\/"},{"label":"Programming","link":"https:\/\/multimedia.cx\/eggs\/category\/programming\/"},{"label":"Parsing In Python","link":"https:\/\/multimedia.cx\/eggs\/parsing-in-python\/"}],"_links":{"self":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/726","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/comments?post=726"}],"version-history":[{"count":10,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/726\/revisions"}],"predecessor-version":[{"id":4588,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/posts\/726\/revisions\/4588"}],"wp:attachment":[{"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/media?parent=726"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/categories?post=726"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/multimedia.cx\/eggs\/wp-json\/wp\/v2\/tags?post=726"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}