[FFmpeg-user] fps output stuck at 5fps with flv / rtmp outpu

2021-05-25 Thread Andrew Peng
I have a problem with ffmpeg 4.1.6 (raspbian release) that is really
strange. I'm trying to stream a webcam to an rtmp endpoint and the
framerate is stuck at 5fps.

Things i've checked:
 - camera can do 25fps at 800x600 with mjpeg or raw output, verified with
v4l2-ctl and ffmpeg
 - camera works to stream 25fps output on a windows computer using obs
 - camera is able to generate a test mp4 file saved locally using ffmpeg at
25fps

The problem is that the framerate plummets to 5fps when I add the -f flv
output option, even when saving to a local file. If I change the output
type to mp4, it can output at 25fps.

This happens when using the h264_omx and libx264 encoding engines.

Is there any particular reason why the output is getting nuked to 5fps when
using the flv output?

Here is the command line i'm using:

ffmpeg -video_size 800x600 -input_format yuyv422 -i /dev/video0 -vcodec
h264_omx -b:v 1024k -vf drawtext="fontsize=20: box=1: boxcolor=black@0.75:
boxborderw=5: fontcolor=white: x=5: y=(h-text_h-5):
text='%{localtime\:%m/%d/%Y - %T}'" -f flv rtmp://rtmp.server.here
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] Video Freezing Halfway Through on Subsequent Encodes

2021-05-25 Thread Craig L.
Hi!  Sorry for the repost, but I think my original post got lost in the 
shuffle.


I am having issues where a video stream is freezing at some point within 
the video while the rest of the elements are encoded fine.


On the same server, if the same command is run multiple times, this will 
happen once and if it is re-encoded all will turn out ok.


I have the working example and the failed example below.  I have not 
been able to try it on the latest GIT version as I rely on our host to 
update, so wanted to see if there was an obvious issue before I go that 
route.


I have seperated out the sections that are different between the two 
encodes.


Thank you!

Craig


**WORKING ENCODEMAIN VIDEO (**original-video.MP4) DOES NOT FREEZE. *


/usr/local/bin/ffmpeg   -safe 0 -f concat -i  canvas.txt   -safe 0 -f 
concat -i  overlay-text-concat.txt    -i original-video.MP4   -i  
overlay-video.mov -filter_complex_script complex-filter.txt  -aspect 
1:1    -c:v libx264    -profile:v high -pix_fmt yuv420p -level 5.1  
-vsync 1 -async 1  -c:a aac -b:a 128k  -map 2:a   -t 19.15   -r 30 
-y finished-video.mp4



ffmpeg version 4.3.1-static https://johnvansickle.com/ffmpeg/ Copyright 
(c) 2000-2020 the FFmpeg developers

  built with gcc 8 (Debian 8.3.0-6)
  configuration: --enable-gpl --enable-version3 --enable-static 
--disable-debug --disable-ffplay --disable-indev=sndio 
--disable-outdev=sndio --cc=gcc --enable-fontconfig --enable-frei0r 
--enable-gnutls --enable-gmp --enable-libgme --enable-gray 
--enable-libaom --enable-libfribidi --enable-libass --enable-libvmaf 
--enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb 
--enable-libopencore-amrwb --enable-libopenjpeg --enable-librubberband 
--enable-libsoxr --enable-libspeex --enable-libsrt --enable-libvorbis 
--enable-libopus --enable-libtheora --enable-libvidstab 
--enable-libvo-amrwbenc --enable-libvpx --enable-libwebp 
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libdav1d 
--enable-libxvid --enable-libzvbi --enable-libzimg

  libavutil  56. 51.100 / 56. 51.100
  libavcodec 58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter 7. 85.100 /  7. 85.100
  libswscale  5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
Input #0, concat, from 'canvas.txt':
  Duration: 00:00:19.15, start: 0.00, bitrate: 0 kb/s
    Stream #0:0: Video: targa, gray, 1280x1280, 25 tbr, 25 tbn, 25 tbc
Input #1, concat, from 'overlay-text-concat.txt':

*
*

*  Duration: 00:00:19.15, start: 0.00, bitrate: 0 kb/s*


    Stream #1:0: Video: targa, bgra, 1280x1280, 25 tbr, 25 tbn, 25 tbc
Input #2, mov,mp4,m4a,3gp,3g2,mj2, from 'original-video.MP4':
  Metadata:
    major_brand : qt
    minor_version   : 0
    compatible_brands: qt
    creation_time   : 2021-05-21T04:06:55.00Z
    com.apple.quicktime.software: SCRecorder
    com.apple.quicktime.creationdate: 2021-05-20T14:49:00-04:00
    com.apple.photos.originating.signature: ASx36uUj/ZZKOHKYPUNOzGvtnPAp
  Duration: 00:00:19.15, start: 0.00, bitrate: 15901 kb/s
    Stream #2:0(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, 
stereo, fltp, 304 kb/s (default)

    Metadata:
  creation_time   : 2021-05-21T04:06:55.00Z
  handler_name    : Core Media Audio
    Stream #2:1(und): Video: h264 (High) (avc1 / 0x31637661), 
yuvj420p(pc, bt709), 1280x720, 15587 kb/s, 59.95 fps, 60 tbr, 600 tbn, 
1200 tbc (default)

    Metadata:
  creation_time   : 2021-05-21T04:06:55.00Z
  handler_name    : Core Media Video
  encoder : H.264
Input #3, mov,mp4,m4a,3gp,3g2,mj2, from 'overlay-video.mov':
  Metadata:
    major_brand : qt
    minor_version   : 512
    compatible_brands: qt
    encoder : Lavf58.45.100
  Duration: 00:00:19.16, start: 0.00, bitrate: 82 kb/s
    Stream #3:0: Video: png (png  / 0x20676E70), rgba(pc, progressive), 
1280x26, 81 kb/s, 25 fps, 25 tbr, 12800 tbn, 12800 tbc (default)

    Metadata:
  handler_name    : VideoHandler
  encoder : Lavc58.91.100 png
Stream mapping:
  Stream #0:0 (targa) -> overlay:main
  Stream #0:0 (targa) -> scale
  Stream #1:0 (targa) -> overlay:overlay
  Stream #2:0 (aac) -> atrim
  Stream #2:1 (h264) -> trim
  Stream #3:0 (png) -> scale
  concat:out:a0 -> Stream #0:0 (aac)
  overlay -> Stream #0:1 (libx264)
Press [q] to stop, [?] for help
-async is forwarded to lavfi similarly to -af 
aresample=async=1:min_hard_comp=0.10:first_pts=0.


*
*

*[swscaler @ 0x6f1e5c0] deprecated pixel format used, make sure you did 
set range correctly**

**[libx264 @ 0x5cde0c0] using SAR=1/1**
**[libx264 @ 0x5cde0c0] using cpu capabilities: MMX2 SSE2Fast SSSE3 
SSE4.2 AVX FMA3 BMI2 AVX2 AVX512**

**[libx264 @ 0x5cde0c0] profile High, level 5.1, 4:2:0, 8-bit**
**[libx264 @ 0x5cde0c0] 264 - core 161 r3018 db0d417 - H.264/MPEG-4 AVC 
codec - Copyleft 2003-2020 - 

Re: [FFmpeg-user] triming an audio wavfile

2021-05-25 Thread pink panther
To be clearer. G729 codec, G711 codec, etc.. the difference is bandwidth.
This is a G729 audio wave file

On Tue, May 25, 2021 at 6:36 AM pink panther  wrote:

> mohg729a is just the name of the file. I didn't show any name with g729b
> btw. Nevertheless, that is just the name. Nothing to do with the format,
> codec, etc.. It's a g729 audio wavfile that plays while on hold. I just
> wanted to trim it because it's too long.
>
> This is a proprietary music audio file that can't be sent to you
> unfortunately
>
> On Mon, May 24, 2021 at 11:35 PM Carl Zwanzig  wrote:
>
>> Please learn what top-posting is and stop doing it on this list.
>>
>> On 5/24/2021 6:40 PM, pink panther wrote:
>> > I tried it with the double quotes and got the following. Same out I got
>> > using the other statements I got from the other links
>>
>> > C:\ffmpeg>ffmpeg -i "Mohg729.wav" -ss 00:00:00.00 -t 00:01:00.00 -c:a
>> copy
>> > "Mohg729a.wav"
>> > ffmpeg version N-101626-gc5341d415c Copyright (c) 2000-2021 the FFmpeg
>> > developers
>> [...]
>>
>> > [wav @ 0215e03f4580] Estimating duration from bitrate, this may be
>> > inaccurate
>> > [wav @ 0215e03f4580] Could not find codec parameters for stream 0
>> > (Audio: none (3[1][0][0] / 0x0133), 8000 Hz, 1 channels, 8 kb/s):
>> unknown
>> > codec
>> > Consider increasing the value for the 'analyzeduration' (0) and
>> 'probesize'
>> > (500) options
>>
>> Well... there's a problem- ffmpeg can't figure out the input codec*. Did
>> the
>> file extension come as .wav or was it changed from something else? A
>> quick
>> google search (took me a minute) suggests that you may need to insert "-f
>> g729" before the "-i". Also, that g729b isn't supported at all.
>>   Please verify whether that file is raw g729 or g729 in a wav container
>> (can that even work?). Also that it's really g279.
>>
>> *this is why the command output should always be included
>>
>>
>> z!
>> ___
>> ffmpeg-user mailing list
>> ffmpeg-user@ffmpeg.org
>> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>>
>> To unsubscribe, visit link above, or email
>> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
>>
>
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] triming an audio wavfile

2021-05-25 Thread pink panther
mohg729a is just the name of the file. I didn't show any name with g729b
btw. Nevertheless, that is just the name. Nothing to do with the format,
codec, etc.. It's a g729 audio wavfile that plays while on hold. I just
wanted to trim it because it's too long.

This is a proprietary music audio file that can't be sent to you
unfortunately

On Mon, May 24, 2021 at 11:35 PM Carl Zwanzig  wrote:

> Please learn what top-posting is and stop doing it on this list.
>
> On 5/24/2021 6:40 PM, pink panther wrote:
> > I tried it with the double quotes and got the following. Same out I got
> > using the other statements I got from the other links
>
> > C:\ffmpeg>ffmpeg -i "Mohg729.wav" -ss 00:00:00.00 -t 00:01:00.00 -c:a
> copy
> > "Mohg729a.wav"
> > ffmpeg version N-101626-gc5341d415c Copyright (c) 2000-2021 the FFmpeg
> > developers
> [...]
>
> > [wav @ 0215e03f4580] Estimating duration from bitrate, this may be
> > inaccurate
> > [wav @ 0215e03f4580] Could not find codec parameters for stream 0
> > (Audio: none (3[1][0][0] / 0x0133), 8000 Hz, 1 channels, 8 kb/s): unknown
> > codec
> > Consider increasing the value for the 'analyzeduration' (0) and
> 'probesize'
> > (500) options
>
> Well... there's a problem- ffmpeg can't figure out the input codec*. Did
> the
> file extension come as .wav or was it changed from something else? A quick
> google search (took me a minute) suggests that you may need to insert "-f
> g729" before the "-i". Also, that g729b isn't supported at all.
>   Please verify whether that file is raw g729 or g729 in a wav container
> (can that even work?). Also that it's really g279.
>
> *this is why the command output should always be included
>
>
> z!
> ___
> ffmpeg-user mailing list
> ffmpeg-user@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-user
>
> To unsubscribe, visit link above, or email
> ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".
>
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-user] DASH-LL audio & video segment files created at different rates

2021-05-25 Thread Danny Wilson
I'm trying to use FFmpeg to simulate a "live" DASH-LL from a file.  However, 
the audio "m4s" files and the video "m4s" files are not being created at the 
same rate.

The video files lag significantly behind the audio (i.e., they don't exist).  
This causes issues with the player since it tries to fetch both audio and video 
segments with a given index. e.g. it tries to fetch chunk-stream0-018.m4s and 
chunk-stream1-018.m4s but the stream0 chunk (video) hasn't yet been created by 
FFmpeg causing the player to give a 404 error.

For example, encoding just 60 seconds ends up with these files in the web root 
folder:

init-stream0.m4s 
init-stream1.m4s  
chunk-stream0-1.m4s  chunk-stream1-00019.m4s  
chunk-stream0-2.m4s  chunk-stream1-00020.m4s  
chunk-stream0-3.m4s  chunk-stream1-00021.m4s  
chunk-stream0-4.m4s  chunk-stream1-00022.m4s  
chunk-stream0-5.m4s  chunk-stream1-00023.m4s  
chunk-stream0-6.m4s  chunk-stream1-00024.m4s  
chunk-stream0-7.m4s  chunk-stream1-00025.m4s  
chunk-stream0-8.m4s  chunk-stream1-00026.m4s  
chunk-stream0-9.m4s  chunk-stream1-00027.m4s  
chunk-stream0-00010.m4s  chunk-stream1-00028.m4s  
chunk-stream0-00011.m4s  chunk-stream1-00029.m4s  
chunk-stream0-00012.m4s  chunk-stream1-00030.m4s  
 chunk-stream1-00031.m4s  
 
So the player requests chunk-stream0-29.m4s which gives a 404 error because it 
doesn't exist yet.

The command line is:

ffmpeg -loglevel info -re -i 
/mnt/swdevel/TestStreams/H264/ThreeHourLongMovie.mp4 -t 60 \
-c:v libx264 -x264-params keyint=120:scenecut=0 -b:v 1M -c:a copy \
-f dash -dash_segment_type mp4 \
 -seg_duration 2 \
 -target_latency 3 \
 -frag_type duration \
 -frag_duration 0.2 \
 -window_size 10 \
 -extra_window_size 3 \
 -streaming 1 \
 -ldash 1 \
 -use_template 1 \
 -use_timeline 0 \
 -write_prft 1 \
 -fflags +nobuffer+flush_packets \
 -format_options "movflags=+cmaf" \
 -utc_timing_url "/pelican/testPlayers/time.php" \
 master.mpd

The  in the MPD file shows the same timescale and duration for 
both stream0 and stream1:



Both dash.js and shaka player and the stream doesn't play.  I've also tried 
using a VLSI hardware encoder instead of libx264 but same result so the issue 
is the the mixer (??)

Any suggestions on how fix this?

Danny

OS: Centos 8

ffmpeg version 4.3.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 8 (GCC)
  configuration: --extra-ldflags='-L/mnt/swdevel/Torque/lib3p64 -L/lib' 
--extra-cflags='-I/mnt/swdevel/Torque/include 
-I/mnt/swdevel/Torque/ext/extinclude/ -I/include' --disable-static 
--enable-shared --disable-cuda --disable-cuvid --disable-nvenc --enable-libx264 
--enable-gpl --enable-libfreetype --enable-libfontconfig --enable-libv4l2 
--enable-indev=alsa --enable-indev=v4l2 --bindir=/mnt/swdevel/Torque/bin64 
--datadir=/mnt/swdevel/Torque/ext/ffmpeg-build 
--docdir=/mnt/swdevel/Torque/ext/doc --libdir=/mnt/swdevel/Torque/lib3p64 
--shlibdir=/mnt/swdevel/Torque/lib3p64 
--incdir=/mnt/swdevel/Torque/ext/extinclude/ffmpeg 
--mandir=/mnt/swdevel/Torque/ext/ffmpeg-build64 --enable-libxcoder 
--disable-doc --enable-x86asm --extra-ldflags=-lm --enable-pthreads 
--extra-libs=-lpthread --disable-debug
  libavutil  56. 51.100 / 56. 51.100
  libavcodec 58. 91.100 / 58. 91.100
  libavformat58. 45.100 / 58. 45.100
  libavdevice58. 10.100 / 58. 10.100
  libavfilter 7. 85.100 /  7. 85.100
  libswscale  5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc55.  7.100 / 55.  7.100
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] triming an audio wavfile

2021-05-25 Thread Carl Eugen Hoyos



> Am 25.05.2021 um 03:39 schrieb pink panther :
> 
> Input #0, wav, from 'Mohg729.wav':
>  Duration: 00:05:32.55, bitrate: 8 kb/s
>  Stream #0:0: Audio: none (3[1][0][0] / 0x0133), 8000 Hz, mono, 8 kb/s

Please provide the file Mohg729.wav to allow us to fix the issue you see.

Thank you, Carl Eugen 
___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".


Re: [FFmpeg-user] Preserving AAC LC status when converting to fragmented MP4

2021-05-25 Thread Tobias Rapp

On 24.05.2021 22:26, Moritz Barsnick wrote:

On Wed, May 19, 2021 at 12:17:38 +0200, Tobias Rapp wrote:

Looks like the data that should be found in the "esds" atom is missing or
incomplete when using -c:a copy. See this link for details on how AAC
profile information is stored in MP4:

https://stackoverflow.com/questions/3987850/mp4-atom-how-to-discriminate-the-audio-codec-is-it-aac-or-mp3


Interesting stuff.


Don't know enough about TS (de)muxing, though, to find out where this
profile data should be parsed out from the input by FFmpeg.


MPEG-TS and demuxing isn't the problem. If you look at the ffmpeg
output in the original e-mail from decoding the file, it correctly
identifies the codec as "aac (LC)". The issue is the encoding to MP4.

The reason is that the AAC variants have only one codec tag
AV_CODEC_ID_AAC, and that needs to map to various tags, e.g. 0x40 for
AAC and 0x67 for AAC LC.

https://github.com/FFmpeg/FFmpeg/blob/3749eede66c3774799766b1f246afae8a6ffc9bb/libavformat/isom.c#L34

When writing the tag in the esds atom, there's no additional info
available allowing mapping to 0x67, therefore 0x40 is written:

https://github.com/FFmpeg/FFmpeg/blob/3749eede66c3774799766b1f246afae8a6ffc9bb/libavformat/movenc.c#L711

I have no idea how this info could be carried forward.
From the StackOverflow answers the AAC profile seems to be part of the 
AudioSpecificConfig (ASC) part which is written as "TAG 5" within the 
Elementary Stream Descriptor MP4 atom.


Looking at the FFmpeg movenc.c link you posted it is written some lines 
below the codec id from track->vos_data. This pointer is filled from 
AVCodecParameters->extradata in ff_mov_write_packet:


https://github.com/FFmpeg/FFmpeg/blob/3749eede66c3774799766b1f246afae8a6ffc9bb/libavformat/movenc.c#L5586

So it seems to be a matter of TS demuxing passing along the codec 
extradata correctly.


Regards,
Tobias

___
ffmpeg-user mailing list
ffmpeg-user@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-user

To unsubscribe, visit link above, or email
ffmpeg-user-requ...@ffmpeg.org with subject "unsubscribe".