Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > VapourSynth

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th August 2016, 09:26   #1  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
LibavSmashSource and vapoursynth error messages going through stdout

so i'm piping with vspipe and using smashsource to read quicktime files.

so far so good.

but then i come across a quicktime file that, although it loads in vsedit and looks fine, seems to cause an error to be thrown in the terminal i launched vsedit from:
[chan] box returned too many bytes: 20
...something like that.

the problem is this error text goes to stdout - the same place my video is going to be picked up by ffmpeg.

as you could imagine, when ffmpeg receives plain text instead of y4m raw video, it gets rather confused, misdetecting the input as lpc or something, and hanging until i hammer ctrl+c

i can work around this by using ffms2 instead of libavsmashsource, but i think maybe smash only needs a small change to repress error text, or vspipe needs a change to put errors to stderr instead of stdout.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 18th August 2016, 09:33   #2  |  Link
Myrsloik
Professional Code Monkey
 
Myrsloik's Avatar
 
Join Date: Jun 2003
Location: Kinnarps Chair
Posts: 2,548
vspipe and vs always writes to stderr by default. Has to be some other part printing things to the wrong place.
__________________
VapourSynth - proving that scripting languages and video processing isn't dead yet
Myrsloik is offline   Reply With Quote
Old 18th August 2016, 11:26   #3  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
that's good to know.

the error (now i'm at a machine i can copypaste it from) that's printing on the terminal is:
[chan] box has more bytes than expected: 40

it's definitely coming out of libavsmashsource, both coming out of vsedit (on every script refresh) and vspipe (confirmed by vspipe straight to console and hitting ctrl+c really quickly before it's overwhelmed by binary).

googling for the above message yields a link to the lsmashworks github, so there is that.

[edit]
it's something coming up with .mov files. i'm not sure if the timecode track is throwing smash off, but this one i'm looking at now (way too big to upload) seems to be failing ffms2 as well.
i'll get to the bottom of this and post back here.

i can get it working if i ffmpeg -i file.mov -c: copy file2.mov, but that's a hell of a lot of faffing for something that's fixable.
__________________
sucking the life out of your videos since 2004

Last edited by Mug Funky; 18th August 2016 at 11:47.
Mug Funky is offline   Reply With Quote
Old 18th August 2016, 12:53   #4  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
Looks like lsmash for some reason unconditionally prints that warning message directly to stdout. Bother VFR-maniac about it, it's pretty dumb for a library to be doing that. It should be printing to stderr, but well behaved libraries should provide an option to suppress output in the first place.

Last edited by TheFluff; 18th August 2016 at 12:55.
TheFluff is offline   Reply With Quote
Old 18th August 2016, 13:04   #5  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
yeah i found that commit but wasn't completely sure what a "good" example of printf to stderr would be (i'm no C programmer).

i gather it's just an argument to printf? that seems like an easy fix. i poked around in the source to find how it handled errors but didn't look too hard.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 18th August 2016, 13:12   #6  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
printf always writes to stdout, if you want to write to stderr you say fprintf(stderr, ...) like if you were writing to a file. The stderr variable comes with stdio.
TheFluff is offline   Reply With Quote
Old 2nd September 2016, 01:46   #7  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
i'm attempting to fix this myself but having trouble building it all.

do i need to have libav installed instead of ffmpeg? i'm getting a "libavresample no such file or directory", which is infuriating because i don't actually want to build audio support given VS does not do audio...
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 4th September 2016, 10:46   #8  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
looks like doing a searchreplace for printf actually fixed it.

the hard part was getting L-SMASHworks to actually build... i do. not. understand. position. independent. code. but made it go eventually. i think ubuntu 16.04 might actually be misconfigured because adding /usr/local/lib to /etc/ld.so.conf.d and re-running ldconfig made everything work.
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Old 4th September 2016, 19:15   #9  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
If it's the "recompile with -fPIC" error message I'm thinking of, it's wildly misleading. What it actually wants you to do is to compile as shared instead of static. See http://stackoverflow.com/questions/1...pile-with-fpic

(I know you figured it out already but posting the answer anyway for the benefit of anyone else who might end up here)
TheFluff is offline   Reply With Quote
Old 5th September 2016, 10:29   #10  |  Link
jackoneill
unsigned int
 
jackoneill's Avatar
 
Join Date: Oct 2012
Location: 🇪🇺
Posts: 760
Quote:
Originally Posted by TheFluff View Post
If it's the "recompile with -fPIC" error message I'm thinking of, it's wildly misleading. What it actually wants you to do is to compile as shared instead of static. See http://stackoverflow.com/questions/1...pile-with-fpic

(I know you figured it out already but posting the answer anyway for the benefit of anyone else who might end up here)
Is that some ARM weirdness? (That link has a question about ARM.) Because in x86(_64) you definitely can compile ffmpeg static and ffms2 or lsmashworks or whatever shared. The "recompile with -fPIC" message means exactly that: you need to recompile ffmpeg with --enable-pic. It doesn't have to be shared.
__________________
Buy me a "coffee" and/or hire me to write code!
jackoneill is offline   Reply With Quote
Old 5th September 2016, 21:00   #11  |  Link
TheFluff
Excessively jovial fellow
 
Join Date: Jun 2004
Location: rude
Posts: 1,100
No, sorry, I meant you need to recompile L-SMASH (not L-SMASH Works) as shared, not ffmpeg. But I think that's wrong too, it's just that if you do that it automatically adds -fPIC to CFLAGS and LDFLAGS. Static with adding -fPIC via --extra-cflags/ldflags would most likely work too, as you say.

Last edited by TheFluff; 5th September 2016 at 21:02.
TheFluff is offline   Reply With Quote
Old 7th September 2016, 02:35   #12  |  Link
Mug Funky
interlace this!
 
Mug Funky's Avatar
 
Join Date: Jun 2003
Location: i'm in ur transfers, addin noise
Posts: 4,555
yep. on my system (ubuntu 16.04 on a VM that i carry around with me... long story), i had to:

- build ffmpeg --enable-static --enable-shared, install
- $sudo su
- $echo /usr/local/lib > /etc/ld.so.conf.d/ffmpeg-pic.conf
- $exit
- $sudo ldconfig

- the rigmarole above was because lsmash would build but ffmpeg wouldn't run in this mode without ldconfig knowing where the libs are, and ubuntu seemed to not point to /usr/local/lib by default. i may have just opened up a gaping security hole, YMMV.

- searchreplace "printf( " for "fprintf( stderr, " in l-smash/core/read.c
- configure --extra-cflags=-fPIC
- sudo make install-lib
- build L-SMASH/Vapoursynth

now the error message comes through stderr and ffmpeg is happy because it isn't getting plaintext in y4m format...
__________________
sucking the life out of your videos since 2004
Mug Funky is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 00:24.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.