You are not logged in.
Hi all,
I have a question regarding ffmpeg. I convert flac files with 1 image to mp4 videos, x265 and aac. I mostly use https://trac.ffmpeg.org/wiki/Encode/YouTube as a reference.
Now, i use the following command to convert:
find . -type f -name '*.flac' -exec bash -c 'ffmpeg -y -loop 1 -framerate 2 -i "video_cover_2560x1440.jpeg" -i "${0}" -c:v libx264 -preset veryfast -tune stillimage -crf 18 -codec:a aac -b:a 320k -pix_fmt yuv420p -shortest "${0%.*}_x264_aac.mp4"' '{}' \;
This command adds silence at the end of my video, from 5 to 30 seconds. I can clearly see in the output that this is happening on the last frame (different numbers for different lengths of flac):
frame= 472 fps= 23 q=15.0 size= 9728kB time=00:03:43.50 bitrate= 356.6kbits/s speed=11.1
frame= 479 fps= 23 q=-1.0 Lsize= 9915kB time=00:03:58.00 bitrate= 341.3kbits/s speed=11.5x
There is no clear indicator why this happens. If i use Vorbis and Theora then there are no issues but sadly online services are not supporting that format. The easy way was to convert Theora video, with perfect image and length, however something was messed up since Vimeo is not recognising that video.
Lastly, it seems that converting flac to aac directly, as music format, adds much more silence so i am puzzled. I cannot use libfdk_aac right now so i use ffmpeg aac. This happens with x265 as well so it is AAC issue but i cannot find a way to make it work.
The only thread on the matter is not helping in my case: https://stackoverflow.com/questions/558 … at-the-end
Offline
If the services you use support it, try Opus, of the matroska family like Vorbis. Aac is not well supported by ffmpeg, especially with mp4.
Offline
If the services you use support it, try Opus, of the matroska family like Vorbis. Aac is not well supported by ffmpeg, especially with mp4.
I have tried webm with opus and vorbis but sadly there is no support for it.
I have, however, fiddled with the settings a bit and i got some results by changing crf to 30 and setting framerate at 10. It is not perfect but i get up to +1 second at the end of the video and that is fine since the goal is to use ffmpeg in terminal for batch converting. File size is acceptable.
Still, curious about why this happens.
Last edited by kuraku (2021-12-07 16:27:31)
Offline
AAC has a non-open license, so it cannot be integrated directly into FFmpeg. An encoder has been made (probably based on reverse engineering) that is problematic. see:
https://trac.ffmpeg.org/wiki/Encode/AAC
Offline
AAC has a non-open license, so it cannot be integrated directly into FFmpeg. An encoder has been made (probably based on reverse engineering) that is problematic. see:
https://trac.ffmpeg.org/wiki/Encode/AAC
I have read that, it is not so favourable in my case especially since most online platforms are recommending and supporting that format : (
Do you have any tested format working on YouTube, Vimeo, PeerTube and similar websites? Changing format is quite fine if all mayor networks support that.
Offline
I'm sorry, I only use Youtube to which I provide webm files (VP9 + Opus). I leave the task of any transcoding to them. I lose control over the quality, but I'm fine with that.
Actually it's been several months since I've done an upload so I didn't know they had switched to mp4 only with h264+aac; before they used webm too!
You're probably better off going through an NLE that has some presets for the service you want to use. Try putting the Cinelerra-GG appimage and use the mp4 container with audio presets "faststart_h264.mp4" (which uses the aac encoder) and video presets "faststart_h264.mp4". If you prefer them, h265 presets also use aac.
Offline