Welcome to My iptv forum

  • Everyone is invited! My iptv forum is for everyone, new and advanced user alike!
  • Searching is key! Before you post a question, use the forum search feature to determine whether your topic has already been covered.
  • Do not start flame wars! If someone has engaged in behavior that is detrimental to the discussion -- spamming, harassment, etc -- report the post and we'll take a look.
  • Tutorial Encode and share your own HLS IPTV channel using VLC, Debian 10 and FFMPEG

    Tutorial Encode and share your own HLS IPTV channel using VLC, Debian 10 and FFMPEG
    A Offline

    agon

    Member
    Member
    Apr 4, 2020
    1,022
    8,494
    113
    This is a basic and simple tutorial to stream your own channel to the world using HLS streaming (.m3u8), using my own recent experience.

    In this case I'll be using one computer (in my home) to generate the source using VLC and other (Cloud VM) as server to distribute the content, due to low bandwidth in the generator side,

    I'm using Debian GNU/Linux 10 as example in the server side, but you can adapt to use in any other OS. I'm presuming who will use this tutorial already know at least the basics of Debian (or Ubuntu) and VLC. Check the local and server machine have full access to the internet and the desired ports open and forwarded, in this example I'm using HTTP port (80) in the web server and 30000 port in my home.

    Firts, install Apache 2 HTTP server and FFMPEG in your Debian server side

    $ sudo su
    # apt update
    # apt install apache2 ffmpeg

    Now start the apache 2 server, go to your server http root, create a subfolder folder that we'll use for stream your live channel, make permissions.

    # service apache2 start
    # cd /var/www/html
    # mkdir myiptv
    # chmod 775 myiptv -R

    Install VLC in your home computer (I'm using Windows here) and open it, Go to Media > Stream

    KnMwNF1.jpg



    You can use capture devices like Webcam, Tuner Card, Network source, local file, or a Disc devices. I'm using my webcam in Windows side in this tutorial.

    a5C4NB6.jpg



    Press Next in the source and when in Destination Setup screen select HTTP and click on Add

    SlujxIE.jpg



    I'd changed the port to 30000 because my ISP blocks to serve lower ports usage.

    BdGqHww.jpg



    Change the profile to H.264 + MP3 TS and click in the tool icon

    kdO9F06.jpg



    Use H.264 as default video codec with desired bitrate

    oE6oTVc.jpg



    Use AC3 as default audio codec with desired bitrate, "Save"

    dHY45iS.jpg



    click on "Next" and on "Stream".

    Check your Home PC address to the internet, in this example I'll use 123.45.67.89 , If your PC is behind a NAT, forward the port in your router to your PC.

    Get back to the server and run the FFMPEG to re-stream your content in HLS format:

    $ ffmpeg -i
    Please, Log in or Register to view URLs content!
    -c:v copy -c:a copy -f hls -hls_time 10 -hls_list_size 6 -hls_wrap 10 /var/www/html/myiptv/stream.m3u8

    As the FFMPEG is not encoding in this example, just restreaming the content, there is no extra CPU usage.

    Now you can access the URL from your server in your browser, in the example I'll use 198.76.54.32 as the server IP

    E4LRW93.jpg


    Now it's running and UP! Now you are able to share your HLS URL "
    Please, Log in or Register to view URLs content!
    " with the world!

    After this you can learn more about FFMPEG and how to use some of your hardware features to decode and use less CPU, stream more substreams, etc... how to configure other Apache2 features and automatize your server side to run the FFMPEG when start and try to reconnect when have disconnection.
     
    A Offline

    Ali Baba

    Guest
    Thank you ! ! !
     

    Create an account or login to comment

    You must be a member in order to leave a comment

    Create account

    Create an account on our community. It's easy!

    Log in

    Already have an account? Log in here.

    Top Posters of the Month

    Online statistics

    Members online
    112
    Guests online
    579
    Total visitors
    691
    18,362Threads
    64,067Messages
    62,909Members
    RoimedLatest member
    Top