{"action":"created","issue":{"url":"https://api.github.com/repos/tsduck/tsduck/issues/465","repository_url":"https://api.github.com/repos/tsduck/tsduck","labels_url":"https://api.github.com/repos/tsduck/tsduck/issues/465/labels{/name}","comments_url":"https://api.github.com/repos/tsduck/tsduck/issues/465/comments","events_url":"https://api.github.com/repos/tsduck/tsduck/issues/465/events","html_url":"https://github.com/tsduck/tsduck/issues/465","id":526560666,"node_id":"MDU6SXNzdWU1MjY1NjA2NjY=","number":465,"title":"Question about modifying ts header","user":{"login":"meguli","id":5953538,"node_id":"MDQ6VXNlcjU5NTM1Mzg=","avatar_url":"https://avatars3.githubusercontent.com/u/5953538?v=4","gravatar_id":"","url":"https://api.github.com/users/meguli","html_url":"https://github.com/meguli","followers_url":"https://api.github.com/users/meguli/followers","following_url":"https://api.github.com/users/meguli/following{/other_user}","gists_url":"https://api.github.com/users/meguli/gists{/gist_id}","starred_url":"https://api.github.com/users/meguli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/meguli/subscriptions","organizations_url":"https://api.github.com/users/meguli/orgs","repos_url":"https://api.github.com/users/meguli/repos","events_url":"https://api.github.com/users/meguli/events{/privacy}","received_events_url":"https://api.github.com/users/meguli/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-11-21T12:21:40Z","updated_at":"2019-11-21T14:42:04Z","closed_at":null,"author_association":"NONE","body":"I want to use _tsduck_ to test my application which listens for a transport stream on an IP address and answers some questions. Suppose my program listens on `239.48.208.1:1234`. \r\n\r\nI can use _tsduck_ plugins to introduce `ts_stream_error`, play with pcr settings etc. and I am able to see on my program that modifications are applied to the output stream on `239.48.208.1:1234`. One thing I want to add to my program is to count sync byte errors and sync losses. For that, I want to output ts packets with sync byte that are not equal to `0x47`. It looks to me like I am not able to do this with _tsduck_. Here is one of the things that I tried\r\n\r\n    tsp -I file --infinite \"playout.ts\" -O ip 239.48.208.1:123 --ttl 10\r\n\r\n`playout.ts` contains a ts packet with sync byte set to  `0x77`. And I get the error\r\n\r\n> Error: file: synchronization lost after 0 packets, got 0x77 instead of 0x47\r\n\r\nimmediately, which makes sense. Still, this is exactly what I want to playout. Does anyone know a way to output a stream with incorrect sync byte?"},"comment":{"url":"https://api.github.com/repos/tsduck/tsduck/issues/comments/557114931","html_url":"https://github.com/tsduck/tsduck/issues/465#issuecomment-557114931","issue_url":"https://api.github.com/repos/tsduck/tsduck/issues/465","id":557114931,"node_id":"MDEyOklzc3VlQ29tbWVudDU1NzExNDkzMQ==","user":{"login":"lelegard","id":5641922,"node_id":"MDQ6VXNlcjU2NDE5MjI=","avatar_url":"https://avatars0.githubusercontent.com/u/5641922?v=4","gravatar_id":"","url":"https://api.github.com/users/lelegard","html_url":"https://github.com/lelegard","followers_url":"https://api.github.com/users/lelegard/followers","following_url":"https://api.github.com/users/lelegard/following{/other_user}","gists_url":"https://api.github.com/users/lelegard/gists{/gist_id}","starred_url":"https://api.github.com/users/lelegard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lelegard/subscriptions","organizations_url":"https://api.github.com/users/lelegard/orgs","repos_url":"https://api.github.com/users/lelegard/repos","events_url":"https://api.github.com/users/lelegard/events{/privacy}","received_events_url":"https://api.github.com/users/lelegard/received_events","type":"User","site_admin":false},"created_at":"2019-11-21T14:42:04Z","updated_at":"2019-11-21T14:42:04Z","author_association":"MEMBER","body":"So, if this is just for a test, you do not need a specialized tool such as TSDuck.\r\n\r\nOn Linux, you can do that using the shell only. Assuming, that you have a large TS file with proper byte corruption, first split your TS file in chunks of 7 TS packets (the usual number of TS packets per UDP packet);\r\n~~~\r\n$ split --bytes $((7*188)) input.ts foo- --suffix-length 4 --additional-suffix .ts\r\n$ ls -l foo-*\r\n-rw-r--r-- 1 user group   1316   foo-aaaa.ts\r\n-rw-r--r-- 1 user group   1316   foo-aaab.ts\r\n-rw-r--r-- 1 user group   1316   foo-aaac.ts\r\n-rw-r--r-- 1 user group   1316   foo-aaad.ts\r\n-rw-r--r-- 1 user group   1316   foo-aaae.ts\r\n-rw-r--r-- 1 user group   1316   foo-aaaf.ts\r\n~~~\r\nThen, send them one by one, waiting one millisecond between each:\r\n~~~\r\nfor f in foo-*.ts\r\ndo\r\n    socat -u open:$f udp:localhost:1234\r\n    sleep 0.001\r\ndone\r\n~~~\r\nJust tested on an Ubuntu 19.10 machine. It works (received using `tsp` on the other side)."}}
{"actor":{"display_login":"lelegard"}}