Re: [FFmpeg-user] 2nd pass has more frames than 1st pass (99021)2kbits/s dup=27 drop=0 speed=4.76x
Carl Eugen, Thanks for taking the time to answer my questions. On Sun, Nov 29, 2020 at 7:40 PM Carl Eugen Hoyos wrote: > > Am So., 29. Nov. 2020 um 16:32 Uhr schrieb Mathieu Malaterre > : > > > $ ffmpeg -y -i input.avi -c:v libx264 -b:v 1321894 -pass 1 -an -f null > > /dev/null && \ > > ffmpeg -y -i input.avi -c:v libx264 -b:v 1321894 -pass 2 -c:a aac -b:a > > 128k fixed.mp4 > > This cannot work (and this is not related to the fact that you are not > using a version of FFmpeg that we support here). > > In some cases - if you are lucky - there is a crash and no output file > is written, in other cases, a "broken" output file is written, broken in > the sense that two-pass encoding did not work the way it is supposed > to (more bitrate was given to frames that do not need it). > > Do not use -an on the first pass and add "-vsync cfr" to the first pass. > (Other workarounds are possible.) Confirmed. The above suggestion does fix the symptoms. Did you base your suggestion on: "Error while decoding stream #0:1: Invalid data found when processing input" ? > For future questions: Do not cut FFmpeg's console output, only > post ffprobe output if you see an issue with it. > > Not really related: > > Does it make sense to simply copy/paste the existing bit_rate to > > re-encode it ? > > No, to the best of my knowledge, it makes no sense whatsoever. > > Very generally you either want a specific output quality, in this > case specifying a bitrate and two-pass encoding make no > sense. > Or you have a particular size requirement for the output file, > then bitrate and two-pass encoding make sense. Are you saying that taking the original file size as size requirement is the whole issue ? If I follow the guide again and do the computation as described, the bitrate value is just very slightly different: >>> 690*8192./(3600+6*60+2) - 128 1298.673397274104 Assuming my mp3 audio did not have any particular problem, would there be an actual difference in between using -b:v 1298k vs -b:v 1321894 ? Thanks again, > 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". -- Mathieu ___ 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] Using GPU with ffmpeg
On 11/29/2020 10:07 PM, madderek--- via ffmpeg-user wrote: ffmpeg -framerate 29.97 -start_number 70001 -i L:\baf1400_70001-9\%06d.tif -c:v libx264 -preset veryslow -tune film -profile:v high -pix_fmt yuv420p -level 4.1 -crf 17 -r 29.97 -threads 2 L:\baf140070001916tiff.mkv Output? (need to see that) And please don't top-post on this list. 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".
Re: [FFmpeg-user] Using GPU with ffmpeg
ffmpeg -framerate 29.97 -start_number 70001 -i L:\baf1400_70001-9\%06d.tif -c:v libx264 -preset veryslow -tune film -profile:v high -pix_fmt yuv420p -level 4.1 -crf 17 -r 29.97 -threads 2 L:\baf140070001916tiff.mkv Derek -Original Message- From: ffmpeg-user On Behalf Of Carl Eugen Hoyos Sent: 29 November 2020 23:58 To: FFmpeg user questions Subject: Re: [FFmpeg-user] Using GPU with ffmpeg Am So., 29. Nov. 2020 um 21:36 Uhr schrieb madderek--- via ffmpeg-user : > The process is slow. Please show us the command line you tested together with the complete, uncut console output to allow us to better understand what your issue is. > Is there a simple way of using the GPU ram? Hardware acceleration (which is typically provided by third-party libraries) allows to use GPU resources, ffmpeg itself cannot (and doesn't need to) use GPU ram. Please find out what top-posting means and avoid it here, 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". ___ 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] Using GPU with ffmpeg
Am So., 29. Nov. 2020 um 21:36 Uhr schrieb madderek--- via ffmpeg-user : > The process is slow. Please show us the command line you tested together with the complete, uncut console output to allow us to better understand what your issue is. > Is there a simple way of using the GPU ram? Hardware acceleration (which is typically provided by third-party libraries) allows to use GPU resources, ffmpeg itself cannot (and doesn't need to) use GPU ram. Please find out what top-posting means and avoid it here, 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] Using GPU with ffmpeg
Thanks for reply. About 4.6 hours! The software that I am using to enhance videos will output to jpeg, I'm outputting to uncompressed 16bit TIFFs at the moment. Derek -Original Message- From: ffmpeg-user On Behalf Of andrei ka Sent: 29 November 2020 21:21 To: FFmpeg user questions Subject: Re: [FFmpeg-user] Using GPU with ffmpeg 20k frames are a mere 800s of a 25fps movie... how slow is cpu process ? afaik nvenc can only do mjpeg_cuvid for stitching images, it won't work with tiffs... e.g. ffmpeg -vsync 0 -hwaccel cuvid -c:v mjpeg_cuvid -framerate NN -i image_%04d.jpg -c:v h264_nvenc x.mp4... ___ 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] Using GPU with ffmpeg
20k frames are a mere 800s of a 25fps movie... how slow is cpu process ? afaik nvenc can only do mjpeg_cuvid for stitching images, it won't work with tiffs... e.g. ffmpeg -vsync 0 -hwaccel cuvid -c:v mjpeg_cuvid -framerate NN -i image_%04d.jpg -c:v h264_nvenc x.mp4... ___ 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] Using GPU with ffmpeg
Hi I'm using ffmpeg to combine a large number of TIFF files into a single video. The TIFFs are the result of upscaling videos. They are large in number, typically 2 or 3. The process is slow. Is there a simple way of using the GPU ram? I have a NVIDIA 2080 TI with 11GBof RAM. Derek Clements ___ 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] 2nd pass has more frames than 1st pass (99021)2kbits/s dup=27 drop=0 speed=4.76x
Am So., 29. Nov. 2020 um 16:32 Uhr schrieb Mathieu Malaterre : > $ ffmpeg -y -i input.avi -c:v libx264 -b:v 1321894 -pass 1 -an -f null > /dev/null && \ > ffmpeg -y -i input.avi -c:v libx264 -b:v 1321894 -pass 2 -c:a aac -b:a > 128k fixed.mp4 This cannot work (and this is not related to the fact that you are not using a version of FFmpeg that we support here). In some cases - if you are lucky - there is a crash and no output file is written, in other cases, a "broken" output file is written, broken in the sense that two-pass encoding did not work the way it is supposed to (more bitrate was given to frames that do not need it). Do not use -an on the first pass and add "-vsync cfr" to the first pass. (Other workarounds are possible.) For future questions: Do not cut FFmpeg's console output, only post ffprobe output if you see an issue with it. Not really related: > Does it make sense to simply copy/paste the existing bit_rate to > re-encode it ? No, to the best of my knowledge, it makes no sense whatsoever. Very generally you either want a specific output quality, in this case specifying a bitrate and two-pass encoding make no sense. Or you have a particular size requirement for the output file, then bitrate and two-pass encoding make sense. 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] asubboost and asupercut
On Sunday, 29 November 2020, 15:55:29 GMT, Michael Koch wrote: > The name "feedback" is misleading because this signal isn't going back.> It > would make sense to rename "feedback" to "wet".> What's now "wet" could be > renamed "gain", or it could be removed because > it's unnecessary. I may not be fully comprehending the behaviour of the software in this case, but if your diagram is accurate that would make sense. Certainly it would reflect the meaning of the terms "dry" and "wet" as they're commonly used in audio processing. Using those terms in another way is confusing. P ___ 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] asubboost and asupercut
On Sun, Nov 29, 2020 at 4:55 PM Michael Koch wrote: > Am 28.11.2020 um 22:09 schrieb Paul B Mahol: > > Ok, made the wet option do actually apply gain to final output. > > I think the asubboost block diagram does now look like this (view with > fixed width font): > > IN -o> DRY ---> ADD -> WET -> OUT > |^ > || > +-> LP -> ADD -o-> FEEDBACK -+ > ^ | > | | > +- DECAY <- DELAYLINE <-+ > > The name "feedback" is misleading because this signal isn't going back. > It would make sense to rename "feedback" to "wet". > What's now "wet" could be renamed "gain", or it could be removed because > it's unnecessary. > > It is really necessary, You keep insisting on pointless changes. > Michael > > ___ > 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] asubboost and asupercut
Am 28.11.2020 um 22:09 schrieb Paul B Mahol: Ok, made the wet option do actually apply gain to final output. I think the asubboost block diagram does now look like this (view with fixed width font): IN -o> DRY ---> ADD -> WET -> OUT | ^ | | +-> LP -> ADD -o-> FEEDBACK -+ ^ | | | +- DECAY <- DELAYLINE <-+ The name "feedback" is misleading because this signal isn't going back. It would make sense to rename "feedback" to "wet". What's now "wet" could be renamed "gain", or it could be removed because it's unnecessary. Michael ___ 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] 2nd pass has more frames than 1st pass (99021)2kbits/s dup=27 drop=0 speed=4.76x
Hi there, I am staring at the following guide to re-encode an existing avi (mpeg4+mp3) into MP4 (h264+aac): https://trac.ffmpeg.org/wiki/Encode/H.264#twopass My video is such that: $ ffprobe -show_streams -show_format -print_format json -i input.avi [...] Input #0, avi, from 'input.avi': Duration: 01:06:01.97, start: 0.00, bitrate: 1459 kb/s Stream #0:0: Video: mpeg4 (DIVX / 0x58564944), yuv420p, 640x480, 1321 kb/s, 24.99 fps, 25 tbr, 24.99 tbn, 30k tbc Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp, 127 kb/s "streams": [ { "index": 0, "codec_name": "mpeg4", "bit_rate": "1321894", ... "index": 1, "codec_name": "mp3", "bit_rate": "127704", ... "format": { "format_name": "avi", "bit_rate": "1459407", Does it make sense to simply copy/paste the existing bit_rate to re-encode it ? Or did I miss something from the guide (I find it hard to make sense of the error message given) ? In my case, the following command: $ ffmpeg -y -i input.avi -c:v libx264 -b:v 1321894 -pass 1 -an -f null /dev/null && \ ffmpeg -y -i input.avi -c:v libx264 -b:v 1321894 -pass 2 -c:a aac -b:a 128k fixed.mp4 gives: ffmpeg version 4.1.6-1~deb10u1 Copyright (c) 2000-2020 the FFmpeg developers built with gcc 8 (Debian 8.3.0-6) configuration: --prefix=/usr --extra-version='1~deb10u1' --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared libavutil 56. 22.100 / 56. 22.100 libavcodec 58. 35.100 / 58. 35.100 libavformat58. 20.100 / 58. 20.100 libavdevice58. 5.100 / 58. 5.100 libavfilter 7. 40.101 / 7. 40.101 libavresample 4. 0. 0 / 4. 0. 0 libswscale 5. 3.100 / 5. 3.100 libswresample 3. 3.100 / 3. 3.100 libpostproc55. 3.100 / 55. 3.100 [mpeg4 @ 0x563b663d7580] looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag Input #0, avi, from 'input.avi': Duration: 01:06:01.97, start: 0.00, bitrate: 1459 kb/s Stream #0:0: Video: mpeg4 (DIVX / 0x58564944), yuv420p, 640x480, 1321 kb/s, 24.99 fps, 25 tbr, 24.99 tbn, 30k tbc Stream #0:1: Audio: mp3 (U[0][0][0] / 0x0055), 44100 Hz, stereo, fltp, 127 kb/s Stream mapping: Stream #0:0 -> #0:0 (mpeg4 (native) -> h264 (libx264)) Press [q] to stop, [?] for help [mpeg4 @ 0x563b667c5040] looks like this file was encoded with (divx4/(old)xvid/opendivx) -> forcing low_delay flag [libx264 @ 0x563b667c8380] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX [libx264 @ 0x563b667c8380] profile Main, level 3.0 Output #0, null, to '/dev/null': Metadata: encoder : Lavf58.20.100 Stream #0:0: Video: h264 (libx264), yuv420p, 640x480, q=-1--1, 1321 kb/s, 25 fps, 25 tbn, 25 tbc Metadata: encoder : Lavc58.35.100 libx264 Side data: cpb: bitrate max/min/avg: 0/0/1321000 buffer size: 0 vbv_delay: -1 [mpeg4 @ 0x563b667c5040] Error at MB: 11510:57:03.56 bitrate=N/A speed=12.5x [mpeg4 @ 0x563b667c5040] I cbpc damaged at 8 27 [mpeg4 @ 0x563b667c5040] Error at MB: 1115 [mpeg4 @ 0x563b667c5040] marker does not match f_code Last message repeated 23 times [mpeg4 @ 0x563b667c5040] concealing 1200 DC, 1200 AC, 1200 MV errors in I frame [mpeg4 @ 0x563b667c5a40] P cbpy damaged at 8 0:45.68 bitrate=N/A speed=12.5x [mpeg4 @ 0x563b667c5a40] Error at MB: 8 [mpeg4 @ 0x563b667c5a40] marker does not match f_code Last message repeated 4 times [mpeg4 @ 0x563b667c5a40] P cbpy damaged at 22 8 [mpeg4 @ 0x563b667c5a40] Error at MB: 350 [mpeg4 @ 0x563b667c5a40] marker does not match f_code Last message repeated 7 times [mpeg4 @ 0x563b667c5a40] P cbpy damaged at 17 8 [mpeg4 @ 0x563b667c5a40] Error at MB: 345 [mpeg4 @ 0x563b667c5a40] marker does not match f_code Last message repeated 5 times [mpeg4 @ 0x563b667c5a40] concealing 1200 DC, 1200 AC, 1200 MV
Re: [FFmpeg-user] How to remove duplicate frames
Am Sa., 28. Nov. 2020 um 16:57 Uhr schrieb Mike Martin : > ffmpeg -i input.mp4 -vf mpdecimate,setpts=N/25/TB -c:a copy -vsync 0 > out.mp4 Please remove setpts and vsync from your command line, both are meant to destroy audio sync. You cannot get the result you want with mp4 output because FFmpeg does not like vfr mov output (and if you remove frames, you get vfr output). (There is no relevant difference between mov and mp4.) 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".
[FFmpeg-user] Issue with disposition "forced" for a subtitles stream (mov_tex) in a mp4 container
Dear all, I'm using ffmpeg (4.3.1-2020-11-19-full_build-www.gyan.dev) on Windows 7 to mux video, audio and subtitles streams in a mp4 container. I'd like to force the subtitles stream to be displayed by default, so I use the "-disposition:s:0 forced" option. However ffmpeg fails to properly set the "disposition" option for the subtitles stream to "forced" so I need to manually enable the subtitle when the video is played by VLC media player 3.0.11. The exact command is: ffmpeg -i Video.mp4 -i Audio.mp4 -i Sub.vtt -map 0 -map 1 -map 2 -metadata:s:a:0 language=jpn -metadata:s:s:0 language=ita -c:v copy -c:a copy -c:s mov_text -disposition:a:0 default -disposition:s:0 forced Video_Audio_Sub.mp4 The relevant part of the command output for the subtitle stream is: Stream #0:2(ita): Subtitle: mov_text (tx3g / 0x67337874) (forced) While the subtitles stream is tagged as "(forced)", in the resulting muxed video the subtitle stream is only tagged as "default" as reported by ffprobe and mediainfo and is not automatically displayed in VLC: ffprobe Video_Audio_Sub.mp4 [...] Stream #0:2(ita): Subtitle: mov_text (tx3g / 0x67337874), 0 kb/s (default) mediainfo Video_Audio_Sub.mp4 [...] Text ID : 3 Format : Timed Text Muxing mode : sbtl Codec ID : tx3g Default : Yes Forced : No Is this a bug or did I miss something? For comparison, using mp4box -add Video_Audio.mp4 -add Sub.srt:txtflags=0xC000 -new Video_Audio_Sub.mp4 the subtitles stream is correctly recognized as "forced" by mediainfo (and as "default" by ffprobe) and is automatically displayed in VLC: mediainfo Video_Audio_Sub.mp4 Text ID : 3 Format : Timed Text Codec ID : tx3g Forced : Yes Thank you in advance for the help. Regards. Andrea ___ 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] help needed, combine three simple calls into one?
> > ffmpeg -y -f concat -safe 0 -copyts -i videoList.txt -muxpreload 0 > > -muxdelay 0 -c copy -b:a 128K -cpu-used 0 -preset slow -movflags > > +faststart -f mp4 concat.mp4 > Make one file out of ??? files. Does this also re-encode anything? (What are > the input formats? see below) > > > ffmpeg -y -i concat.mp4 -itsoffset 1.9 -i concat.mp4 -c:a aac -c:v > > copy -map 0:v:0 -map 1:a:0 -f mp4 audioFixed.mp4 > Shift the audio a bit and re-mux. > > > ffmpeg -y -i audioFixed.mp4 -ss 2 -to 17 -c:v copy -c:a aac -f mp4 > > final.mp4 > Select part of the now-shifted file. > > > Sometimes, there is no gain to creating more complex directives. In this > case, it might reduce the amount of de/remux work, but the time-shift > suggests pretty much means you're stuck with intermediate file(s). Might > combine the 2nd and 3rd commands. > > Since you only select 17 seconds from the output, you could add a 20 second > limit to the first step, which would potentially make the intermediate files > smaller. (Another thing we don't know.) > > Consider using another _container_ type for the intermediate file(s) (e.g. > nut, avi, or mkv, which can hold the mp4 data). > > You could also, in the first pass, write to separate files for audio and > video, > which might simplify the shift/remux process and then apply the time-based > selection to that (see > https://trac.ffmpeg.org/wiki/Creating%20multiple%20outputs). > > Move the "faststart" to the last step since that's where it would matter (it > gets in the way of piping, if used, and it adds a second file write pass). > > I haven't yet tried any of this, and there's probably an error somewhere in > there. > > As usual, it really helps to see the command output so we know the file > formats/etc. > > z! Many thanks for your detailed reply! It helps us a lot. Best, RS ___ 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".