You are not logged in.
Hi
I used:
ffmpeg -loop 1 -r 1 -i IMG_file.jpg -i audio_p1.mp3 -c:a copy -c:v libx264 -tune stillimage -shortest output.mp4I have:
203kB IMG_file.jpg
2.1MB audio_p1.mp3
37MB output.mp4
Please inform, is it possible that I can get video around 3MB only, but still in mp4 format.
I am actually trying to upload to FB, but they dont allow the audio upload. But this large volume is not suiting me.
Thankyou
Last edited by makh (2018-05-12 18:18:23)
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
Did you try simply
ffmpeg -i IMG_file.jpg -i audio_p1.mp3 output.mp4You'll end up w/ an aac, but that should be fine.
Offline
Did you try simply
ffmpeg -i IMG_file.jpg -i audio_p1.mp3 output.mp4You'll end up w/ an aac, but that should be fine.
does that produce a video with just one frame? In that case most online services will derp out, atleast it did when I uploaded such video to youtube
Offline
You may try solution in this link:
https://video.stackexchange.com/questio … ith-ffmpeg
or maybe this is what you need:
https://trac.ffmpeg.org/wiki/Encode/YouTube
Last edited by xerxes_ (2018-04-30 10:42:19)
Offline
It says 25fps but if it has more than one key frame, the encoder would do wrong.
idk whether FB is ok with that, because apparently I don't have any friends.
Offline
Did you try simply
ffmpeg -i IMG_file.jpg -i audio_p1.mp3 output.mp4You'll end up w/ an aac, but that should be fine.
Hi this gives me a video file, but the file has no video, it only ends up in audio. Plus FB complains that it is not a valid video format.
@xeres:
Using:
ffmpeg -loop 1 -framerate 2 -i input.png -i audio.m4a -c:v libx264 -preset medium -tune stillimage -crf 18 -c:a copy -shortest -pix_fmt yuv420p output.mkvgives me:
18MB output.mkv
Its a little better then mp4, but still I dont understand: (203kB + 2.1MB) ... its still too big, for me...!!!
Trying:
ffmpeg -i input.mp3 -c copy output.mkv... FB complains that it is not a valid video format.
Thankyou
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
How long is that audio file? The size is less important. The longer it is
the more frames of video that have to be made. Longer the audio the larger the
video will be. Also the larger the image the larger the video will be in size.
I did a test.
I made a file.png with scrot, it is 768x432, 326Kb in size
I then made a .mp3 that is 3:00 long and 128K, it is 2.8Mb in size.
I then made a 30fps x264 .mp4 out of them
ffmpeg -i file.mp3 -loop 1 -i file.png -t 00:03:00 -c:a copy -c:v libx264 -crf 18 -preset slow -r 30 -pix_fmt yuv420p OutFile.mp4OutFile.mp4 is 4.6Mb in size
Offline
How long is that audio file?
Hi
Your method gave me one error; I couldnt use -t as my file was 0:8:56 time, and it caused ffmpeg to run endlessly.
But it gave me a possible hint to reduce the image size; so I did as:
STEP 1:
Compress image to 50% using convert.
STEP 2:
Reduce image to around 800x600, using smooth scale option in Kolourpaint.
STEP 3:
ffmpeg -loop 1 -framerate 2 -i image_file_3.jpeg -i audio_p1.mp3 -c:v libx264 -preset medium -tune stillimage -crf 18 -preset slow -c:a copy -shortest -pix_fmt yuv420p output.mkvRESULT:
3.4MB output.mkv
Well I am not sure, it could have been fine tuned more, or not...!
Thankyou All ![]()
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline
Your command is almost there, but you are using two "-preset" options–you only need one. Use a slow preset. Since you're not encoding many frames it won't take long.
No need to use convert or Kolourpaint: just do it all in ffmpeg.
ffmpeg -loop 1 -framerate 2 -i image.jpg -i audio.mp3 -c:v libx264 -preset veryslow -crf 18 -vf "scale='min(1280,iw)':-2,format=yuv420p" -c:a copy -shortest output_x265.mkvIn this example the image is downscaled to 1280 pixels wide only if the input is larger; otherwise use original image size to prevent a needless upscale.
If the video is not accepted increase the `-framerate` value.
You may also try libx265 instead of libx264 to encode HEVC/H.265 video, but it will probably not make much of a size difference in this case (assuming Facebook accepts HEVC).
Offline
...
Thankyou Sir! Let me test and see if it helps me. It will definitely be nicer to do it in one shot.
OS: Arch &/ Debian
System: LENOVO ThinkPad E14
Desktop: Xfce
Offline