{"id":17008854,"url":"https://github.com/i-e-b/csharpvideosynthesiser","last_synced_at":"2026-05-10T09:49:25.966Z","repository":{"id":139824863,"uuid":"329631205","full_name":"i-e-b/CsharpVideoSynthesiser","owner":"i-e-b","description":"Programmatically output .mp4 files from C# based on a range of algorithms","archived":false,"fork":false,"pushed_at":"2023-02-16T19:35:49.000Z","size":90,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-27T12:11:20.244Z","etag":null,"topics":["algorithm","algorithms","audio","sorting","sorting-algorithms","video","visualization"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/i-e-b.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-14T13:58:09.000Z","updated_at":"2023-02-18T17:25:13.000Z","dependencies_parsed_at":null,"dependency_job_id":"c9639ea6-b54b-49b8-81ec-a0c7753eebc7","html_url":"https://github.com/i-e-b/CsharpVideoSynthesiser","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FCsharpVideoSynthesiser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FCsharpVideoSynthesiser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FCsharpVideoSynthesiser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/i-e-b%2FCsharpVideoSynthesiser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/i-e-b","download_url":"https://codeload.github.com/i-e-b/CsharpVideoSynthesiser/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244959057,"owners_count":20538623,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithm","algorithms","audio","sorting","sorting-algorithms","video","visualization"],"created_at":"2024-10-14T05:29:23.955Z","updated_at":"2026-05-10T09:49:20.941Z","avatar_url":"https://github.com/i-e-b.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CsharpVideoSynthesiser\n\n## What?\n\nProgrammatically output .mp4 files from C#.\nThis is used to generate a range of algorithm visualisations.\n\nResult videos can be viewed at https://www.youtube.com/playlist?list=PLsb_7wpuMFt69ColcujH6LkhGg4984ZTk\n\n## How?\n\nUses OpenCV and FFMpeg, with the libraries:\n\n- https://www.nuget.org/packages/Emgu.CV -\u003e https://github.com/emgucv/emgucv\n- https://www.nuget.org/packages/FFMpegCore/  -\u003e https://github.com/rosenbjerg/FFMpegCore\n  - to install binaries, see https://github.com/rosenbjerg/FFMpegCore#installation \n\nGeneration of the videos is triggered by running its NUnit test\n\n## Visualisations\n\nThe web has lots of visualisations -- especially of sorting algorithms,\nbut I am attempting to have a customised visualisation for each algorithm that\nshows more of how it operates, so you will see markers, stack visualisations etc.\n\nThe visualisations can be a bit slower that others due to showing all the steps.\n\n### Sorts\n\n#### Bottom-up merge sort\n\nhttps://www.youtube.com/watch?v=6F-RMaKMrks\n\nThis is my personal favorite.\n\nThis sort is relatively optimal for a compare based sort.\n\nIt requires an equal sized aux array, but keeps reads and writes separate and has close to sequential access,\nwhich helps reduce CPU cache and memory bus conflicts, and uses cache lines relatively well.\n\n#### Radix merge sort (MSD)\n\nhttps://www.youtube.com/watch?v=4RII-rEc_qQ\n\nRadix merge is somewhere between quick-sort and a merge sort.\nThis uses a separate source and destination buffer, which are swapped.\nWe keep a queue of 'done' and 'not-done' areas, partitioning the remaining spans as we go.\n\nThis means we avoid read/write conflicts on cache lines, but use `2n` auxiliary space.\n\nComplexity is exactly `kn`, where `k` is the number of bits in the key, and `n` the number of items.\n\n#### Radix in-place sort (MSD)\n\nhttps://www.youtube.com/watch?v=tsVn5CT67T8\n\nIn place radix sort using most significant first, and a swapping system like quick sort.\n\nThis results in many more inspections than a buffer-copy strategy, but fewer writes.\n\n#### Naïve iterative heap sort with min-heap\n\nhttps://www.youtube.com/watch?v=QahrU49QjvM\n\nIn-place heap sort with 1024 random entries.\n\nThis sort is in the `O(n log n)` class, but is relatively slow compared to merge sort or the best case of quick sort.\nIt requires no substantial aux storage. The array is accessed in a very scattered way, which can cause cache and memory-line problems.\n\n#### Access optimised heap sort\n\nhttps://www.youtube.com/watch?v=H5xw4_GI0WA\n\nIn-place heap sort with 1024 random entries.\n\nThis sort is in the `O(n log n)` class, but is relatively slow compared to merge sort or the best case of quick sort.\nIt requires no substantial aux storage.\n\nThe array is accessed in a slightly less scattered way than the basic heap sort, and requires no swap phase at the end.\n\n#### Simple recursive quick-sort\n\nhttps://www.youtube.com/watch?v=hOWc9WAdhkc\nhttps://www.youtube.com/watch?v=mUVmjoP0R4E\n\nRecursive in-place quick sort using Hoare's scheme and best-of-3 partition with 1024 random entries.\n\nThis sort can be very quick, but easily degenerates to a very poor worst case.\n\nIt requires a stack of spans to be sorted, shown in orange.\n\n#### Tournament sort\n\nhttps://www.youtube.com/watch?v=pE6Axfw_LgE\n\nThis sort uses a heap-based sort window to create sorted sub-regions.\nThese regions are then merge-sorted together.\n\nThe example uses a very small 7 item window for visualisation.\n\nSome visualisations show this sort working very quickly (or in very few steps).\nI believe this is due to skipping the heap-sort stages. This algorithm does not \nseem to be particularly fast.\n\n\n\n### Array rotation\n\n#### 'Trinity' array rotation\n\nhttps://www.youtube.com/watch?v=OXLjT_KsMR4\n\nRotate an array by an arbitrary amount in place.\n\nThis is a refinement of the older \"3 reversals\" method.\n\nWorks by reversing each side of the rotation point separately,\nthen reversing the entire array, but combines some of these swaps for a\nsignificant reduction in the number of copies performed.\n\n#### Array rotation by 3 reversals\n\nhttps://www.youtube.com/watch?v=zWT8yAAEvr8\n\nRotate an array by an arbitrary amount in place.\n\nWorks by reversing each side of the rotation point separately,\nthen reversing the entire array.\n\nThis is simple and reasonably fast. It is outperformed by the\n'trinity' rotation, which elides some of the inversions here.\n\n## To Do\n\n- Audio versions\n- Shuffles\n- Searches\n- String algorithms","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fcsharpvideosynthesiser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fi-e-b%2Fcsharpvideosynthesiser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fi-e-b%2Fcsharpvideosynthesiser/lists"}