Open 0kashi opened 3 years ago
Hi @0kashi, from the log it looks like it's having some problems with the audio stream inside your file:
Stream #0:1 -> #0:1 (? (?) -> aac (libfdk_aac))
Decoder (codec none) not found for input stream #0:1
Does it play correctly in other software, and does it have audio? And a couple of things you could try:
ffmpeg-opts
, something like this: docker run --rm -v /path/to/files:/files bennetimo/shrinkwrap --ffmpeg-opts analyzeduration=2147483647,probesize=2147483647 --input-extension avi /files/video1.avi
-a false
and see what happens thereAnd if you have something like mediainfo
installed, you could run that against your file to see what codecs are in use in the file, and then might need to tweak the parameters accordingly.
Hope that helps!
Hi @bennetimo - Sorry to resurrect this after quite some time. I tried your suggestion with increasing the 'analyzeduration' and 'probesize' to no avail. But I figured out the issue with the audio stream. Below are the details about the file in case you are curious.
Basically I need to be able tried to insert -codec:a aac
BEFORE the input file name (before the -i
here: https://github.com/bennetimo/shrinkwrap/blob/master/src/main/scala/io/coderunner/shrinkwrap/Action.scala#L32). Though the --ffmpeg-opts
is only for the output. Any ideas here?
General
Complete name : /Desktop/test-file.avi
Format : AVI
Format/Info : Audio Video Interleave
File size : 78.1 MiB
Duration : 4 min 59 s
Overall bit rate : 2 187 kb/s
VGN0 : Living Room
VGT0 : |íz
VGT1 : Î"íz
Video
ID : 0
Format : q264
Codec ID : q264
Duration : 4 min 59 s
Bit rate : 2 114 kb/s
Width : 2 048 pixels
Height : 1 536 pixels
Display aspect ratio : 4:3
Frame rate : 30.000 FPS
Bits/(Pixel*Frame) : 0.022
Stream size : 75.5 MiB (97%)
Audio
ID : 1
Format : AAC LC
Format/Info : Advanced Audio Codec Low Complexity
Format version : Version 4
Muxing mode : ADTS
Codec ID : AAC-2
Duration : 4 min 59 s
Bit rate : 256 kb/s
Channel(s) : 1 channel
Channel layout : C
Sampling rate : 16.0 kHz
Frame rate : 15.625 FPS (1024 SPF)
Compression mode : Lossy
Stream size : 2.32 MiB (3%)
Alignment : Split across interleaves
Interleave, duration : 64 ms (1.92 video frames)
EDIT: I thought this fixed the issue, but after the first 30 or so seconds the audio got garbled and then cut out. Do you have any suggestions based upon the above output from mediainfo
?
Hi, no problem :) Is it the same for all your files or just one bad one? Based on that mediainfo
output it looks like possibly the files are from a QNAP and they have (weirdly) given the codec name of q264
instead of what it probably is, h264
.
So some things you could try:
ffmpeg -f h264 -i yourfile.avi ... etc
ffmpeg -i yourfile.avi -ss 00:40:00
, and see if you can process the latter part of the file okAbout specifying modifiers to take effect before the input file, yeah that would be nice. It's not possible with how it is at the moment but is something I've thought about before as I've found myself wanting to do that a couple of times. So if you want to play around with it, you can exec into the container but not run shrinkwrap, and then play around with ffmpeg.
e.g. something like:
docker run -v "$(pwd)":/test --entrypoint=/bin/bash -it bennetimo/shrinkwrap
That will put you into the container with whatever directory you ran it from mounted at /test
. So if your avi is in there, you can then experiment, ffmpeg -i /test/yourfile.avi...
HTH
Thanks. Yeah that is a weird codec name and yes, it is from a qnap. The thing is the video portion works fine, it's the audio that doesn't get brought over. I get a scaled down video with no audio. I guess I will continue to play with it. If you ever do implement the ability to insert options for the input let me know.
Thanks again.
Firstly thank you for your post.
I am trying to use your tool to reduce the file sizes of some AVI files though I get the errors below. Admittedly I am a noob to ffmpeg so please forgive me if it is a simple solution.