[FFmpeg-user] FFmpeg audio frame count/nb_samples misunderstanding?
I am streaming audio between two linux machines using ffmpeg and ffplay. The sender is using rtsp to transport audio using a USB microphone over TCP. The receiver (listener) is receiving and playing the audio received using ffplay. Sending: Receiving(listening): Using /‘ashowinfo’/, I am able to see a line containing various information for each input audio frame. The option /nostats/ is used to avoid other stats interleaved within the log output. “n” denotes the (sequential) number of the input frame, starting from 0. The receiver and sender are both using the /-af/ option flag to see the frame counts. However when the stream ends, the audio frame numbers are completely off as shown below. I have searched before, but have not seen any specific or technical algorithm that ffmpeg uses to justify how frame counts are defined. Also I am not sure why my sender with the microphone audio has various nb_sample sizes with each frame increment? I have noticed that the audio streamed from rtsp is always received as having each frame with "nb_sample" of 1024. I have tried adding the /frame_size/ option but with no change in consistent number of samples per frame input for the sender. The aim is to have a consist method to correlate where the sender and receiver are at once the audio stream has been stopped. Below are the log files outputted for each command with their respective machines: Sending log: Receiving log: -- Sent from: http://www.ffmpeg-archive.org/ ___ 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] Converting pictures to video
Thank you everyone for your valuable feedback and apologies for the late response, I could not access my files over the weekend. I am a step closer. The video is saved now but empty, length is 00:00:00. @dos...@gmail.com I included a second line command with your suggestion but still did not work. winexec "C:\FFmpeg\bin\ffmpeg.exe" -report -i "C:\Users\analyst\Desktop\STATA\projects\animation3\graph_%d.png" -b:v 2048k "C:\Users\analyst\Desktop\STATA\projects\animation3\map_video.mpg" winexec "C:\FFmpeg\bin\ffmpeg.exe" -report -f concat -safe 0 -i "C:\Users\analyst\Desktop\STATA\projects\animation3\graph_%d.png" -maxrate 3k -y "C:\Users\analyst\Desktop\STATA\projects\animation3\map_video1.mpg" Thank you, On Sat, 7 Dec 2019 at 00:43, Dan Bridges wrote: > On 7/12/2019 11:49 am, Anwuli Okwuashi wrote: > > [image2 @ 01d077c4a440] Could find no file with path > > 'C:\Users\analyst\Desktop\STATA\projects\animation3\graph%02d.png' and > > index in the range 0-4 > > > I created a 1500x1000 1000-image set: Sequence_000.png -> > Sequence_999.png. This loads fine using at the start of the command line: > > ffmpeg -i Sequence_%03d.png > > This will also work if the sequence numbers are inside the filename: > > ffmpeg -i 0191107-154%03d-214.png > > But if you rename the first 5 files to: _Sequence_000.png ... > _Sequence_004.png it will fail because the first file starting with > Sequence is now Sequence_005.png. > > Renaming _Sequence_004.png -> Sequence_004.png will allow the remaining > 995 files in the sequence to load. > > If you can not batch rename the sequence to start from 00 or if it is a > non-contiguous list because you deleted some damaged/missing images, you > can tell FFMPEG to load a list of filenames. This has to be in a > particular 1 or 2-line format (if including image duration). > > For example, I've deleted the first 83 images, substituted a > Replacement.png, and the remaining image names jump by 3. Then I created > a list of filenames. > > To create such a list in Windows, I use create_list.bat, here designed > to look in the "Sequence Directory", beneath the current directory > ("C:\test directory"), where the images files are situated, create a > 2-line name-sorted list where the 2nd line is the duration in secs (1 > frame at 25fps = 40ms), and then load this list in the associated text > editor so you can delete or move blocks, change durations etc., if > required. > > @echo off > SETLOCAL EnableDelayedExpansion > if exist mylist.txt del mylist.txt > for %%I in ("Sequence Directory\*.png") do (echo file '%%~fI' >> > mylist.txt & echo duration 0.04 >> mylist.txt) > start /i mylist.txt > > The first 4 files in the list: > > file 'C:\test directory\Sequence directory\Replacement.png' > duration 0.04 > file 'C:\test directory\Sequence directory\Sequence_0083.png' > duration 0.04 > file 'C:\test directory\Sequence directory\Sequence_0086.png' > duration 0.04 > file 'C:\test directory\Sequence directory\Sequence_0089.png' > duration 0.04 > > If you decrease the duration below 0.04 @25fps FFMPEG will start to drop > frames. Conversely, if you go above 0.04, it will start to replicate > frames. > > To use this list: > > ffmpeg.exe -f concat -safe 0 -i "C:\test directory\mylist.txt" -maxrate > 3k -y "C:\test directory\Sequence directory"\map_video6.mpg > > > Dan. > > > > > > > > > > > > * > * > > ___ > 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 started on 2019-12-09 at 11:43:47 Report written to "ffmpeg-20191209-114347.log" Log level: 48 Command line: "C:\\FFmpeg\\bin\\ffmpeg.exe" -report -f concat -safe 0 -i "C:\\Users\\analyst\\Desktop\\STATA\\projects\\animation3\\graph_%d.png" -maxrate 3k -y "C:\\Users\\analyst\\Desktop\\STATA\\projects\\animation3\\map_video1.mpg" ffmpeg version git-2019-12-06-b66a800 Copyright (c) 2000-2019 the FFmpeg developers built with gcc 9.2.1 (GCC) 20191125 configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfig --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libbluray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --enable-libsnappy --enable-libsoxr --enabl
Re: [FFmpeg-user] Converting pictures to video
On 10/12/2019 5:09 am, Anwuli Okwuashi wrote: > winexec "C:\FFmpeg\bin\ffmpeg.exe" -report -f concat -safe 0 -i > "C:\Users\analyst\Desktop\STATA\projects\animation3\graph_%d.png" -maxrate > 3k -y > "C:\Users\analyst\Desktop\STATA\projects\animation3\map_video1.mpg" When you use the concat demuxer , after "-i", (the input file(s) option), don't use: *graph_%d.png* Instead, use the name of the text file you've created that contains either 1- or 2 entries for every image filename you wish to load. This way, the group of image filenames does not need to be contiguous in its numbering or start its numbering within 0-4 of the index value. https://trac.ffmpeg.org/wiki/Concatenate If you look at my post you will see that I have presented a batchfile called *create_list.bat*: @echo off SETLOCAL EnableDelayedExpansion if exist mylist.txt del mylist.txt for %%I in ("Sequence Directory\*.png") do (echo file '%%~fI' >> mylist.txt & echo duration 0.04 >> mylist.txt) start /i mylist.txt The way it is currently written, it looks a directory-level down from the current directory for a sub-directory called "Sequence directory". This is just an example. You could alter it to suit yourself. In my example, I had create_list.bat and ffmpeg.exe in "C:\test directory". So, when executing create_list.bat from there, it is looking for all the .png files I've placed in "C:\test directory\Sequence directory" and then creating a name-sorted list in the current directory ("C:\test directory") called *mylist.txt*. Finally, it was loading this text file in the Windows-associated program, notepad.exe., for examination and modification*. *This final step is an optional process.* * In my example, the first 4 image files in this sorted list which would be read by the concat demuxer and loaded into ffmpeg were: file 'C:\test directory\Sequence directory\Replacement.png' duration 0.04 file 'C:\test directory\Sequence directory\Sequence_0083.png' duration 0.04 file 'C:\test directory\Sequence directory\Sequence_0086.png' duration 0.04 file 'C:\test directory\Sequence directory\Sequence_0089.png' duration 0.04 Once you have created your list of image filenames, you use it this way (an example):* * *ffmpeg.exe -f concat -safe 0 -i "C:\test directory\mylist.txt" -maxrate 3k -y "C:\test directory\Sequence directory"\map_video6.mpg* In your case your directory structure appears not to be separating your working directory from your data (image) directory. This is OK if you only a few image files, but gets messy when you have thousands of images. Assuming you want create_list.bat to operate from the "animation3" directory you would alter its contents to: @echo off SETLOCAL EnableDelayedExpansion if exist mylist.txt del mylist.txt for %%I in (*.png") do (echo file '%%~fI' >> mylist.txt & echo duration 0.04 >> mylist.txt) start /i mylist.txt And then your ffmpeg.exe command line would be: ***winexc "C:\Users\analyst\Desktop\STATA\projects\animation3\mylist.txt" -maxrate 3k -y "C:\Users\analyst\Desktop\STATA\projects\animation3\map_video1.mpg"* Dan.* * * * ** ___ 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] aacDecoder_DecodeFrame() failed
When I try to play this stream with ffplay, many decode failed occurred. ffplay -infbuf -vn -acodec libfdk_aac https://radio.mcu.edu.tw:8080/hls/a2/index.m3u8 [mpegts @ 0x7f97028b7400] PES packet size mismatch sq=0B f=0/0 [libfdk_aac @ 0x7f96fe890600] aacDecoder_DecodeFrame() failed: 4007 [libfdk_aac @ 0x7f96fe890600] aacDecoder_DecodeFrame() failed: 1001 [libfdk_aac @ 0x7f96fe890600] aacDecoder_DecodeFrame() failed: 4004 output sound sometimes corrupted or muted. I can play the same stream with VLC or Google Chrome. Could anyone help? Thanks ___ 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".