{"id":7993,"date":"2021-01-03T15:38:41","date_gmt":"2021-01-03T14:38:41","guid":{"rendered":"https:\/\/monodes.com\/predaelli\/?p=7993"},"modified":"2021-01-03T15:38:41","modified_gmt":"2021-01-03T14:38:41","slug":"audio-how-to-transform-live-rtmp-video-to-live-mp3-icecast-stream-stack-overflow","status":"publish","type":"post","link":"https:\/\/monodes.com\/predaelli\/2021\/01\/03\/audio-how-to-transform-live-rtmp-video-to-live-mp3-icecast-stream-stack-overflow\/","title":{"rendered":"audio &#8211; how to transform live RTMP video to live mp3 Icecast stream &#8211; Stack Overflow"},"content":{"rendered":"<p>Source: <em><a href=\"https:\/\/stackoverflow.com\/questions\/29682170\/how-to-transform-live-rtmp-video-to-live-mp3-icecast-stream\">audio &#8211; how to transform live RTMP video to live mp3 Icecast stream &#8211; Stack Overflow<\/a><\/em><\/p>\n<p><!--more--><\/p>\n<blockquote>\n<div class=\"s-prose js-post-body\">\n<p>I have RTMP live stream with video and audio. I can get ogg audio live stream from RTMP and translate it to Icecast2 and get it on my site using JPlayer. Now i use such command:<\/p>\n<pre><code class=\"\" data-line=\"\">\/usr\/local\/bin\/ffmpeg -re -i rtmp:\/\/192.168.22.12\/live\/live1 \\\n-vn -acodec libvorbis -b:a 48k -f ogg - | oggfwd -p -d &quot;&quot; \\\n-g &quot;&quot; -u &quot;&quot; localhost 8000 somepass live2\n<\/code><\/pre>\n<p>Then I stream my live audio using Icecast2, but it is in OGG format, so mobile devices don&#8217;t play it (Android device has a time lagging near 30 sec before they start playing, iOS devices don&#8217;t want to play it).<\/p>\n<p>How can I transcode it to mp3 before sending to Icecast2?<\/p>\n<p>&#8230;<\/p>\n<div class=\"s-prose js-post-body\">\n<p>If you are using a (very) recent version you just could use ffmpeg for this. To test if your ffmpeg is capable to stream to Icecast, do the following:<\/p>\n<pre><code class=\"\" data-line=\"\">ffmpeg -protocols -v 0 | grep icecast\n<\/code><\/pre>\n<p>If this returns &#8220;icecast&#8221;, hooray, you can just do the following:<\/p>\n<pre><code class=\"\" data-line=\"\">ffmpeg -re -i rtmp:\/\/192.168.22.12\/live\/live1 -vn \\\n       -codec:a libmp3lame -b:a 64k -f mp3 \\\n       -content_type audio\/mpeg \\\n       icecast:\/\/source:pass@example.com:8000\/mountpoint.mp3\n<\/code><\/pre>\n<p>Replace <code class=\"\" data-line=\"\">source<\/code> with a specific username, if you have configured any, else leave it as source. The other things should be obvious.<\/p>\n<p>&nbsp;<\/p>\n<\/div>\n<\/div>\n<\/blockquote>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p class=\"excerpt\">Source: audio &#8211; how to transform live RTMP video to live mp3 Icecast stream &#8211; Stack Overflow<\/p>\n<p class=\"more-link-p\"><a class=\"more-link\" href=\"https:\/\/monodes.com\/predaelli\/2021\/01\/03\/audio-how-to-transform-live-rtmp-video-to-live-mp3-icecast-stream-stack-overflow\/\">Read more &rarr;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":4,"activitypub_interaction_policy_quote":"anyone","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[97],"tags":[],"class_list":["post-7993","post","type-post","status-publish","format-standard","hentry","category-basilicas-website"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p6daft-24V","jetpack-related-posts":[{"id":8347,"url":"https:\/\/monodes.com\/predaelli\/2021\/04\/11\/ffmpeg-to-youtube-live\/","url_meta":{"origin":7993,"position":0},"title":"FFMPEG to Youtube Live","author":"Paolo Redaelli","date":"2021-04-11","format":false,"excerpt":"video - FFMPEG to Youtube Live - Stack Overflow After a lot of trial and error the solution below works pretty much perfectly. To make sure it runs 24\/7 wrap it inside a service of some description. This is with an up to date version of FFMPEG to include -stream_loop\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7361,"url":"https:\/\/monodes.com\/predaelli\/2020\/06\/25\/how-to-easily-stream-to-two-or-more-locations-the-helping-squad\/","url_meta":{"origin":7993,"position":1},"title":"How to easily stream to two or more locations? \u2013 The Helping Squad","author":"Paolo Redaelli","date":"2020-06-25","format":false,"excerpt":"Streaming to more than one service can be done using an RTMP Server that relays your input to several outputs or using an external service. Services like restream.io offer free and paid options to send your stream to several services at the same time. Source: How to easily stream to\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":7987,"url":"https:\/\/monodes.com\/predaelli\/2021\/01\/03\/broadcast-live-video-live-streaming-html5-webrtc-hls-rtsp-rtmp-wordpress-plugin-wordpress-org\/","url_meta":{"origin":7993,"position":2},"title":"Broadcast Live Video \u2013 Live Streaming : HTML5, WebRTC, HLS, RTSP, RTMP \u2013 WordPress plugin | WordPress.org","author":"Paolo Redaelli","date":"2021-01-03","format":false,"excerpt":"Live video streaming, webcam broadcasting app and player with chat, external apps support, 24\/7 IP cameras, video playlists, video archiving & vod \u2026 I shall someday add this Broadcast Live Video \u2013 Live Streaming : HTML5, WebRTC, HLS, RTSP, RTMP \u2013 WordPress plugin to www.pastoraledesio.it. Or maybe I'll just use\u2026","rel":"","context":"In &quot;Basilica's website&quot;","block_context":{"text":"Basilica's website","link":"https:\/\/monodes.com\/predaelli\/category\/basilicas-website\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":9614,"url":"https:\/\/monodes.com\/predaelli\/2022\/09\/18\/self-hosted-streaming-server-nginx-rtmp-youtube-facebook-live\/","url_meta":{"origin":7993,"position":3},"title":"Self-Hosted Streaming Server \u2013 NGINX + RTMP \u2013 YouTube + Facebook Live","author":"Paolo Redaelli","date":"2022-09-18","format":false,"excerpt":"Copying this here in case the original goes offline Self-Hosted Streaming Server \u2013 NGINX + RTMP \u2013 YouTube + Facebook Live Published by Anthony on 14th April 2020 I\u2019m writing these notes up, mainly as a reference for me in the future \u2013 but they might just help others looking\u2026","rel":"","context":"In &quot;Basilica's website&quot;","block_context":{"text":"Basilica's website","link":"https:\/\/monodes.com\/predaelli\/category\/basilicas-website\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/screenshot-2015-06-10-16-01-521.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/screenshot-2015-06-10-16-01-521.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/monodes.com\/predaelli\/wp-content\/uploads\/sites\/4\/2015\/06\/screenshot-2015-06-10-16-01-521.png?resize=525%2C300&ssl=1 1.5x"},"classes":[]},{"id":6743,"url":"https:\/\/monodes.com\/predaelli\/2020\/02\/25\/muses-radio-player-the-html5-mp3-ogg-aac-live-stream-player\/","url_meta":{"origin":7993,"position":4},"title":"Muses Radio Player &#8211; The HTML5 MP3\/OGG\/AAC Live Stream Player!","author":"Paolo Redaelli","date":"2020-02-25","format":"link","excerpt":"Muses Radio Player - The HTML5 MP3\/OGG\/AAC Live Stream Player!","rel":"","context":"In &quot;Basilica's website&quot;","block_context":{"text":"Basilica's website","link":"https:\/\/monodes.com\/predaelli\/category\/basilicas-website\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":6834,"url":"https:\/\/monodes.com\/predaelli\/2020\/03\/04\/useful-ffmpeg-commands-for-working-with-audio-and-video-files-digital-inspiration\/","url_meta":{"origin":7993,"position":5},"title":"Useful FFmpeg Commands for Working with Audio and Video Files &#8211; Digital Inspiration","author":"Paolo Redaelli","date":"2020-03-04","format":"link","excerpt":"Useful FFmpeg Commands for Working with Audio and Video Files - Digital Inspiration Useful FFmpeg Commands FFmpeg supports all popular audio and video formats. Or you can running the command .\/ffmpeg -formats to get a list of every format that is supported by your FFmpeg installation. If you are just\u2026","rel":"","context":"In &quot;Documentations&quot;","block_context":{"text":"Documentations","link":"https:\/\/monodes.com\/predaelli\/category\/documentations\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/7993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/comments?post=7993"}],"version-history":[{"count":0,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/posts\/7993\/revisions"}],"wp:attachment":[{"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/media?parent=7993"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/categories?post=7993"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/monodes.com\/predaelli\/wp-json\/wp\/v2\/tags?post=7993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}