Home/News | About | Download | Documentation | Forum | Bug Reports | Contact | Donations | Consulting | Projects | Legal | Security | FATE


This forum has not been maintained for a long time and will probably get deleted in the near future.
For faster responses to your questions, please use StackOverflow instead and tag your questions with "FFmpeg".
If you need a backup of the posts from this forum, please contact me directly.

example code for re-stream

Discussions about problems encountered using ffmpeg.
Forum rules
FFmpeg is in a state of perpetual development and we do not currently have the person power to backport fixes to official releases. As such, if you wish to query or report a bug, you must try with the latest development branch revision of FFmpeg to confirm the issue still exists. The latest FFmpeg can be downloaded from here: http://www.ffmpeg.org/download.html

example code for re-stream

Postby samlolol » Sun Sep 17, 2017 2:52 pm

hello.
i try to re-stream hls >> rtmp
i found this code -
Code: Select all
ffmpeg -i "LINKLINK/example.m3u8" -ar 44100 -vcodec libx264 -r 25 -b:v 500k -f flv "LINKLINK/stream";

its work great except the quality..
the original stream is HD but after i stream that i get so bad quality
can someone give me a code for restreaming not lose the orginal stream qaulity?
~thanks! :)
samlolol
 
Posts: 4
Joined: Sun Sep 17, 2017 2:43 pm

Re: example code for re-stream

Postby llogan » Sun Sep 17, 2017 7:03 pm

Increase the bitrate or stream copy it if possible.
Get an answer more quickly by providing your actual ffmpeg command and the complete console output. Use the code button to format your command and output or your question will be ignored.
llogan
 
Posts: 2360
Joined: Fri Jan 25, 2013 9:47 pm
Location: Alaska

Re: example code for re-stream

Postby samlolol » Mon Sep 18, 2017 3:45 pm

llogan wrote:Increase the bitrate or stream copy it if possible.

its give me a few output lines and then its "crash" (i tried 1000/1500/800)

btw i try this code i found on the int..
Code: Select all
ffmpeg -i "link/1.m3u8" -bsf:a aac_adtstoasc -c copy -vb 400k -maxrate 1500k -deinterlace -vcodec libx264 -f flv "link/rtmp"

it work good.. with the same quality but it dont have audio.. (sorry for ask those stupid questions.. i really don't know nothing about/in ffmpeg.. normally i use wowza for streaming {because i don't need any knowledge there :D} but the m3u8 link cannot work with wowza..)
~thanks
samlolol
 
Posts: 4
Joined: Sun Sep 17, 2017 2:43 pm

Re: example code for re-stream

Postby llogan » Tue Sep 19, 2017 4:15 am

samlolol wrote:it work good.. with the same quality but it dont have audio..

Show the complete console output from your command.
Get an answer more quickly by providing your actual ffmpeg command and the complete console output. Use the code button to format your command and output or your question will be ignored.
llogan
 
Posts: 2360
Joined: Fri Jan 25, 2013 9:47 pm
Location: Alaska

Re: example code for re-stream

Postby samlolol » Tue Sep 19, 2017 4:37 pm

llogan wrote:
samlolol wrote:it work good.. with the same quality but it dont have audio..

Show the complete console output from your command.

Code: Select all
root@one:~# ffmpeg -i "http://api.m3u8.com/1.m3u8" -ar 44100 -vcodec libx264 -r 25 -b:v 1500k -f flv "rtmp://api.rtmp.com/rtmp";
ffmpeg version 2.8.11-0ubuntu0.16.04.1 Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.0 (Ubuntu 5.4.0-6ubuntu1~16.04.4) 20160609
  configuration: --prefix=/usr --extra-version=0ubuntu0.16.04.1 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
  libavutil      54. 31.100 / 54. 31.100
  libavcodec     56. 60.100 / 56. 60.100
  libavformat    56. 40.101 / 56. 40.101
  libavdevice    56.  4.100 / 56.  4.100
  libavfilter     5. 40.101 /  5. 40.101
  libavresample   2.  1.  0 /  2.  1.  0
  libswscale      3.  1.101 /  3.  1.101
  libswresample   1.  2.101 /  1.  2.101
  libpostproc    53.  3.100 / 53.  3.100
[http @ 0x6b6280] No trailing CRLF found in HTTP header.
Input #0, hls,applehttp, from 'http://api.m3u8.com/1.m3u8':
  Duration: N/A, start: 5696.463811, bitrate: N/A
  Program 0
    Metadata:
      variant_bitrate : 3744184
    Stream #0:0: Video: h264 (Main) ([27][0][0][0] / 0x001B), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 tbr, 90k tbn, 50 tbc
    Metadata:
      variant_bitrate : 3744184
    Stream #0:1: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000 Hz, stereo, fltp, 150 kb/s
    Metadata:
      variant_bitrate : 3744184
[libx264 @ 0x7fa9a0] using SAR=1/1
[libx264 @ 0x7fa9a0] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x7fa9a0] profile High, level 4.0
[libx264 @ 0x7fa9a0] 264 - core 148 r2643 5c65704 - H.264/MPEG-4 AVC codec - Copyleft 2003-2015 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=6 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=abr mbtree=1 bitrate=1500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, flv, to 'rtmp://api.rtmp.com/rtmp':
  Metadata:
    encoder         : Lavf56.40.101
    Stream #0:0: Video: h264 (libx264) ([7][0][0][0] / 0x0007), yuv420p, 1920x1080 [SAR 1:1 DAR 16:9], q=-1--1, 1500 kb/s, 25 fps, 1k tbn, 25 tbc
    Metadata:
      variant_bitrate : 3744184
      encoder         : Lavc56.60.100 libx264
    Stream #0:1: Audio: mp3 (libmp3lame) ([2][0][0][0] / 0x0002), 44100 Hz, stereo, fltp
    Metadata:
      variant_bitrate : 3744184
      encoder         : Lavc56.60.100 libmp3lame
Stream mapping:
  Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
  Stream #0:1 -> #0:1 (aac (native) -> mp3 (libmp3lame))
Press [q] to stop, [?] for help
[http @ 0x704b20] No trailing CRLF found in HTTP header..72 bitrate=1019.9kbits/s
root@one:~#

samlolol
 
Posts: 4
Joined: Sun Sep 17, 2017 2:43 pm

Re: example code for re-stream

Postby llogan » Tue Sep 19, 2017 9:07 pm

I personally don't do any streaming, so I don't have much experience with it, but I do know your ffmpeg is old. Get a new one and try again:
https://johnvansickle.com/ffmpeg/
Get an answer more quickly by providing your actual ffmpeg command and the complete console output. Use the code button to format your command and output or your question will be ignored.
llogan
 
Posts: 2360
Joined: Fri Jan 25, 2013 9:47 pm
Location: Alaska

Re: example code for re-stream

Postby samlolol » Mon Sep 25, 2017 1:05 pm

llogan wrote:I personally don't do any streaming, so I don't have much experience with it, but I do know your ffmpeg is old. Get a new one and try again:
https://johnvansickle.com/ffmpeg/

ok. i will try it.. thanks! :)
samlolol
 
Posts: 4
Joined: Sun Sep 17, 2017 2:43 pm


Return to ffmpeg

Who is online

Users browsing this forum: Alexa [Bot], Bing [Bot], Yahoo [Bot] and 8 guests