Log in

View Full Version : L-SMASH Source


Pages : 1 2 3 4 [5] 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34

fvisagie
28th May 2014, 14:46
does LWLibavVideoSource export useful global variables like FFMS2 (SAR, matrix, tv/pc range, cfr & vfr time) ?

I strongly support the addition of global variables. In my case specifically, a variable to identify the current source file at runtime. It would enable logging scene changes when concatenating source files (http://forum.doom9.org/showthread.php?p=1681933#post1681933), needed to work around memory usage issues (http://forum.doom9.org/showthread.php?p=1681983#post1681983) when using L-SMASH Source.

Thanks,
Francois

Music Fan
7th June 2014, 14:31
r726 ;
https://drive.google.com/folderview?id=0BwV03nn6LPd9OXJUWVVMMXZmNUU&usp=sharing

Extract of changelog ;
r726: git-7a8d8a7 [2014-05-22] lwmuxer: Stop using deprecated movie parameters.
r725: git-92d69d8 [2014-05-14] Bump copyright years to 2014.
r724: git-7c1dddb [2014-05-13] lwlibav_audio: Fix memory leak of audio frame list.
r723: git-e4ca061 [2014-05-12] lwindex: Fix handling of file path.
r722: git-5d5add8 [2014-05-12] libavsmash: Fix compilation error on debug build.
r721: git-c9c67e6 [2014-05-08] lwindex: Override stream with AV_DISPOSITION_ATTACHED_PIC
r720: git-3548f58 [2014-05-03] lwmuxer: Use new I/O APIs.
r719: git-8e176da [2014-05-03] lwdumper: Use new I/O APIs.
r718: git-d0e0961 [2014-05-02] libavsmash: Use new I/O APIs.
r717: git-0c4d9df [2014-04-11] lwindex: Don't treat as field coded picture if picture seems corrupted.
r716: git-2242b10 [2014-04-08] libavsmash: More QuickTime Audio support.
r715: git-4ada105 [2014-04-05] lsmashsource: Fix stack mode when AVX2 instructions are available.
r714: git-f8890ff [2014-02-17] utils: Limit framerate numerator strictly up to INT32_MAX.
r713: git-dd17b77 [2014-02-14] video: Fix 10L introduced in 2aa7ba260d .
r712: git-1612126 [2014-02-14] video: Improve average framerate calculation more.

Reel.Deel
13th June 2014, 23:29
I recently added LSMASHSource to the wiki (http://avisynth.nl/index.php/LSMASHSource) (with VFR maniac's consent) and I would like to add additional information since the included readme seems a little vague (at least to me).
I searched this thread for useful information and so far I have this:


L-SMASH Works depends on liblsmash, libavutil, libavcodec, libavformat, libswscale and libavresample.

I added supporting of a hack of high bit-depth input between rev594 and rev603.
For interleaved format (at default), only little endianness output is supported currently i.e. LSB comes at the first byte and MSB comes at the second.
Stacked format is also available but direct rendering is always not available if used.


LSMASH*Source() is for MOV, ISO Base Media and its derived file formats.
LSMASH*Source() uses libavformat only for the first decoder initialization, and demuxes streams by using L-SMASH demuxer API.

Apple ProRes?
Haha, I guess the strange output from LWLibavVideoSource is high bit-depth interleaved format.
You may feel FFMS2 outputs correctly but, the fact, the output loses accuracy around 2-bit for each Y'CbCr component.
Try format="YUV422P8" or stacked=true.

Edit and Note: currently libavcodec ProRes decoder supports only Y'CbCr 4:2:2 10-bit and 4:4:4 10-bit format with or without alpha channel.
Therefore, LWLibavVideoSource(source="ProRes") always output in interleaved format unless user specifies output format.
And even if ProRes4444 (12-bit) is input, the default output format will be Y'CbCr 4:4:4 10-bit with alpha.

Libavcodec decoders output by such format; [LSB 8 | zero 6 | MSB 2] for 10-bit Y'CbCr.
As the default, the postprocessor after decoding works as just copying data delivered from decoder into the AviSynth video buffer.
Basically I believe that data shall not be modified unless user, decoder or demuxer specifies.
10->16 change may add something of dither instead of simple bit-shifting.

Use format="YUV4**P16" if you need the format [LSB 8 | MSB 8].

Besides, LSMASH*Source has the advantage over LWLibav*Source that it doesn't need to create index file for supported formats.

Anyone know of any other advantages/disadvantages and or any other limitations of LSMASHSource?

----

One more thing, the readme list all supported video formats but for 12 and 14-bit formats it says 'ffmpeg only', what does that really mean?

Example:
"YUV422P10"
"YUV444P10"
"YUV420P12" (ffmpeg only)
"YUV422P12" (ffmpeg only)
"YUV420P14" (ffmpeg only)
"YUV422P14" (ffmpeg only)
"YUV420P16"
"YUV422P16"

Any insight will be appreciated.

VFR maniac
14th June 2014, 00:05
One more thing, the readme list all supported video formats but for 12 and 14-bit formats it says 'ffmpeg only', what does that really mean?


Libav's libavutil and libswscale have no support of 12 and 14-bit formats.
These formats may or may not be supported by libav in the future.

qyot27
14th June 2014, 00:07
Edit: already answered.


One more thing, the readme list all supported video formats but for 12 and 14-bit formats it says 'ffmpeg only', what does that really mean?

Example:
"YUV422P10"
"YUV444P10"
"YUV420P12" (ffmpeg only)
"YUV422P12" (ffmpeg only)
"YUV420P14" (ffmpeg only)
"YUV422P14" (ffmpeg only)
"YUV420P16"
"YUV422P16"
Any insight will be appreciated.
It means that if you want support for 12-bit and 14-bit pixel formats, you need to build against FFmpeg.

http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libavutil/pixfmt.h

http://git.libav.org/?p=libav.git;a=blob;f=libavutil/pixfmt.h

Compare: only FFmpeg contains those pixel format markers. Libav doesn't.

Reel.Deel
14th June 2014, 00:20
Thanks for the quick response VFR maniac and qyot27. :)

So if you load any 12/14-bit source will it be truncated to 10-bits?

@VFR maniac

One more thing:

10->16 change may add something of dither instead of simple bit-shifting.

Does that mean if you have a 10-bit source and force it to stack16 (stacked=true, format="YUVXXXP16") it will be dithered to 16-bits rather than just shifting the bits? You said may add dither so I'm not sure.

VFR maniac
14th June 2014, 00:54
I don't know so deep about the internal behaviour of libswscale, but at least ffmpeg's libswscale has options about dither and set to auto by default.
http://git.videolan.org/?p=ffmpeg.git;a=blob;f=libswscale/options.c

Libav's libswscale has no options about dither.
https://git.libav.org/?p=libav.git;a=blob;f=libswscale/options.c

Reel.Deel
14th June 2014, 01:27
ok, thanks for the answer VFR maniac.

If anyone knows a bit more on this matter please share.

fvisagie
14th June 2014, 10:37
Thanks for this initiative, Reel.Deel :thanks:

Daemon404
14th June 2014, 17:43
So if you load any 12/14-bit source will it be truncated to 10-bits?

Only if built with FFmpeg.

Does that mean if you have a 10-bit source and force it to stack16 (stacked=true, format="YUVXXXP16") it will be dithered to 16-bits rather than just shifting the bits? You said may add dither so I'm not sure.

It will be bitshifted, unless there is no direct path between formats, then all bets are off. yuvXXXp10 -> yuvXXXp16 should just be a bitshift in swscale.

Reel.Deel
17th June 2014, 04:25
@Daemon404

Thanks for the info.

---------

@everyone

r728 is available (https://drive.google.com/folderview?id=0BwV03nn6LPd9OXJUWVVMMXZmNUU&usp=sharing) - Support for RGB32 and Y8 in Avisynth.

qupfer
6th July 2014, 11:12
@everyone

r728 is available (https://drive.google.com/folderview?id=0BwV03nn6LPd9OXJUWVVMMXZmNUU&usp=sharing) - Support for RGB32 and Y8 in Avisynth.

Thanks,

but google says, I need permission, so I cliked on Request access (two times :o). Will this be enough or I have to do additional things?

Music Fan
6th July 2014, 12:30
@everyone

r728 is available (https://drive.google.com/folderview?id=0BwV03nn6LPd9OXJUWVVMMXZmNUU&usp=sharing) - Support for RGB32 and Y8 in Avisynth.
This link don't work anymore, is there another server for r728 ?

filler56789
6th July 2014, 13:12
Geez, this is the error message G00gle Drive gave me:

You need permission

Want in? Ask the owner for access, or switch to an account with permission. Learn more (https://support.google.com/drive/answer/53355?hl=en)

You are signed in as ***.***@gmail.com.

Seriously, I think open-source doesn't go well with unreasonable access restrictions.

filler56789
6th July 2014, 13:59
For the time being, r728 is available at:

http://www.mediafire.com/download/m8fa458q8zzjuae/L-SMASH-Works_r728-g34b1526.7z

Reel.Deel
6th July 2014, 14:12
Here's a direct download for r728: [Dropbox (https://dl.dropbox.com/s/u7qdfhukuq24fdo/L-SMASH-Works_r728-g34b1526.7z)]

FWIW here's the build script for L-SMASH Works (https://github.com/nak5124/build_env/blob/master/buildscripts/lsw.sh).

Music Fan
6th July 2014, 14:18
Thanks.

qupfer
8th July 2014, 13:42
Hi Guys,

I have a MeGui-Generated avs-File for the audio-stream of a tv-recording.
LWLibavAudioSource("Path\to\Movie.ts", stream_index=1)

With with tool(s) can I play/decode it? (except MeGui)
ffmpeg doesn't do it. (and its compiled with --enable-avisynth)

Groucho2004
8th July 2014, 13:44
Hi Guys,

I have a MeGui-Generated avs-File for the audio-stream of a tv-recording.
LWLibavAudioSource("Path\to\Movie.ts", stream_index=1)

With with tool(s) can I play/decode it? (except MeGui)
ffmpeg doesn't do it. (and its compiled with --enable-avisynth)
Post the complete script. You should be able to open/run the script in MPC or VirtualDub.

ffmpeg doesn't do it.
Somehow I doubt that this is the error message you get from ffmpeg. :rolleyes:

qupfer
8th July 2014, 13:56
Thanks,
okay the complete script


LoadPlugin("D:\Users\Henning\Dropbox\MeGUI\tools\lsmash\LSMASHSource.dll")
LWLibavAudioSource("E:\convert\temp\test.ts", stream_index=1)
# detected channels: 2 channels
# detected channel positions: 2/0/0



ffplay output:


ffplay version N-64495-g154954c Copyright (c) 2003-2014 the FFmpeg developers
built on Jul 8 2014 00:30:36 with gcc 4.8.2 (GCC)
configuration: --arch=x86_64 --target-os=mingw32 --cross-prefix=/home/username/sandbox/mingw-w64-x86_64/bin/x86_64-w64-mingw32- --pkg-config=pkg-config --enable-gpl --enable-libx264 --enable-avisynth [...]
libavutil 52. 91.100 / 52. 91.100
libavcodec 55. 68.101 / 55. 68.101
libavformat 55. 45.100 / 55. 45.100
libavdevice 55. 13.101 / 55. 13.101
libavfilter 4. 10.100 / 4. 10.100
libswscale 2. 6.100 / 2. 6.100
libswresample 0. 19.100 / 0. 19.100
libpostproc 52. 3.100 / 52. 3.100
nan : 0.000 fd= 0 aq= 0KB vq= 0KB sq= 0B f=0/0
E:\convert\temp\test.avs: Unknown error occurred

Groucho2004
8th July 2014, 13:58
LoadPlugin("D:\Users\Henning\Dropbox\MeGUI\tools\lsmash\LSMASHSource.dll")
LWLibavAudioSource("E:\convert\temp\test.ts", stream_index=1)
# detected channels: 2 channels
# detected channel positions: 2/0/0

Open the script in VirtualDub and post the error message (if any).

qupfer
8th July 2014, 14:01
Open the script in VirtualDub and post the error message (if any).


Vdub says: Video has no video stream :rolleyes: but I found the problem (and solution).

I mixed up with the architectures. Avisynth 32bit, ffmpeg 64bit. If I use a 32bit ffmpeg, all fine. :thanks:

LigH
8th July 2014, 14:05
The output won't have a video stream, only tools which can handle audio-only AviSynth output as their input (e.g. avs2wav / wavi / avs2pipemod, and MeGUI's audio conversion part) may accept it.

And yes, keeping the same architecture is a prerequisite.

foxyshadis
8th July 2014, 22:01
If that's all you need, Avisynth(+) and L-SMASH are both available in 64-bit. Transitioning to 64-bit with its speed increases is quite possible.

burfadel
28th July 2014, 06:29
Any newer builds?

Brazil2
28th July 2014, 10:03
Any newer builds?
And GCC binaries of L-Smash (muxer, remuser, etc) which will run on XP as well, since they seem not to be available from http://otsukemono.blogspot.jp anymore and the Google drive he used is down :(

I wonder why it's so hard to find binaries of this project.

bennynihon
30th July 2014, 22:27
When I try using LSMASHVideoSource I get "System Exception - Access Violation". This is the case for both x86 and x64 builds. LWLibavVideoSource, which uses the lilbavformat as the demuxer, works fine. This is using the r278 build from the links above. Any ideas why this is? Does this have anything to do with the msvcr120.dll included in the package? Am I supposed to place that in the System32 directory? Looks as though I already have msvcr120.dll in both System32 and SysWOW64

LigH
31st July 2014, 08:38
LSMASHVideoSource is only suitable for MP4 and similar ISO-MOV based container sources. Do not use it with any other container format.

Do not rely on any included MSVCR*.DLL; instead, rather install the Microsoft Visual C++ Runtime for 32 bit (and possibly also for 64 bit if you have a 64 bit Windows 7+), this will ensure that the appropriate version of several DLLs will be installed to the matching version of the system32 directory (depending on 32 or 64 bit runtime, and 32 or 64 bit OS; furthermore, MSVCR###.DLL is not the only required DLL).

bennynihon
31st July 2014, 17:09
thanks. yeah, I am using the msvcr*.dll files from the VC++ redistributables.

Reel.Deel
1st August 2014, 01:20
LSMASHVideoSource is only suitable for MP4 container sources. Do not use it with any other container format.
VFR maniac says differently :)
LSMASH*Source() is for MOV, ISO Base Media and its derived file formats (http://en.wikipedia.org/wiki/ISO_base_media_file_format).

I've successfully opened .mov from my DSLRs, .mp4/mov from multiple camera phones, .m4v and .mov from iTunes, and .3gp from my ancient phone. Additionally, Apple has sample files for download (http://support.apple.com/kb/ht1425) and LSMASHVideoSource works for all of them except for sample_mpeg2.m2v and sample_sorenson.mov.

foxyshadis
1st August 2014, 02:01
Those are all essentially the same format. MP4 is mostly a subset of MOV, and 3GP/3G2 are subsets of MP4. You could say that L-SMASH is only for MP4-like containers.

Reel.Deel
1st August 2014, 02:18
Yeah you're right, I just wanted to clarify (for future readers). Saying 'LSMASHVideoSource is only suitable for MP4 container...' is kinda misleading.

LigH
1st August 2014, 09:14
Well, yes, sorry, I always forget that "MP4" is a too strict restriction. But I take MOV not much more serious than AVI for personal reasons, would always recommend the "intentionally best matching container for the content"... ;)

Brazil2
1st August 2014, 11:57
Erm, cough, does anyone know where to find up to date binaries of L-Smash (not Works but muxer, remuxer, etc) which will run on XP ? Preferably GCC compiled.

burfadel
1st August 2014, 12:33
Unfortunately without up to date and properly compiled binaries (ones that aren't slow), L-SMASH Works could end up 'dying' like so many other great projects. Why you may ask? Well, quite simply if people can't download it they can't use it! Also, many are turned away if there is a significant time between builds. Realistically it needs a 'daily' build, like MPC-HC gets. Sure, there may be a week or two between commits, but that doesn't matter, the nightly build only needs updating when new commits are made. The same probably can be said for FFMpegSource, since they, in many ways, compliment each other.

Kurtnoise
1st August 2014, 12:46
Erm, cough, does anyone know where to find up to date binaries of L-Smash (not Works but muxer, remuxer, etc) which will run on XP ? Preferably GCC compiled.

- l-smash x86 (http://www.mediafire.com/download/jt6ffwhccrrn1yr/l-smash_x86_20140801.7z)
- l-smash x64 (http://www.mediafire.com/download/9kb218lm1om6iih/l-smash_x64_20140801.7z)

Brazil2
1st August 2014, 13:28
- l-smash x86 (http://www.mediafire.com/download/jt6ffwhccrrn1yr/l-smash_x86_20140801.7z)
- l-smash x64 (http://www.mediafire.com/download/9kb218lm1om6iih/l-smash_x64_20140801.7z)
Thanks a lot! :)

burfadel
2nd August 2014, 00:21
- l-smash x86 (http://www.mediafire.com/download/jt6ffwhccrrn1yr/l-smash_x86_20140801.7z)
- l-smash x64 (http://www.mediafire.com/download/9kb218lm1om6iih/l-smash_x64_20140801.7z)

Any possibilities of being the new L-SMASH Works build guy? lol, thanks :).

Kurtnoise
4th August 2014, 09:39
I can provide l-smash builds as requested from time to time but not l-smash-work because it's a pain to compile (at least for me)...

burfadel
4th August 2014, 11:54
Ah ok :). I would compile it myself but have had issues compiling in the past as well. Thought it was just me :D.

masterkivat
9th August 2014, 11:05
The usual guy from where I was downloading "l-smash works" (yet other binaries like custom x264 builds) stopped (http://otsukemono.blogspot.jp/), it's a shame.
Hope that more people get interest in sharing their own compiled versions, which is something that I don't master :D

burfadel
10th August 2014, 01:07
The usual guy from where I was downloading "l-smash works" (yet other binaries like custom x264 builds) stopped (http://otsukemono.blogspot.jp/), it's a shame.
Hope that more people get interest in sharing their own compiled versions, which is something that I don't master :D

Yeah, quickest way for a project to die is the unavailability of binaries. If people can't get binaries they can't use it!

the_weirdo
11th August 2014, 11:16
You can get my L-SMASH-Works builds here (https://www.dropbox.com/sh/3i81ttxf028m1eh/AAABkQn4Y5w1k-toVhYLasmwa?dl=0). Require Visual C++ Redist 2013 (32-bit (http://go.microsoft.com/?linkid=9832156), 64-bit (http://go.microsoft.com/?linkid=9832146)) and Windows Vista or later.

Also my L-SMASH builds can be found here (https://www.dropbox.com/sh/7jjrz5i4wcxhf49/AADZlN98OhKAvLHVwfaXYK4da?dl=0).

LigH
11th August 2014, 14:47
:thanks: for maintaining their availability.

masterkivat
12th August 2014, 04:51
:thanks:, "weirdo"-san. :D

bennynihon
12th August 2014, 06:52
Is there a way to mux in a subtitle track using the L-Smash muxer? What about setting one of two audio tracks as the default track? Thanks

burfadel
13th August 2014, 04:14
Here are my builds:
L-SMASH Works r729 32-bit (https://dl.dropboxusercontent.com/u/18695757/L-SMASH-Works-r729-32bit.7z)
L-SMASH Works r729 64-bit (https://dl.dropboxusercontent.com/u/18695757/L-SMASH-Works-r729-64bit.7z)
Require Visual C++ Redist 2013 (32-bit (http://go.microsoft.com/?linkid=9832156), 64-bit (http://go.microsoft.com/?linkid=9832146))

Thanks, very much appreciated!

gnol009
27th August 2014, 06:03
Any chance for FFinfo() in FFMS2.avsi can work with LWLibavVideoSource()?

LigH
27th August 2014, 08:56
Probably only if L-SMASH Works would expose similar internal variables as FFMS2. The support has to start in the plugin DLL.

Reel.Deel
8th September 2014, 14:40
@Selur

Can you please update the links in the first post with the link here (http://forum.doom9.org/showpost.php?p=1689573&postcount=250). And also make it clickable :)