Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transcoder example 'Failed to initialize buffer filter: Invalid argument' #43

Open
NikkyAI opened this issue Jun 30, 2017 · 11 comments
Open

Comments

@NikkyAI
Copy link

NikkyAI commented Jun 30, 2017

i very recently tried to run transcoder.go

ffmpeg -version
ffmpeg version 3.3.2 Copyright (c) 2000-2017 the FFmpeg developers
built with gcc 7.1.1 (GCC) 20170516
configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-avisynth --enable-avresample --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libass --enable-libbluray --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libschroedinger --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxvid --enable-shared --enable-version3
libavutil      55. 58.100 / 55. 58.100
libavcodec     57. 89.100 / 57. 89.100
libavformat    57. 71.100 / 57. 71.100
libavdevice    57.  6.100 / 57.  6.100
libavfilter     6. 82.100 /  6. 82.100
libavresample   3.  5.  0 /  3.  5.  0
libswscale      4.  6.100 /  4.  6.100
libswresample   2.  7.100 /  2.  7.100
libpostproc    54.  5.100 / 54.  5.100

i tried it with input files as mp4 and mkv

the error seems to be either naming or invalid combination of filters in the input buffer

running the transcoder with a test file from http://jell.yfish.us/ to make sure its reproduceable

/tmp/Transcodergo --input=jellyfish-3-mbps-hd-h264.mkv --output=out.mkv
GOROOT=/usr/lib/go
GOPATH=/home/nikky/go
/usr/lib/go/bin/go build -tags ffmpeg33 -o /tmp/Transcodergo /home/nikky/dev/GCT/transcoder.go
[NULL @ 0x1affe40] Opening 'jellyfish-3-mbps-hd-h264.mkv' for reading
[file @ 0x1b005c0] Setting default whitelist 'file,crypto'
[matroska,webm @ 0x1affe40] Format matroska,webm probed with size=2048 and score=100
st:0 removing common factor 1000000 from timebase
[matroska,webm @ 0x1affe40] Before avformat_find_stream_info() pos: 5527 bytes read:32768 seeks:0 nb_streams:1
[h264 @ 0x1b02260] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x1b02260] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x1b02260] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x1b02260] nal_unit_type: 8, nal_ref_idc: 3
[h264 @ 0x1b02260] nal_unit_type: 5, nal_ref_idc: 3
[h264 @ 0x1b02260] Reinit context to 1920x1088, pix_fmt: yuv420p
[h264 @ 0x1b02260] no picture 
[matroska,webm @ 0x1affe40] All info found
[matroska,webm @ 0x1affe40] After avformat_find_stream_info() pos: 75158 bytes read:98304 seeks:0 frames:3
Input #0, matroska,webm, from 'jellyfish-3-mbps-hd-h264.mkv':
  Metadata:
    encoder         : libebml v1.2.0 + libmatroska v1.1.0
    creation_time   : 2016-02-06T03:58:03.000000Z
  Duration: 00:00:30.03, start: 0.000000, bitrate: 2984 kb/s
    Stream #0:0(eng), 3, 1/1000: Video: h264 (High), 1 reference frame, yuv420p(tv, bt709, progressive, left), 1920x1080 (1920x1088) [SAR 1:1 DAR 16:9], 0/1, 29.97 fps, 29.97 tbr, 1k tbn, 59.94 tbc (default)
[h264 @ 0x1b07e60] nal_unit_type: 7, nal_ref_idc: 3
[h264 @ 0x1b07e60] nal_unit_type: 8, nal_ref_idc: 3
detected 4 logical cores
[in @ 0x1b06a60] Invalid parameters provided.
2017/06/30 20:33:29 Failed to initialize buffer filter: Invalid argument

Process finished with exit code 1

because i know barely anything about lib-av or ffmpeg i am not able to figure out if the C calls or the values ffmpeg expects have changed.. just to make sure its not a problem with this system i will try out on a windows machine later today or tomorrow

also.. is there a easy to use guide to be able to convert commandline ffmpeg options into the corresponding commands that have to be called in C / Go ?

@NikkyAI NikkyAI changed the title example code out of date? transcoder example 'Failed to initialize buffer filter: Invalid argument' Jun 30, 2017
@NikkyAI
Copy link
Author

NikkyAI commented Jun 30, 2017

and for completeness using the example invokation from the comment at transcoder.go#L9

/tmp/Transcodergo -input=https://bintray.com/imkira/go-libav/download_file?file_path=sample_iPod.m4v --output=output.mp4
GOROOT=/usr/lib/go
GOPATH=/home/nikky/go
/usr/lib/go/bin/go build -tags ffmpeg33 -o /tmp/Transcodergo /home/nikky/dev/GCT/transcoder.go
[NULL @ 0x2378e40] Opening 'https://bintray.com/imkira/go-libav/download_file?file_path=sample_iPod.m4v' for reading
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
[https @ 0x23795c0] Setting default whitelist 'http,https,tls,rtp,tcp,udp,crypto,httpproxy'
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
[https @ 0x23795c0] request: GET /imkira/go-libav/download_file?file_path=sample_iPod.m4v HTTP/1.1
User-Agent: Lavf/57.71.100
Accept: */*
Range: bytes=0-
Connection: close
Host: bintray.com
Icy-MetaData: 1


Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
[https @ 0x23795c0] request: GET /imkira/go-libav/sample_iPod.m4v HTTP/1.1
User-Agent: Lavf/57.71.100
Accept: */*
Range: bytes=0-
Connection: close
Host: dl.bintray.com
Icy-MetaData: 1


Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
Using network protocols without global network initialization. Please use avformat_network_init(), this will become mandatory later.
[https @ 0x23795c0] request: GET /d0/d0c3302e6bab377255f985ebd1e7cb94eff2293c14d192156d9c5ceb65e3a984?__gda__=exp=1498849758~hmac=3b3c0271419ec3aced9639871c3b3da6afea1bf05feccbbd32536c68af312d64&response-content-disposition=attachment%3Bfilename%3D%22sample_iPod.m4v%22&response-content-type=video%2Fx-m4v&requestInfo=U2FsdGVkX18baFN9vb8cKlFbAUh95kuJg58vvUJlVG5Jhaj7chQJ_PePVVpU3lMj4cJA4jqo1xH0jS81gchRNPvK0pQZ0sK9m1wsvdUJacL9ayEjH9kNMH5AjEcr4xvx HTTP/1.1
User-Agent: Lavf/57.71.100
Accept: */*
Range: bytes=0-
Connection: close
Host: akamai.bintray.com
Icy-MetaData: 1


[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2378e40] Format mov,mp4,m4a,3gp,3g2,mj2 probed with size=2048 and score=100
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2378e40] ISO: File Type Major Brand: M4V 
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2378e40] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2378e40] Processing st: 0, edit list 0 - media time: 0, duration: 3770550
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2378e40] Unknown dref type 0x206c7275 size 12
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2378e40] Processing st: 1, edit list 0 - media time: 0, duration: 85500
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2378e40] Before avformat_find_stream_info() pos: 30378 bytes read:43816 seeks:0 nb_streams:2
[h264 @ 0x24c6d80] nal_unit_type: 7, nal_ref_idc: 1
[h264 @ 0x24c6d80] nal_unit_type: 8, nal_ref_idc: 1
[h264 @ 0x24c6d80] nal_unit_type: 6, nal_ref_idc: 0
[h264 @ 0x24c6d80] nal_unit_type: 5, nal_ref_idc: 1
[h264 @ 0x24c6d80] nal_unit_type: 5, nal_ref_idc: 1
[h264 @ 0x24c6d80] Reinit context to 320x240, pix_fmt: yuv420p
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2378e40] All info found
[mov,mp4,m4a,3gp,3g2,mj2 @ 0x2378e40] After avformat_find_stream_info() pos: 30848 bytes read:43816 seeks:0 frames:23
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'https://bintray.com/imkira/go-libav/download_file?file_path=sample_iPod.m4v':
  Metadata:
    major_brand     : M4V 
    minor_version   : 1
    compatible_brands: M4V M4A mp42isom
    creation_time   : 2005-12-20T20:20:15.000000Z
  Duration: 00:01:25.50, start: 0.000000, bitrate: 209 kb/s
    Stream #0:0(eng), 22, 1/44100: Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 115 kb/s (default)
    Metadata:
      creation_time   : 2005-12-20T20:20:15.000000Z
      handler_name    : Apple Sound Media Handler
    Stream #0:1(eng), 1, 1/1000: Video: h264 (Constrained Baseline), 1 reference frame (avc1 / 0x31637661), yuv420p(tv, smpte170m/smpte170m/bt709, topleft), 320x240, 0/1, 90 kb/s, 10 fps, 10 tbr, 1k tbn, 2k tbc (default)
    Metadata:
      creation_time   : 2005-12-20T20:20:15.000000Z
      handler_name    : Apple Video Media Handler
[h264 @ 0x25bc4c0] nal_unit_type: 7, nal_ref_idc: 1
[h264 @ 0x25bc4c0] nal_unit_type: 8, nal_ref_idc: 1
detected 4 logical cores
[in @ 0x257aa40] Invalid parameters provided.
2017/06/30 20:57:18 Failed to initialize buffer filter: Invalid argument

Process finished with exit code 1

@dim
Copy link

dim commented Jul 11, 2017

Hey, any idea on what's causing it? We are experiencing the same problem.

@NikkyAI
Copy link
Author

NikkyAI commented Jul 12, 2017

sadly no progress on my end, i have no experience with ffmpeg whatsoever
tried to get this maybe working on windows but it does not even install the package there
failed on some pkg-config problems, i am not even sure if there is any instructions for this apart from..
First, install ffmpeg 3.x libraries on your system. for go-libav

@shy413592272
Copy link

I am experiencing the same problem.Do you have any idea?

@NexusLee
Copy link

I got the same problem. How to fix it?

@imkira
Copy link
Owner

imkira commented Aug 4, 2017

I haven't investigated this issue but the way I see it is simply because the provided examples/transcoder.go is - like the folder name states - an "example". The comments in the header of the file make this clear too:

https://github.com/imkira/go-libav/blob/master/examples/transcoder.go#L1-L5

I don't think you have a ffmpeg versioning problem or whatever. You need more "hacking" around the parameters you're using, most likely the way to build the video buffer filter.
Sadly it is sometimes "too hacky" so the way I do it is to use https://github.com/FFmpeg/FFmpeg/blob/n3.0.9/ffmpeg.c as an implementation refererence.

@imkira
Copy link
Owner

imkira commented Aug 4, 2017

@NikkyAI btw, just tried running ffmpeg 3.0.2 on MacOSX here with against the latest master code:

go run --tags ffmpeg30 transcoder.go --input=http://jell.yfish.us/media/jellyfish-3-mbps-hd-h264.mkv  --output=output.mp4

Could you clarify the following for me:

  • What file from http://jell.yfish.us are you running the example against?
  • How are you running the example?
  • What is your ffmpeg/OS version?

@NikkyAI
Copy link
Author

NikkyAI commented Aug 6, 2017

my ffmpeg version is 3.3

i recorded my terminal session here: https://asciinema.org/a/aMoUTSzF8GOSSstEaLOcNR78a
that should contain all the info.. i used your transcoder invocation.. except --tags ffmpeg33 which probably explains it
also transcoder.go is unmodified

@HyeJong
Copy link

HyeJong commented Sep 19, 2017

I got the same problem.
ffmpeg version 3.3.4
Go 1.9
macos 10.12.6

@songheng45
Copy link

go1.9 on mingw64 same problem. ffmpeg version 3.3.2
Failed to initialize buffer filter: Invalid argument
......
[in @ 00000000048ef3a0] Invalid parameters provided.

Help pls.

@longbozhan
Copy link

I got the same problem。Help pls。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants