{"action":"created","comment":{"url":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/comments/144120550","pull_request_review_id":68730258,"id":144120550,"diff_hunk":"@@ -133,6 +133,51 @@ <h2 id=\"concepts\">Learn about more advanced FFmpeg concepts</h2>\n   </div>\n   <!-- End Filtergraph explanation -->\n \n+  <!-- Record and Live-Stream simultaneously -->\n+    <span data-toggle=\"modal\" data-target=\"#record-and-stream\"><button type=\"button\" class=\"btn btn-default\" data-toggle=\"tooltip\" data-placement=\"bottom\" title=\"Record and Live-Stream simultaneously\">Record and Live-Stream simultaneously</button></span>\n+    <div id=\"record-and-stream\" class=\"modal fade\" tabindex=\"-1\" role=\"dialog\">\n+      <div class=\"modal-dialog modal-lg\">\n+        <div class=\"modal-content\">\n+          <div class=\"well\">\n+            <h3>Record and Live-Stream simultaneously</h3>\n+            <p><code>ffmpeg -re -i <i>${INPUTFILE}</i> -map 0 -flags +global_header -vf scale=\"1280:-1,format=yuv420p\" -pix_fmt yuv420p -level 3.1 -vsync passthrough -crf 26 -g 50 -bufsize 3500k -maxrate 1800k -c:v libx264 -c:a aac -b:a 128000 -r:a 44100 -ac 2 -t ${STREAMDURATION} -f tee <i>\"[movflags=+faststart]${TARGETFILE}|[f=flv]${STREAMTARGET}\"</i></code></p>\n+            I use this script to stream to a RTMP target and record the stream locally as .mp4 with only one ffmpeg-instance.<br />\n+            As input, I use <code>bmdcapture</code> which is piped to ffmpeg. But it can also be used with a static videofile as input.<br />\n+            The input will be scaled to 1280px width, maintaining height. Also the stream will stop after a given time (see <code>-t</code> option.)</p>\n+            <p><strong>Note 1</strong><br />\n+            I recommend to use this inside a shell script. then you can define the variables <code>${INPUTFILE}</code>, <code>${STREAMDURATION}</code>, <code>${TARGETFILE}</code>, <code>${STREAMTARGET}</code>.</p>\n+            <p><strong>Note 2</strong><br />\n+            This is in daily use to live-stream a real-world TV show. No errors for nearly 4 years. Some parameters were found by trial-and-error or empiric testing. So suggestions / questions are welcome.</p>\n+            <dl>\n+               <dt>/usr/local/bin/ffmpeg </dt><dd>starts the command</dd>\n+               <dt>  -re </dt><dd>Read input at native framerate</dd>\n+               <dt>  -i input.mov </dt><dd>The input file. Can also be a <code>-</code> to use STDIN if you pipe in from webcam or SDI.</dd>\n+               <dt>  -map 0 </dt><dd>map ALL streams from input file to output</dd>\n+               <dt>  -flags +global_header </dt><dd>Dont place extradata in every keyframe</dd>\n+               <dt>  -vf scale=\"1280:-1\" </dt><dd>Scale to 1280 width, maintain aspect ratio.</dd>\n+               <dt>  -pix_fmt yuv420p </dt><dd>convert to 420p color space</dd>\n+               <dt>  -level 3.1 </dt><dd>H264 Level (defines some thresholds for bitrate)</dd>\n+               <dt>  -vsync passthrough </dt><dd>Each frame is passed with its timestamp from the demuxer to the muxer.</dd>\n+               <dt>  -crf 26 </dt><dd>Constant rate factor - basically the quality</dd>\n+               <dt>  -g 50 </dt><dd>GOP size.</dd>\n+               <dt>  -bufsize 3500k </dt><dd>Ratecontrol buffer size (~ maxrate x2)</dd>\n+               <dt>  -maxrate 1800k </dt><dd>Maximum bit rate</dd>\n+               <dt>  -c:v libx264 </dt><dd>The video codec</dd>\n+               <dt>  -c:a aac </dt><dd>The audio codec</dd>","path":"index.html","position":34,"original_position":34,"commit_id":"ba21f8b88dae0eb5f41a8ae7ed4535640aa32876","original_commit_id":"ba21f8b88dae0eb5f41a8ae7ed4535640aa32876","user":{"login":"kfrn","id":16832997,"avatar_url":"https://avatars3.githubusercontent.com/u/16832997?v=4","gravatar_id":"","url":"https://api.github.com/users/kfrn","html_url":"https://github.com/kfrn","followers_url":"https://api.github.com/users/kfrn/followers","following_url":"https://api.github.com/users/kfrn/following{/other_user}","gists_url":"https://api.github.com/users/kfrn/gists{/gist_id}","starred_url":"https://api.github.com/users/kfrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kfrn/subscriptions","organizations_url":"https://api.github.com/users/kfrn/orgs","repos_url":"https://api.github.com/users/kfrn/repos","events_url":"https://api.github.com/users/kfrn/events{/privacy}","received_events_url":"https://api.github.com/users/kfrn/received_events","type":"User","site_admin":false},"body":"As above, with AAC","created_at":"2017-10-11T20:03:15Z","updated_at":"2017-10-11T20:04:44Z","html_url":"https://github.com/amiaopensource/ffmprovisr/pull/246#discussion_r144120550","pull_request_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/246","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/comments/144120550"},"html":{"href":"https://github.com/amiaopensource/ffmprovisr/pull/246#discussion_r144120550"},"pull_request":{"href":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/246"}}},"pull_request":{"url":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/246","id":146024474,"html_url":"https://github.com/amiaopensource/ffmprovisr/pull/246","diff_url":"https://github.com/amiaopensource/ffmprovisr/pull/246.diff","patch_url":"https://github.com/amiaopensource/ffmprovisr/pull/246.patch","issue_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/issues/246","number":246,"state":"open","locked":false,"title":"Add stream-and-record command","user":{"login":"bastibeckr","id":879611,"avatar_url":"https://avatars2.githubusercontent.com/u/879611?v=4","gravatar_id":"","url":"https://api.github.com/users/bastibeckr","html_url":"https://github.com/bastibeckr","followers_url":"https://api.github.com/users/bastibeckr/followers","following_url":"https://api.github.com/users/bastibeckr/following{/other_user}","gists_url":"https://api.github.com/users/bastibeckr/gists{/gist_id}","starred_url":"https://api.github.com/users/bastibeckr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastibeckr/subscriptions","organizations_url":"https://api.github.com/users/bastibeckr/orgs","repos_url":"https://api.github.com/users/bastibeckr/repos","events_url":"https://api.github.com/users/bastibeckr/events{/privacy}","received_events_url":"https://api.github.com/users/bastibeckr/received_events","type":"User","site_admin":false},"body":"I wanted to contribute my livestream-and-record command to this great\r\ncollection.","created_at":"2017-10-11T18:19:09Z","updated_at":"2017-10-11T20:04:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b4f3c5ffa6560c354b305fada1c33a100e52a5db","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/246/commits","review_comments_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/246/comments","review_comment_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/comments{/number}","comments_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/issues/246/comments","statuses_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/statuses/ba21f8b88dae0eb5f41a8ae7ed4535640aa32876","head":{"label":"bastibeckr:gh-pages","ref":"gh-pages","sha":"ba21f8b88dae0eb5f41a8ae7ed4535640aa32876","user":{"login":"bastibeckr","id":879611,"avatar_url":"https://avatars2.githubusercontent.com/u/879611?v=4","gravatar_id":"","url":"https://api.github.com/users/bastibeckr","html_url":"https://github.com/bastibeckr","followers_url":"https://api.github.com/users/bastibeckr/followers","following_url":"https://api.github.com/users/bastibeckr/following{/other_user}","gists_url":"https://api.github.com/users/bastibeckr/gists{/gist_id}","starred_url":"https://api.github.com/users/bastibeckr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastibeckr/subscriptions","organizations_url":"https://api.github.com/users/bastibeckr/orgs","repos_url":"https://api.github.com/users/bastibeckr/repos","events_url":"https://api.github.com/users/bastibeckr/events{/privacy}","received_events_url":"https://api.github.com/users/bastibeckr/received_events","type":"User","site_admin":false},"repo":{"id":106591334,"name":"ffmprovisr","full_name":"bastibeckr/ffmprovisr","owner":{"login":"bastibeckr","id":879611,"avatar_url":"https://avatars2.githubusercontent.com/u/879611?v=4","gravatar_id":"","url":"https://api.github.com/users/bastibeckr","html_url":"https://github.com/bastibeckr","followers_url":"https://api.github.com/users/bastibeckr/followers","following_url":"https://api.github.com/users/bastibeckr/following{/other_user}","gists_url":"https://api.github.com/users/bastibeckr/gists{/gist_id}","starred_url":"https://api.github.com/users/bastibeckr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bastibeckr/subscriptions","organizations_url":"https://api.github.com/users/bastibeckr/orgs","repos_url":"https://api.github.com/users/bastibeckr/repos","events_url":"https://api.github.com/users/bastibeckr/events{/privacy}","received_events_url":"https://api.github.com/users/bastibeckr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bastibeckr/ffmprovisr","description":"Repository of useful FFmpeg command lines for archivists!","fork":true,"url":"https://api.github.com/repos/bastibeckr/ffmprovisr","forks_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/forks","keys_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/teams","hooks_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/hooks","issue_events_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/issues/events{/number}","events_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/events","assignees_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/assignees{/user}","branches_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/branches{/branch}","tags_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/tags","blobs_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/git/refs{/sha}","trees_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/statuses/{sha}","languages_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/languages","stargazers_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/stargazers","contributors_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/contributors","subscribers_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/subscribers","subscription_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/subscription","commits_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/commits{/sha}","git_commits_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/git/commits{/sha}","comments_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/comments{/number}","issue_comment_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/issues/comments{/number}","contents_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/contents/{+path}","compare_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/merges","archive_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/downloads","issues_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/issues{/number}","pulls_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/pulls{/number}","milestones_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/milestones{/number}","notifications_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/labels{/name}","releases_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/releases{/id}","deployments_url":"https://api.github.com/repos/bastibeckr/ffmprovisr/deployments","created_at":"2017-10-11T18:10:51Z","updated_at":"2017-10-11T18:10:53Z","pushed_at":"2017-10-11T18:12:48Z","git_url":"git://github.com/bastibeckr/ffmprovisr.git","ssh_url":"git@github.com:bastibeckr/ffmprovisr.git","clone_url":"https://github.com/bastibeckr/ffmprovisr.git","svn_url":"https://github.com/bastibeckr/ffmprovisr","homepage":"https://amiaopensource.github.io/ffmprovisr/","size":34227,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"gh-pages"}},"base":{"label":"amiaopensource:gh-pages","ref":"gh-pages","sha":"b483acdb6d97eb9faf7d1651a54d1c54bbac41f5","user":{"login":"amiaopensource","id":5024964,"avatar_url":"https://avatars3.githubusercontent.com/u/5024964?v=4","gravatar_id":"","url":"https://api.github.com/users/amiaopensource","html_url":"https://github.com/amiaopensource","followers_url":"https://api.github.com/users/amiaopensource/followers","following_url":"https://api.github.com/users/amiaopensource/following{/other_user}","gists_url":"https://api.github.com/users/amiaopensource/gists{/gist_id}","starred_url":"https://api.github.com/users/amiaopensource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amiaopensource/subscriptions","organizations_url":"https://api.github.com/users/amiaopensource/orgs","repos_url":"https://api.github.com/users/amiaopensource/repos","events_url":"https://api.github.com/users/amiaopensource/events{/privacy}","received_events_url":"https://api.github.com/users/amiaopensource/received_events","type":"Organization","site_admin":false},"repo":{"id":21527482,"name":"ffmprovisr","full_name":"amiaopensource/ffmprovisr","owner":{"login":"amiaopensource","id":5024964,"avatar_url":"https://avatars3.githubusercontent.com/u/5024964?v=4","gravatar_id":"","url":"https://api.github.com/users/amiaopensource","html_url":"https://github.com/amiaopensource","followers_url":"https://api.github.com/users/amiaopensource/followers","following_url":"https://api.github.com/users/amiaopensource/following{/other_user}","gists_url":"https://api.github.com/users/amiaopensource/gists{/gist_id}","starred_url":"https://api.github.com/users/amiaopensource/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/amiaopensource/subscriptions","organizations_url":"https://api.github.com/users/amiaopensource/orgs","repos_url":"https://api.github.com/users/amiaopensource/repos","events_url":"https://api.github.com/users/amiaopensource/events{/privacy}","received_events_url":"https://api.github.com/users/amiaopensource/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/amiaopensource/ffmprovisr","description":"Repository of useful FFmpeg command lines for archivists!","fork":false,"url":"https://api.github.com/repos/amiaopensource/ffmprovisr","forks_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/forks","keys_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/keys{/key_id}","collaborators_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/teams","hooks_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/hooks","issue_events_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/issues/events{/number}","events_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/events","assignees_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/assignees{/user}","branches_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/branches{/branch}","tags_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/tags","blobs_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/git/refs{/sha}","trees_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/git/trees{/sha}","statuses_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/statuses/{sha}","languages_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/languages","stargazers_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/stargazers","contributors_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/contributors","subscribers_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/subscribers","subscription_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/subscription","commits_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/commits{/sha}","git_commits_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/git/commits{/sha}","comments_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/comments{/number}","issue_comment_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/issues/comments{/number}","contents_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/contents/{+path}","compare_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/compare/{base}...{head}","merges_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/merges","archive_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/downloads","issues_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/issues{/number}","pulls_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls{/number}","milestones_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/milestones{/number}","notifications_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/labels{/name}","releases_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/releases{/id}","deployments_url":"https://api.github.com/repos/amiaopensource/ffmprovisr/deployments","created_at":"2014-07-05T20:15:01Z","updated_at":"2017-10-11T17:13:04Z","pushed_at":"2017-10-11T18:19:09Z","git_url":"git://github.com/amiaopensource/ffmprovisr.git","ssh_url":"git@github.com:amiaopensource/ffmprovisr.git","clone_url":"https://github.com/amiaopensource/ffmprovisr.git","svn_url":"https://github.com/amiaopensource/ffmprovisr","homepage":"https://amiaopensource.github.io/ffmprovisr/","size":34181,"stargazers_count":63,"watchers_count":63,"language":"HTML","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":23,"mirror_url":null,"open_issues_count":10,"forks":23,"open_issues":10,"watchers":63,"default_branch":"gh-pages"}},"_links":{"self":{"href":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/246"},"html":{"href":"https://github.com/amiaopensource/ffmprovisr/pull/246"},"issue":{"href":"https://api.github.com/repos/amiaopensource/ffmprovisr/issues/246"},"comments":{"href":"https://api.github.com/repos/amiaopensource/ffmprovisr/issues/246/comments"},"review_comments":{"href":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/246/comments"},"review_comment":{"href":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/amiaopensource/ffmprovisr/pulls/246/commits"},"statuses":{"href":"https://api.github.com/repos/amiaopensource/ffmprovisr/statuses/ba21f8b88dae0eb5f41a8ae7ed4535640aa32876"}},"author_association":"NONE"}}
{"actor":{"display_login":"kfrn"}}