{"id":23023648,"url":"https://github.com/lighterowl/dvbindex","last_synced_at":"2026-05-06T04:31:12.978Z","repository":{"id":70909240,"uuid":"80355537","full_name":"lighterowl/dvbindex","owner":"lighterowl","description":"A DVB stream indexer","archived":false,"fork":false,"pushed_at":"2022-03-24T18:06:12.000Z","size":107,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2025-03-01T17:32:45.943Z","etag":null,"topics":["dvb","dvb-psi","ffmpeg","libdvbpsi","sqlite"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lighterowl.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":"2017-01-29T16:03:33.000Z","updated_at":"2022-05-08T20:27:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"f7a36ec2-6687-42d5-aadc-e7d1abe9a717","html_url":"https://github.com/lighterowl/dvbindex","commit_stats":null,"previous_names":["lighterowl/dvbindex"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lighterowl/dvbindex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lighterowl%2Fdvbindex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lighterowl%2Fdvbindex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lighterowl%2Fdvbindex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lighterowl%2Fdvbindex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lighterowl","download_url":"https://codeload.github.com/lighterowl/dvbindex/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lighterowl%2Fdvbindex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32678572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["dvb","dvb-psi","ffmpeg","libdvbpsi","sqlite"],"created_at":"2024-12-15T13:14:31.668Z","updated_at":"2026-05-06T04:31:12.959Z","avatar_url":"https://github.com/lighterowl.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Introduction\n\n`dvbindex` is a program which is meant to read a number of MPEG-TS files, \nprobably with DVB metadata embedded inside them, and put this metadata along \nwith stream information inside an SQLite database.\n\nIt uses ffmpeg for obtaining information about the streams, and libdvbpsi for \nreading the DVB metadata.\n\n# Why?\n\nThis program is mostly meant to be used by people working on STBs and/or TVs \nwhich support DVB. Quite often, in order to reproduce a specific issue, a \nspecific stream is needed, for example one which has a number of table version \nchanges, or which has a service with a subtitle/audio stream in a very specific \nlanguage accompanied with a video stream in a particular resolution.\n\nPeople who do this kind of work usually have lots of different streams, however \nfinding one with a particular combination of parameters is a tedious task : it \nneeds opening each file in a stream analyzer and looking at its parameters. \n`dvbindex` is meant to make this task easier : by making appropriate queries \nagainst the database it creates, one can significantly reduce the number of \nstreams that need to be inspected manually.\n\nSince stream files can be quite large sometimes, care was taken to ensure that \nthe whole file is never read twice : instead, the file being read is analyzed \nsimultaneously by ffmpeg and libdvbpsi.\n\n# Compiling\n\nCompilation was only tested under Linux, with ffmpeg 3.2.2, libdvbpsi 1.3.0, \nand sqlite 3.16.2. Your mileage may vary with other OSes and/or library \nversions : please submit bug reports if something doesn't work with your \nconfiguration.\n\nSince `dvbindex` uses CMake, the whole process is limited to generating the \nproject on your platform and building it. If you're using make as the build \nbackend, just do :\n\n```\nmkdir build\ncd build\ncmake ..\nmake\n```\n\n# Usage\n\n`dvbindex` should be handed the name of the database file to create (or modify) \nas its first parameter. All the following parameters are paths to directories \nand/or files for indexing. Very brief status information is output to the \nstandard error stream. After the program exits, the database file will contain \nall information it could capture.\n\nAny following invocations of the program don't cause it to rebuild the database \nfrom scratch : it skips all files that have already been indexed based on their \nname and size.\n\n# Testing\n\nTesting consists of running `test/dvbindex-test.sh` and passing the path to the\nexecutable as one of its arguments. The stream repository that's used to create\nthe reference database is available upon request.\n\n# Example queries\n\nI'm not a SQL wizard, so I'm sure much more complicated (and useful) queries \ncan be thought of.\n\nGet the number of services declared as non-scrambled in each of the indexed\nfiles :\n\n```sql\nSELECT f.name, count(0) AS num_non_scrambled FROM services s\nJOIN sdts sdt ON s.sdt_rowid = sdt.rowid\nJOIN pats pat ON sdt.pat_rowid = pat.rowid\nJOIN files f ON pat.file_rowid = f.rowid\nWHERE s.scrambled = 0\nGROUP BY f.rowid;\n```\n\nGet the list of files which have at least one 6-channel audio track :\n\n```sql\nSELECT f.name FROM aud_streams a\nJOIN files f ON a.file_rowid = f.rowid\nWHERE a.channels = 6\nGROUP BY f.rowid;\n```\n\nGet the list of services which have a HD video track :\n\n```sql\nSELECT s.name FROM vid_streams v\nJOIN pats pat ON v.file_rowid = pat.file_rowid\nJOIN pmts pmt ON pmt.pat_rowid = pat.rowid AND pmt.program_number = (\n  SELECT program_number FROM elem_streams es\n  JOIN pmts pmt_for_es ON es.pmt_rowid = pmt_for_es.rowid\n  WHERE es.pid = v.pid\n)\nJOIN sdts sdt ON sdt.pat_rowid = pat.rowid\nJOIN services s ON s.sdt_rowid = sdt.rowid AND s.program_number = pmt.program_number\nWHERE v.width = 1920 AND v.height = 1080\n```\n\nGet the list of services which have at least one teletext stream :\n\n```sql\nSELECT s.name, count(*) AS num_teletext_streams\nFROM ttx_pages t\nJOIN elem_streams es on t.elem_stream_rowid = es.rowid\nJOIN pmts pm ON es.pmt_rowid = pm.rowid\nJOIN pats pa ON pm.pat_rowid = pa.rowid\nJOIN sdts sd ON sd.pat_rowid = pa.rowid\nJOIN services s ON pm.program_number = s.program_number AND sd.rowid = s.sdt_rowid\nGROUP BY es.pid, pm.program_number, sd.onid\n```\n\n# Missing features\n\nLots. Currently, `dvbindex` only reads PAT and PMT, and SDT tables. Support for \nall the other tables will be added in the future, along with their export to \nthe database.\n\nThere is no way to obtain any information about scrambled streams, so expect \nthese to have mostly NULLs in place of actual data.\n\nLogging could probably be a bit more verbose.\n\n# Bugs\n\nLots, probably. I have about 10 streams that I used for testing, but \npractically every stream is a totally different world. If you encounter any \nincorrect behaviour, like crashes or missing metadata, please submit a bug \nreport along with the stream that was being read.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flighterowl%2Fdvbindex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flighterowl%2Fdvbindex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flighterowl%2Fdvbindex/lists"}