Greetings I run a server that is streaming out to a website on the Net I use the following command which is working. /root/bin/ffmpeg -re -i /data/video/sinhala/innput-15m.mp4 -acodec copy -vcodec copy -f flv -metadata streamName=xlarge rtmp://some.site.com. My client is complaining that the bit rate is varying too much and they want the bit-rate never to exceed 2m. They would also prefer if I can send them a constant bit rate. I looked at the Net and found the suggestion to use "-maxrate 1.5M -bufsize 3M" , I tried the following: /root/bin/ffmpeg -re -i /data/video/sinhala/innput-15m.mp4 -acodec copy -vcodec copy -maxrate 1.5M -bufsize 3M -f flv -metadata streamName=xlarge rtmp://some.site.com. but I get this error: Systax error. I do not know what the syntax error can be and would much appreciate to have a word of advice. regards Mettavihari
On Tuesday, June 27, 2017 7:09:46 PM CDT Mettavihari D wrote:
I tried the following: /root/bin/ffmpeg -re -i /data/video/sinhala/innput-15m.mp4 -acodec copy -vcodec copy -maxrate 1.5M -bufsize 3M -f flv -metadata streamName=xlarge rtmp://some.site.com.
You cannot adjust the bitrate of the stream without re-encoding it. (i.e. you cannot use "-vcodec copy”) -Reuben
Greetings Thank you for the note What do you suggest that I put in this line If I can have the syntax to use then I can adjust the values. Regards Mettavihari On Wed, Jun 28, 2017 at 7:17 AM, Reuben Martin <reuben.m@gmail.com> wrote:
On Tuesday, June 27, 2017 7:09:46 PM CDT Mettavihari D wrote:
I tried the following: /root/bin/ffmpeg -re -i /data/video/sinhala/innput-15m.mp4 -acodec copy -vcodec copy -maxrate 1.5M -bufsize 3M -f flv -metadata streamName=xlarge rtmp://some.site.com.
You cannot adjust the bitrate of the stream without re-encoding it. (i.e. you cannot use "-vcodec copy”)
-Reuben
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
-- Streaming video from http://learntv.lk
Greetings On Wed, Jun 28, 2017 at 3:56 PM, Mettavihari D <tv.lists@gmail.com> wrote:
Greetings
Thank you for the note What do you suggest that I put in this line If I can have the syntax to use then I can adjust the values.
Regards Mettavihari
On Wed, Jun 28, 2017 at 7:17 AM, Reuben Martin <reuben.m@gmail.com> wrote:
On Tuesday, June 27, 2017 7:09:46 PM CDT Mettavihari D wrote:
I tried the following: /root/bin/ffmpeg -re -i /data/video/sinhala/innput-15m.mp4 -acodec copy -vcodec copy -maxrate 1.5M -bufsize 3M -f flv -metadata streamName=xlarge rtmp://some.site.com.
You cannot adjust the bitrate of the stream without re-encoding it. (i.e. you cannot use "-vcodec copy”)
-Reuben
Does this syntax look OK /root/bin/ffmpeg -re -i /data/video/sinhala/input-15m.mp4 -b 1500k -minrate 1500k -maxrate 1500k -bufsize 3000k -f flv -metadata streamName=xlarge rtmp://some.site.com. regards Mettavihari
_______________________________________________ ffmpeg-user mailing list ffmpeg-user@ffmpeg.org http://ffmpeg.org/mailman/listinfo/ffmpeg-user
To unsubscribe, visit link above, or email ffmpeg-user-request@ffmpeg.org with subject "unsubscribe".
-- Streaming video from http://learntv.lk
-- Streaming video from http://learntv.lk
Greetings, I have tried this several ways, but keep getting errors. My problem is that the recipient wants a fixed bitrate and that my stream is varying in bitrate.
Thank you for the note What do you suggest that I put in this line If I can have the syntax to use then I can adjust the values.
On Wed, Jun 28, 2017 at 7:17 AM, Reuben Martin <reuben.m@gmail.com> wrote:
On Tuesday, June 27, 2017 7:09:46 PM CDT Mettavihari D wrote:
I tried the following: /root/bin/ffmpeg -re -i /data/video/sinhala/innput-15m.mp4 -acodec copy -vcodec copy -maxrate 1.5M -bufsize 3M -f flv -metadata streamName=xlarge rtmp://some.site.com.
You cannot adjust the bitrate of the stream without re-encoding it. (i.e. you cannot use "-vcodec copy”)
-Reuben
Does this syntax look OK
/root/bin/ffmpeg -re -i /data/video/sinhala/input-15m.mp4 -b 1500k -minrate 1500k -maxrate 1500k -bufsize 3000k -f flv -metadata streamName=xlarge rtmp://some.site.com.
when I run this on the command line it is working. ffmpeg -i file.mp4 -acodec libfdk_aac -b:a 128k -vcodec libx264 -preset fast -b:v 1500k -minrate 1500k -maxrate 1500k -bufsize 3000k -f mp4 outfile.mp4 When I run this in a script I get errors. ffmpeg_pids.append(subprocess32.Popen([args['ffmpeg_path'], '-re', '-i', args['content_dir']+'/'+args['channel_dir']+"/"+dharmavahini, '-acodec', 'libfdk_aac', '-b:a 128k', '-vcodec', 'libx264', '-b:v 1500k', '-minrate 1500k -maxrate 1500k -bufsize 1500k', '-f', 'flv', '-metadata', 'streamName=xlarge', 'rtmp://site'])) The errors are given below. Unable to find a suitable output format for 'libx264' libx264: Invalid argument ffmpeg version N-86069-ga453f55 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11) configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 libavutil 55. 62.100 / 55. 62.100 libavcodec 57. 95.101 / 57. 95.101 libavformat 57. 72.101 / 57. 72.101 libavdevice 57. 7.100 / 57. 7.100 libavfilter 6. 89.100 / 6. 89.100 libswscale 4. 7.101 / 4. 7.101 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 /media/data/playlists/yupptv/sutta/satipattana-15m.mp4: No such file or directory ffmpeg version N-86069-ga453f55 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11) configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 libavutil 55. 62.100 / 55. 62.100 libavcodec 57. 95.101 / 57. 95.101 libavformat 57. 72.101 / 57. 72.101 libavdevice 57. 7.100 / 57. 7.100 libavfilter 6. 89.100 / 6. 89.100 libswscale 4. 7.101 / 4. 7.101 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/media/data/video/yupptv/sutta/satipattana-15m.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf54.3.100 Duration: 01:12:47.78, start: 0.000000, bitrate: 1603 kb/s Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 704x396 [SAR 3:4 DAR 4:3], 1468 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default) Metadata: handler_name : SoundHandler [NULL @ 0x3ca53a0] Unable to find a suitable output format for 'libx264' libx264: Invalid argument A hint on where to read more on this is very useful. regards Mettavihari
On Mon, Jul 24, 2017 at 09:30:38 +0530, Mettavihari D wrote:
when I run this on the command line it is working. [...] When I run this in a script I get errors.
Apparently, you use a differently built ffmpeg in the script.
--enable-libvorbis --enable-libvpx --enable-libx264 [...] [NULL @ 0x3ca53a0] Unable to find a suitable output format for 'libx264' libx264: Invalid argument
A hint on where to read more on this is very useful.
Though your ffmpeg's configure command line told it to build with libx264, that apparently didn't work, and this ffmpeg doesn't support libx264. (You can double-check with "ffmpeg -encoders".) Can you not use the same ffmpeg as you use "on the command line" for your script? Otherwise, you need to rebuild that ffmpeg which is called from the script in presence of the "libx264-devel" package, or you need to build libx264 yourself beforehand, and make sure it is found while configuring, see this section of the RedHat compilation guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#libx264 Hope this helps, Moritz
Greetings Thank you for the mail. On Mon, Jul 24, 2017 at 2:46 PM, Moritz Barsnick <barsnick@gmx.net> wrote:
On Mon, Jul 24, 2017 at 09:30:38 +0530, Mettavihari D wrote:
when I run this on the command line it is working. [...] When I run this in a script I get errors.
Apparently, you use a differently built ffmpeg in the script.
I do not understand where you get that from. I have different versions on the machine, but I have given the path to the latest version in the script.
--enable-libvorbis --enable-libvpx --enable-libx264 [...] [NULL @ 0x3ca53a0] Unable to find a suitable output format for 'libx264' libx264: Invalid argument
A hint on where to read more on this is very useful.
Though your ffmpeg's configure command line told it to build with libx264, that apparently didn't work, and this ffmpeg doesn't support libx264. (You can double-check with "ffmpeg -encoders".)
Thank you for this info. I have pasted the output below.
Can you not use the same ffmpeg as you use "on the command line" for your script?
That is what I think I have done but you may see a fault that I do not see.
Otherwise, you need to rebuild that ffmpeg which is called from the script in presence of the "libx264-devel" package, or you need to build libx264 yourself beforehand, and make sure it is found while configuring, see this section of the RedHat compilation guide: https://trac.ffmpeg.org/wiki/CompilationGuide/Centos#libx264
I have put my compilation below and the other info also below. I very much appreciate you help with this, since it is troubling me for a long time. Mettavihari This is my .bash_histry file cat readme.txt cd ffmpeg PKG_CONFIG_PATH="$HOME/ffmpeg_build/lib/pkgconfig" ./configure --prefix="$HOME/ffmpeg_build" --extra-cflags="-I$HOME/ffmpeg_build/include" --extra-ldflags="-L$HOME/ffmpeg_build/lib -ldl" --bindir="$HOME/bin" --pkg-config-flags="--static" --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 make make install To my understanding I have done it correct. But you may find some error in it. [root@spancro /]# which x264 /root/bin/x264 [root@spancro /]# which libx264 /usr/bin/which: no libx264 in (/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/ant/bin:/usr/local/ant/bin:/root/bin) These are some of the files in my pc. ./usr/lib64/pkgconfig/x264.pc ./usr/lib64/libx264.so.142 ./usr/lib64/libx264.so ./usr/include/x264_config.h ./usr/include/x264.h ./root/bin/x264 ./root/ffmpeg_build/lib/pkgconfig/x264.pc ./root/ffmpeg_build/lib/libx264.a ./root/ffmpeg_build/include/x264.h ./root/ffmpeg_build/include/x264_config.h path /bin/ lrwxrwxrwx. 1 root root 16 Jul 24 18:14 ffmpeg -> /root/bin/ffmpeg -rwxr-xr-x. 1 root root 222288 Sep 5 2015 ffmpeg-old -rwxr-xr-x. 1 root root 123368 Sep 5 2015 ffplay -rwxr-xr-x. 1 root root 143104 Sep 5 2015 ffprobe -rwxr-xr-x. 1 root root 140752 Sep 5 2015 ffserver path /root/bin/ -rwxr-xr-x. 1 root root 22390168 May 15 11:05 ffmpeg -rwxr-xr-x. 1 root root 22312312 May 15 11:05 ffprobe -rwxr-xr-x. 1 root root 20232248 May 15 11:05 ffserver -rwxr-xr-x. 1 root root 484480 May 15 10:18 lame -rwxr-xr-x. 1 root root 2565892 May 15 09:53 vsyasm -rwxr-xr-x. 1 root root 1401416 May 15 10:02 x264 -rwxr-xr-x. 1 root root 2563135 May 15 09:53 yasm -rwxr-xr-x. 1 root root 2540064 May 15 09:53 ytasm In my script I give the path to ffmpeg binaries as /opt/dls/play.py --content-dir /media/data --ffmpeg-path /root/bin/ffmpeg --segment.....etc [root@spancro ~]# ffmpeg -encoders ffmpeg version N-86069-ga453f55 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11) configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 libavutil 55. 62.100 / 55. 62.100 libavcodec 57. 95.101 / 57. 95.101 libavformat 57. 72.101 / 57. 72.101 libavdevice 57. 7.100 / 57. 7.100 libavfilter 6. 89.100 / 6. 89.100 libswscale 4. 7.101 / 4. 7.101 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 Encoders: V..... = Video A..... = Audio S..... = Subtitle .F.... = Frame-level multithreading ..S... = Slice-level multithreading ...X.. = Codec is experimental ....B. = Supports draw_horiz_band .....D = Supports direct rendering method 1 ------ V..... a64multi Multicolor charset for Commodore 64 (codec a64_multi) V..... a64multi5 Multicolor charset for Commodore 64, extended with 5th color (colram) (codec a64_multi5) V..... alias_pix Alias/Wavefront PIX image V..... amv AMV Video V..... apng APNG (Animated Portable Network Graphics) image V..... asv1 ASUS V1 V..... asv2 ASUS V2 V..... avrp Avid 1:1 10-bit RGB Packer V..X.. avui Avid Meridien Uncompressed V..... ayuv Uncompressed packed MS 4:4:4:4 V..... bmp BMP (Windows and OS/2 bitmap) V..... cinepak Cinepak V..... cljr Cirrus Logic AccuPak V.S... vc2 SMPTE VC-2 (codec dirac) V.S... dnxhd VC3/DNxHD V..... dpx DPX (Digital Picture Exchange) image VFS... dvvideo DV (Digital Video) V.S... ffv1 FFmpeg video codec #1 VF.... ffvhuff Huffyuv FFmpeg variant V..... flashsv Flash Screen Video V..... flashsv2 Flash Screen Video Version 2 V..... flv FLV / Sorenson Spark / Sorenson H.263 (Flash Video) (codec flv1) V..... gif GIF (Graphics Interchange Format) V..... h261 H.261 V..... h263 H.263 / H.263-1996 V.S... h263p H.263+ / H.263-1998 / H.263 version 2 V..... libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264) V..... libx264rgb libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 RGB (codec h264) V..... h264_nvenc NVIDIA NVENC H.264 encoder (codec h264) V..... nvenc NVIDIA NVENC H.264 encoder (codec h264) V..... nvenc_h264 NVIDIA NVENC H.264 encoder (codec h264) V..... nvenc_hevc NVIDIA NVENC hevc encoder (codec hevc) V..... hevc_nvenc NVIDIA NVENC hevc encoder (codec hevc) VF.... huffyuv Huffyuv / HuffYUV V..... jpeg2000 JPEG 2000 VF.... jpegls JPEG-LS VF.... ljpeg Lossless JPEG VFS... mjpeg MJPEG (Motion JPEG) V.S... mpeg1video MPEG-1 video V.S... mpeg2video MPEG-2 video V.S... mpeg4 MPEG-4 part 2 V..... msmpeg4v2 MPEG-4 part 2 Microsoft variant version 2 V..... msmpeg4 MPEG-4 part 2 Microsoft variant version 3 (codec msmpeg4v3) V..... msvideo1 Microsoft Video-1 V..... pam PAM (Portable AnyMap) image V..... pbm PBM (Portable BitMap) image V..... pcx PC Paintbrush PCX image V..... pgm PGM (Portable GrayMap) image V..... pgmyuv PGMYUV (Portable GrayMap YUV) image VF.... png PNG (Portable Network Graphics) image V..... ppm PPM (Portable PixelMap) image VF.... prores Apple ProRes VF.... prores_aw Apple ProRes (codec prores) V.S... prores_ks Apple ProRes (iCodec Pro) (codec prores) V..... qtrle QuickTime Animation (RLE) video V..... r10k AJA Kona 10-bit RGB Codec V..... r210 Uncompressed RGB 10-bit V..... rawvideo raw video V..... roqvideo id RoQ video (codec roq) V..... rv10 RealVideo 1.0 V..... rv20 RealVideo 2.0 V..... sgi SGI image V..... snow Snow V..... sunrast Sun Rasterfile image V..... svq1 Sorenson Vector Quantizer 1 / Sorenson Video 1 / SVQ1 V..... targa Truevision Targa image VF.... tiff TIFF image VF.... utvideo Ut Video V..... v210 Uncompressed 4:2:2 10-bit V..... v308 Uncompressed packed 4:4:4 V..... v408 Uncompressed packed QT 4:4:4:4 V..... v410 Uncompressed 4:4:4 10-bit V..... libvpx libvpx VP8 (codec vp8) V..... libvpx-vp9 libvpx VP9 (codec vp9) V..... wmv1 Windows Media Video 7 V..... wmv2 Windows Media Video 8 V..... wrapped_avframe AVFrame to AVPacket passthrough V..... xbm XBM (X BitMap) image V..... xface X-face image V..... xwd XWD (X Window Dump) image V..... y41p Uncompressed YUV 4:1:1 12-bit V..... yuv4 Uncompressed packed 4:2:0 VF.... zlib LCL (LossLess Codec Library) ZLIB V..... zmbv Zip Motion Blocks Video A..... aac AAC (Advanced Audio Coding) A..... libfdk_aac Fraunhofer FDK AAC (codec aac) A..... ac3 ATSC A/52A (AC-3) A..... ac3_fixed ATSC A/52A (AC-3) (codec ac3) A..... adpcm_adx SEGA CRI ADX ADPCM A..... g722 G.722 ADPCM (codec adpcm_g722) A..... g726 G.726 ADPCM (codec adpcm_g726) A..... adpcm_ima_qt ADPCM IMA QuickTime A..... adpcm_ima_wav ADPCM IMA WAV A..... adpcm_ms ADPCM Microsoft A..... adpcm_swf ADPCM Shockwave Flash A..... adpcm_yamaha ADPCM Yamaha A..... alac ALAC (Apple Lossless Audio Codec) A..... comfortnoise RFC 3389 comfort noise generator A..X.. dca DCA (DTS Coherent Acoustics) (codec dts) A..... eac3 ATSC A/52 E-AC-3 A..... flac FLAC (Free Lossless Audio Codec) A..... g723_1 G.723.1 A..X.. mlp MLP (Meridian Lossless Packing) A..... mp2 MP2 (MPEG audio layer 2) A..... mp2fixed MP2 fixed point (MPEG audio layer 2) (codec mp2) A..... libmp3lame libmp3lame MP3 (MPEG audio layer 3) (codec mp3) A..... nellymoser Nellymoser Asao A..X.. opus Opus A..... pcm_alaw PCM A-law / G.711 A-law A..... pcm_f32be PCM 32-bit floating point big-endian A..... pcm_f32le PCM 32-bit floating point little-endian A..... pcm_f64be PCM 64-bit floating point big-endian A..... pcm_f64le PCM 64-bit floating point little-endian A..... pcm_mulaw PCM mu-law / G.711 mu-law A..... pcm_s16be PCM signed 16-bit big-endian A..... pcm_s16be_planar PCM signed 16-bit big-endian planar A..... pcm_s16le PCM signed 16-bit little-endian A..... pcm_s16le_planar PCM signed 16-bit little-endian planar A..... pcm_s24be PCM signed 24-bit big-endian A..... pcm_s24daud PCM D-Cinema audio signed 24-bit A..... pcm_s24le PCM signed 24-bit little-endian A..... pcm_s24le_planar PCM signed 24-bit little-endian planar A..... pcm_s32be PCM signed 32-bit big-endian A..... pcm_s32le PCM signed 32-bit little-endian A..... pcm_s32le_planar PCM signed 32-bit little-endian planar A..... pcm_s64be PCM signed 64-bit big-endian A..... pcm_s64le PCM signed 64-bit little-endian A..... pcm_s8 PCM signed 8-bit A..... pcm_s8_planar PCM signed 8-bit planar A..... pcm_u16be PCM unsigned 16-bit big-endian A..... pcm_u16le PCM unsigned 16-bit little-endian A..... pcm_u24be PCM unsigned 24-bit big-endian A..... pcm_u24le PCM unsigned 24-bit little-endian A..... pcm_u32be PCM unsigned 32-bit big-endian A..... pcm_u32le PCM unsigned 32-bit little-endian A..... pcm_u8 PCM unsigned 8-bit A..... real_144 RealAudio 1.0 (14.4K) (codec ra_144) A..... roq_dpcm id RoQ DPCM A..X.. s302m SMPTE 302M A..X.. sonic Sonic A..X.. sonicls Sonic lossless A..X.. truehd TrueHD A..... tta TTA (True Audio) A..X.. vorbis Vorbis A..... libvorbis libvorbis (codec vorbis) A..... wavpack WavPack A..... wmav1 Windows Media Audio 1 A..... wmav2 Windows Media Audio 2 S..... ssa ASS (Advanced SubStation Alpha) subtitle (codec ass) S..... ass ASS (Advanced SubStation Alpha) subtitle S..... dvbsub DVB subtitles (codec dvb_subtitle) S..... dvdsub DVD subtitles (codec dvd_subtitle) S..... mov_text 3GPP Timed Text subtitle S..... srt SubRip subtitle (codec subrip) S..... subrip SubRip subtitle S..... text Raw text subtitle S..... webvtt WebVTT subtitle S..... xsub DivX subtitles (XSUB) [root@spancro ~]#
On Mon, Jul 24, 2017 at 19:00:42 +0530, Mettavihari D wrote:
I do not understand where you get that from. I have different versions on the machine, but I have given the path to the latest version in the script.
Well, I was wondering why it worked on the command line, but not in the script. But actually: I read the error message incorrectly. Sorry. :-(
[root@spancro /]# which libx264
That's not a binary, so "which" won't find it. (Nevermind, you gave enough info by listing your files.)
[root@spancro ~]# ffmpeg -encoders
I seriously hope you're not running your conversion as root!
V..... libx264 libx264 H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 (codec h264)
That's fine. This is what I missed to interpret correctly:
[NULL @ 0x3ca53a0] Unable to find a suitable output format for 'libx264' libx264: Invalid argument
It means ffmpeg sees "libx264" in your command line as an output "file"/URI. Unfortunately, we can't read the complete command line from this:
ffmpeg_pids.append(subprocess32.Popen([args['ffmpeg_path'], '-re', '-i', args['content_dir']+'/'+args['channel_dir']+"/"+dharmavahini, '-acodec', 'libfdk_aac', '-b:a 128k', '-vcodec', 'libx264', '-b:v 1500k', '-minrate 1500k -maxrate 1500k -bufsize 1500k', '-f', 'flv', '-metadata', 'streamName=xlarge', 'rtmp://site']))
(BTW, you merge some arguments, and some not. Even if it works, that's inconsistent.) We need to see the proper *actual* command line used (minus your hidden output URL). You can add "-loglevel debug", that will (among others) display ffmpeg's option parsing. But the easiest way is to add the option "-report" to the command line, and then grab the resulting file "ffmpeg-20170724-162640.log" (or similar) and show us the top where it says: Command line: ffmpeg -report [...] ffmpeg version N-86781-gd8f1982 Copyright (c) 2000-2017 the FFmpeg developers That should give us an indication of what ffmpeg is interpreting. Cheers, Moritz
Greetings Thank you for your interpretation. It looks you are spot on.
We need to see the proper *actual* command line used (minus your hidden output URL). You can add "-loglevel debug", that will (among others) display ffmpeg's option parsing. But the easiest way is to add the option "-report" to the command line, and then grab the resulting file "ffmpeg-20170724-162640.log" (or similar) and show us the top where it says:
I am not able to interpret the information below and would like to have your advice I have cut out the bulk of the data from the log file and given you a head and tail of the file. regards Mettavihari ffmpeg started on 2017-07-25 at 10:20:01 Report written to "ffmpeg-20170725-102001.log" Command line: /root/bin/ffmpeg -re -i /media/data/video/yupptv/sutta/satipattana-15m.mp4 -report -acodec libfdk_aac "-b:a 128k" -vcodec libx264 "-preset:v medium" "-b:v 1500k" -f flv -metadata "streamName=xlarge" rtmp://site ffmpeg version N-86069-ga453f55 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11) configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 libavutil 55. 62.100 / 55. 62.100 libavcodec 57. 95.101 / 57. 95.101 libavformat 57. 72.101 / 57. 72.101 libavdevice 57. 7.100 / 57. 7.100 libavfilter 6. 89.100 / 6. 89.100 libswscale 4. 7.101 / 4. 7.101 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 Splitting the commandline. Reading option '-re' ... matched as option 're' (read input at native frame rate) with argument '1'. Reading option '-i' ... matched as input url with argument '/media/data/video/yupptv/sutta/satipattana-15m.mp4'. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libfdk_aac'. Reading option '-b:a 128k' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '-vcodec'. Reading option 'libx264' ... matched as output url. Reading option '-preset:v medium' ... matched as AVOption 'preset:v medium' with argument '-b:v 1500k'. Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'. Reading option '-metadata' ... matched as option 'metadata' (add metadata) with argument 'streamName=xlarge'. Reading option 'rtmp://site' ... matched as output url. Finished splitting the commandline. Parsing a group of options: global . Applying option report (generate a report) with argument 1. Successfully parsed a group of options. Parsing a group of options: input url /media/data/video/yupptv/sutta/satipattana-15m.mp4. Applying option re (read input at native frame rate) with argument 1. Successfully parsed a group of options. Opening an input file: /media/data/video/yupptv/sutta/satipattana-15m.mp4. [file @ 0x3f16300] Setting default whitelist 'file,crypto' [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] ISO: File Type Major Brand: isom [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Unknown dref type 0x206c7275 size 12 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Offset DTS by ctts[0].duration: 2 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Processing st: 0, edit list 0 - media time: 2, duration: 109194 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts: 0 @ 0, ctts: 2, ctts_count: 60872 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts: 1 @ 0, ctts: 2, ctts_count: 60872 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts: 2 @ 1, ctts: 3, ctts_count: 60872 [...] [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts: 109192 @ 60871, ctts: 2, ctts_count: 60872 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] shifted frame pts, curr_cts: 109193 @ 60871, ctts: 2, ctts_count: 60872 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Unknown dref type 0x206c7275 size 12 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Processing st: 1, edit list 0 - media time: 0, duration: 192619274 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] Before avformat_find_stream_info() pos: 4185665 bytes read:4207516 seeks:0 nb_streams:2 [h264 @ 0x3f17360] nal_unit_type: 7, nal_ref_idc: 3 [h264 @ 0x3f17360] nal_unit_type: 8, nal_ref_idc: 3 [h264 @ 0x3f17360] nal_unit_type: 6, nal_ref_idc: 0 [h264 @ 0x3f17360] nal_unit_type: 5, nal_ref_idc: 3 [h264 @ 0x3f17360] user data:"x264 - core 124 r2197 69a0443 - H.264/MPEG-4 AVC codec - Copyleft 2003-2012 - http://www.videolan.org/x264.html - options: cabac=1 ref=5 deblock=1:0:0 analyse=0x1:0x111 me=umh subme=8 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=0 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=3 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=2 b_bias=0 direct=3 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=25 scenecut=40 intra_refresh=0 rc_lookahead=50 rc=cbr mbtree=1 bitrate=1500 ratetol=1.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 vbv_maxrate=1500 vbv_bufsize=1500 nal_hrd=none ip_ratio=1.40 aq=1:1.00" [h264 @ 0x3f17360] Reinit context to 704x400, pix_fmt: yuv420p [h264 @ 0x3f17360] no picture [aac @ 0x3f1c0c0] skip whole frame, skip left: 0 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] All info found [mov,mp4,m4a,3gp,3g2,mj2 @ 0x3f15a60] After avformat_find_stream_info() pos: 4187178 bytes read:4207516 seeks:0 frames:3 Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/media/data/video/yupptv/sutta/satipattana-15m.mp4': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf54.3.100 Duration: 01:12:47.78, start: 0.000000, bitrate: 1603 kb/s Stream #0:0(und), 2, 1/25: Video: h264 (Main) (avc1 / 0x31637661), yuv420p, 704x396 [SAR 3:4 DAR 4:3], 1468 kb/s, 25 fps, 25 tbr, 25 tbn, 50 tbc (default) Metadata: handler_name : VideoHandler Stream #0:1(und), 1, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default) Metadata: handler_name : SoundHandler Successfully opened the file. Parsing a group of options: output url libx264. Applying option acodec (force audio codec ('copy' to copy stream)) with argument libfdk_aac. Applying option b:a 128k (video bitrate (please use -b:v)) with argument -vcodec. Successfully parsed a group of options. Opening an output file: libx264. [NULL @ 0x3f3e220] Unable to find a suitable output format for 'libx264' libx264: Invalid argument [AVIOContext @ 0x3f1e640] Statistics: 4207516 bytes read, 0 seeks
On Tue, Jul 25, 2017 at 10:59 AM, Mettavihari D <tv.lists@gmail.com> wrote:
Reading option '-b:a 128k' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '-vcodec'. Reading option 'libx264' ... matched as output url.
Remove the quotes surrounding the whole of -b:a 128k and quote them separately.
Greetings, Thank you for the suggestion.
Reading option '-b:a 128k' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '-vcodec'. Reading option 'libx264' ... matched as output url.
Remove the quotes surrounding the whole of -b:a 128k and quote them separately.
I tried what you said but it did not seem to work. It looks like there is a lot to learn about the way the attributes in ffmpeg are given. The log file is given below. Thank you for your support. Mettavihari ffmpeg started on 2017-07-25 at 12:39:02 Report written to "ffmpeg-20170725-123902.log" Command line: /root/bin/ffmpeg -re -i /media/data/video/yupptv/sutta/satipattana-15m.mp4 -report -acodec libfdk_aac b:a 128k -vcodec libx264 -b:v 1500k -f flv -metadata "streamName=xlarge" rtmp://site ffmpeg version N-86069-ga453f55 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11) configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 libavutil 55. 62.100 / 55. 62.100 libavcodec 57. 95.101 / 57. 95.101 libavformat 57. 72.101 / 57. 72.101 libavdevice 57. 7.100 / 57. 7.100 libavfilter 6. 89.100 / 6. 89.100 libswscale 4. 7.101 / 4. 7.101 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 Splitting the commandline. Reading option '-re' ... matched as option 're' (read input at native frame rate) with argument '1'. Reading option '-i' ... matched as input url with argument '/media/data/video/yupptv/sutta/satipattana-15m.mp4'. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libfdk_aac'. Reading option 'b:a' ... matched as output url. Reading option '128k' ... matched as output url. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'. Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1500k'. Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'. Reading option '-metadata' ... matched as option 'metadata' (add metadata) with argument 'streamName=xlarge'. Reading option 'rtmp://entrypointsg.yuppcdn.net/yupptv/dharmavahini' ... matched as output url. Finished splitting the commandline. Parsing a group of options: global . Applying option report (generate a report) with argument 1. Successfully parsed a group of options. Parsing a group of options: input url /media/data/video/yupptv/sutta/satipattana-15m.mp4. Applying option re (read input at native frame rate) with argument 1. Successfully parsed a group of options. Opening an input file: /media/data/video/yupptv/sutta/satipattana-15m.mp4. [file @ 0x2698320] Setting default whitelist 'file,crypto' [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2697aa0] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2697aa0] ISO: File Type Major Brand: isom [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2697aa0] Unknown dref type 0x206c7275 size 12 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2697aa0] Offset DTS by ctts[0].duration: 2 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2697aa0] Processing st: 0, edit list 0 - media time: 2, duration: 109194 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2697aa0] shifted frame pts, curr_cts: 0 @ 0, ctts: 2, ctts_count: 60872 [mov,mp4,m4a,3gp,3g2,mj2 @ 0x2697aa0] shifted frame pts, curr_cts: 1 @ 0, ctts: 2, ctts_count: 60872
On Tue, Jul 25, 2017 at 1:03 PM, Mettavihari D <tv.lists@gmail.com> wrote:
Greetings,
I tried what you said but it did not seem to work.
/root/bin/ffmpeg -re -i /media/data/video/yupptv/sutta/satipattana-15m.mp4 -report -acodec libfdk_aac b:a 128k -vcodec libx264 -b:v 1500k -f flv -metadata "streamName=xlarge" rtmp://site
Reading option 'b:a' ... matched as output url. Reading option '128k' ... matched as output url.
The dash before b:a is missing.
Greetings Thank you for the note.
Reading option 'b:a' ... matched as output url. Reading option '128k' ... matched as output url.
The dash before b:a is missing.
That is so certainly an error. However this did not work either There is something I do wrong in this command line Please have a look below /root/bin/ffmpeg -i /media/data/video/yupptv/sutta/satipattana-15m.mp4 -report -acodec libfdk_aac -b:a 128k-vcodec libx264 -b:v 1500k -f flv -metadata "streamName=xlarge" rtmp://site ffmpeg version N-86069-ga453f55 Copyright (c) 2000-2017 the FFmpeg developers built with gcc 4.8.5 (GCC) 20150623 (Red Hat 4.8.5-11) configuration: --prefix=/root/ffmpeg_build --extra-cflags=-I/root/ffmpeg_build/include --extra-ldflags='-L/root/ffmpeg_build/lib -ldl' --bindir=/root/bin --pkg-config-flags=--static --enable-gpl --enable-nonfree --enable-libfdk_aac --enable-libfreetype --enable-libmp3lame --enable-libvorbis --enable-libvpx --enable-libx264 libavutil 55. 62.100 / 55. 62.100 libavcodec 57. 95.101 / 57. 95.101 libavformat 57. 72.101 / 57. 72.101 libavdevice 57. 7.100 / 57. 7.100 libavfilter 6. 89.100 / 6. 89.100 libswscale 4. 7.101 / 4. 7.101 libswresample 2. 8.100 / 2. 8.100 libpostproc 54. 6.100 / 54. 6.100 Splitting the commandline. Reading option '-i' ... matched as input url with argument '/media/data/video/yupptv/sutta/satipattana-15m.mp4'. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libfdk_aac'. Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '128k-vcodec'. This option is not taken as an audio option but as a video option, Perhaps because the above is taken as (force audio codec ('copy' to copy stream)) Reading option 'libx264' ... matched as output url. Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1500k'. Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'. Reading option '-metadata' ... matched as option 'metadata' (add metadata) with argument 'streamName=xlarge'. Reading option 'rtmp://site... matched as output url. Finished splitting the commandline. Thank you Mettavihari
On Tue, Jul 25, 2017 at 2:11 PM, Mettavihari D <tv.lists@gmail.com> wrote:
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '128k-vcodec'.
The space between 128k and -vcodec is now omitted. Please proof your commands for these trivial issues before trying. The -b:a error is weird. Replace with -ab for now.
Greetings Thank you for having such sharp eyes.
The space between 128k and -vcodec is now omitted. Please proof your commands for these trivial issues before trying.
That cleared the present problem. Now it is working with this command. but is seems the two -b commands are not implemented. pls see below. What I really need in to have a stream with a fixed bitrate output. my client does not want the stream to vary up and down. my thinking was that if I use this command -b:v 1500k -minrate 1500k -maxrate 1500k -bufsize 1500k Then I could generate a fixed bitrate stream of 1500K Please give your advice on this. Mettavihari /root/bin/ffmpeg -i /media/data/video/yupptv/sutta/satipattana-15m.mp4 -report -acodec libfdk_aac -b:a 128k -vcodec libx264 -b:v 1500k -f flv -metadata "streamName=xlarge" rtmp://site Splitting the commandline. Reading option '-i' ... matched as input url with argument '/media/data/FILE Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libfdk_aac'. Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '128k'. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'. Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1500k'. Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'. Reading option '-metadata' ... matched as option 'metadata' (add metadata) with argument 'streamName=xlarge'. Reading option 'rtmp://SITE' ... matched as output url. Finished splitting the commandline.
Greetings Gyan and Moritz Thank you for teaching me all this I think it should be working now. I have put in the report below regards Mettavihari fmpeg started on 2017-07-25 at 15:29:01 Report written to "ffmpeg-20170725-152901.log" Command line: /root/bin/ffmpeg -i /media/data/video/yupptv/sutta/satipattana-15m.mp4 -report -acodec libfdk_aac -ab 128k -vcodec libx264 -vb 1500k -minrate 1500k -maxrate 1500k -bufsize 1500k -f flv -metadata "streamName=xlarge" rtmp://site. Splitting the commandline. Reading option '-i' ... matched as input url with argument '/media/data/video/yupptv/sutta/satipattana-15m.mp4'. Reading option '-report' ... matched as option 'report' (generate a report) with argument '1'. Reading option '-acodec' ... matched as option 'acodec' (force audio codec ('copy' to copy stream)) with argument 'libfdk_aac'. Reading option '-ab' ... matched as option 'ab' (audio bitrate (please use -b:a)) with argument '128k'. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'. Reading option '-vb' ... matched as AVOption 'vb' with argument '1500k'. Reading option '-minrate' ... matched as AVOption 'minrate' with argument '1500k'. Reading option '-maxrate' ... matched as AVOption 'maxrate' with argument '1500k'. Reading option '-bufsize' ... matched as AVOption 'bufsize' with argument '1500k'. Reading option '-f' ... matched as option 'f' (force format) with argument 'flv'. Reading option '-metadata' ... matched as option 'metadata' (add metadata) with argument 'streamName=xlarge'. Reading option 'rtmp://SITE ... matched as output url. Finished splitting the commandline.
On Tue, Jul 25, 2017 at 14:39:10 +0530, Mettavihari D wrote:
Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '128k'. Reading option '-vcodec' ... matched as option 'vcodec' (force video codec ('copy' to copy stream)) with argument 'libx264'. Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1500k'.
Indeed, that's weird. I just tried this: $ ffmpeg -report -f lavfi -i testsrc2 -f lavfi -i anoisesrc -map 0 -map 1 -c:a aac -b:a 128k -c:v libx264 -b:v 1500k -t 3 -f null - and the report said: Command line: ffmpeg -report -f lavfi -i testsrc2 -f lavfi -i anoisesrc -map 0 -map 1 -c:a aac -b:a 128k -c:v libx264 -b:v 1500k -t 3 -f null - ffmpeg version N-86781-gd8f1982 Copyright (c) 2000-2017 the FFmpeg developers [...] Reading option '-c:a' ... matched as option 'c' (codec name) with argument 'aac'. Reading option '-b:a' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '128k'. Reading option '-c:v' ... matched as option 'c' (codec name) with argument 'libx264'. Reading option '-b:v' ... matched as option 'b' (video bitrate (please use -b:v)) with argument '1500k'. The "-b" parsing works okay (I checked with a different, non-default bitrate), the warning is just broken/misleading/doesn't belong there. Moritz
participants (4)
-
Gyan -
Mettavihari D -
Moritz Barsnick -
Reuben Martin