You are not logged in.

#1 2018-01-08 12:42:42

aumars
Member
Registered: 2018-01-08
Posts: 23

[SOLVED] How to add support for a codec in MEncoder

I posted a question to SuperUser about an issue where MEncoder fails to process this command

$ mencoder vcd://3 -audio-preload 0.0 -o file.avi -mc 0 -oac copy -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=2000

saying that

-lavcopts is not an MEncoder option

It turns out that it lacks support for libavcodec. How would I add support for a codec in MEncoder in Arch Linux then? I've searched through the Internet and can't find a solution.

Last edited by aumars (2018-01-11 17:38:09)

Offline

#2 2018-01-08 13:27:48

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] How to add support for a codec in MEncoder

mplayer /mencoder is compiled without ffmpeg_a support, you'll have to recompile it, probably without "--disable-ffmpeg_a"
Edit: That was wrong, see my next post.

https://wiki.archlinux.org/index.php/Arch_Build_System

Edit: By the way, if you wish to use libavcodec, you can use the ffmpeg binary directly instead of mencoder.

Last edited by progandy (2018-01-08 20:29:52)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#3 2018-01-08 16:57:20

aumars
Member
Registered: 2018-01-08
Posts: 23

Re: [SOLVED] How to add support for a codec in MEncoder

I have no idea how to use ffmpeg on VCDs unfortunately. Using AVSEQ001.DAT file as input just returns a I/O error. Accessing the internal files of the VCD is almost impossible. The only thing that works is MPlayer when accessing a VCD track. using:

$ mplayer vcd://2

I've tried to build mplayer/mencoder myself, removing "--disable-ffmpeg_a" in PKGBUILD but there's a compile-time error:

libmpcodecs/vd_ffmpeg.c: In function 'control':
libmpcodecs/vd_ffmpeg.c:197:34: error: 'AV_PIX_FMT_XVMC_MPEG2_IDCT' undeclared (first use in this function); did you mean 'AV_PIX_FMT_VAAPI_IDCT'?
             if(avctx->pix_fmt == AV_PIX_FMT_XVMC_MPEG2_IDCT) return CONTROL_TRUE;
                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                  AV_PIX_FMT_VAAPI_IDCT
libmpcodecs/vd_ffmpeg.c:197:34: note: each undeclared identifier is reported only once for each function it appears in

I have all the dependencies installed, maybe I'm missing something?

Last edited by aumars (2018-01-08 16:58:27)

Offline

#4 2018-01-08 18:22:58

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] How to add support for a codec in MEncoder

Hmm, I believe I have misunderstood this option, it only disables linking to a static ffmpeg, but the dynamic link with ffmpeg_so should still be enabled...
I checked again and mencoder is linking to libavcodec.so. Not sure what the problem is yet.

As a workaround you should be able to skip the reencoding and simply copy the original video with "-ovc copy" without any -lavcopts..

Edit: It seems that lavc is currently broken with recent versions of mplayer and ffmpeg:

# source: mplayer svn revision 37998, cfg-mencoder.h

#ifdef CONFIG_FFMPEG
    //{"lavcopts", lavcopts_conf, CONF_TYPE_SUBCONFIG, CONF_GLOBAL, 0, 0, NULL}, //TODO: ve_lavc doesn't build after latest FFmpeg major bumps
#else
    {"lavcopts", "MPlayer was compiled without libavcodec. See README or DOCS.\n", CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL},
#endif /* CONFIG_FFMPEG */

Edit: It should work again with mplayer/mencoder revision 38015 which is not in the arch repositories yet. You can change the version number in the PKGBUILD and build it though. (do not remove --disable-ffmpeg_a)

Last edited by progandy (2018-01-08 19:16:04)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#5 2018-01-08 19:35:38

aumars
Member
Registered: 2018-01-08
Posts: 23

Re: [SOLVED] How to add support for a codec in MEncoder

It does run if I use "-ovc copy"

$ mencoder vcd://3 -audio-preload 0.0 -o file.avi -mc 0 -oac copy -ovc copy vcodec=mpeg4:vbitrate=2000

Unfortunately, it crashes my system completely after a couple of seconds. I've posted a similar issue on SuperUser.

Someone replied to my question and suggests that this is a kernel bug, a "serious" one.

Last edited by aumars (2018-01-08 21:49:55)

Offline

#6 2018-01-08 20:16:38

teckk
Member
Registered: 2013-02-21
Posts: 519

Re: [SOLVED] How to add support for a codec in MEncoder

That's one of those hybrid video disks that never caught on too much.

I haven't used mencoder for years. What are you trying to do? Dump a VCD to file?

Accessing the internal files of the VCD is almost impossible.

I think that those are tracks like a CD aren't they?

The only thing that works is MPlayer when accessing a VCD track. using

If you can play it then you can dump it.

That's compressed mpeg1 video, and mp2 audio I think. I don't have one.
Can you dump that with

mplayer vcd://2 -dumpstream -dumpfile file.mpeg

or

mpv vcd://2 --stream-dump=file.mpeg

I think that you can also make an .iso out of that with dd

dd if=dev/sr0 of=VCDfile.iso

Are you trying to re-encode that into mp4?
Find out what video and audio the video has and go from there

ffprobe file.mpeg

First things first, dump the video to file.

Offline

#7 2018-01-08 21:48:58

aumars
Member
Registered: 2018-01-08
Posts: 23

Re: [SOLVED] How to add support for a codec in MEncoder

$ mplayer vcd://2 -dumpstream -dumpfile file.mpeg

crashes my system at 18.3% (it worked somewhat at least), which is what happened with the command I used prior to your reply.

$ mpv vcd://2 --stream-dump=file.mpeg

returns

Playing: vcd://2
No protocol handler found to open URL vcd://2
The protocol is either unsupported, or was disabled at compile-time.

I installed mpv through yaourt as with any other package.

I tried using dd before:

dd if=dev/sr0 of=VCDfile.iso

doesn't work, spits out a I/O error.

I've tried copying AVSEQ001.DAT directly, it doesn't work.

Offline

#8 2018-01-09 01:00:07

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] How to add support for a codec in MEncoder

If you are up to using wine and a windows program you could give isobuster a try, I have used it (under windows) not too long ago exactly to extract the mpeg2 streams of a videocd.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2018-01-09 08:19:42

aumars
Member
Registered: 2018-01-08
Posts: 23

Re: [SOLVED] How to add support for a codec in MEncoder

I just installed ISOBuster. I've tried all options but I've only been able to extract 30 seconds of video filtering MPEG frames. The rest doesn't extract hte data, just makes an empty file.

Last edited by aumars (2018-01-09 08:20:11)

Offline

#10 2018-01-09 13:28:46

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: [SOLVED] How to add support for a codec in MEncoder

I don't have any other ideas, for me isobuster did the trick using the option to filter mpeg frames. Are you sure that videocd is working properly? Try to play it with vlc and check if it works there, if it doesn't work with vlc then I'd say either the videocd is broken or there is some kind of protection.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#11 2018-01-09 13:37:50

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] How to add support for a codec in MEncoder

I am out of ideas, too. You could try vcdxrip from the vcdimager package, but I doubt that you will get a different result than using mplayer with dumpstream.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#12 2018-01-09 17:20:42

aumars
Member
Registered: 2018-01-08
Posts: 23

Re: [SOLVED] How to add support for a codec in MEncoder

I can't play it with VLC, it just fails to read it.

I'm intrigued though how dumping the data from the VCD crashes my entire system forcing me to force-shutdown.

Offline

#13 2018-01-09 17:27:59

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] How to add support for a codec in MEncoder

Did you try the linux-lts kernel or downgrading the linux kernel?


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#14 2018-01-09 17:34:45

teckk
Member
Registered: 2013-02-21
Posts: 519

Re: [SOLVED] How to add support for a codec in MEncoder

I've never had a VCD. My only other suggestion would be to check for different tracks, mplayer vcd:// vcd://1 vcd://2 etc.

As other have said, maybe the disk is scratched, damaged. If it is scratched then a little toothpaste and damp cloth can sometimes buff the scratch out and make a disk playable. Done that lots of times with DVD's from a mail delivery company.

According to what I read, AVSEQ1.DAT files are a mpeg1 file with a .dat extension.

crashes my system at 18.3%

What do you mean that it crashes your system? The machine locks up, or mplayer stops dumping and exits? If your machine locks up then you've got something else wrong. If mplayer dies and exits then likely the disk is bad.
I looked a bit more and...VCD's have tracks on them. If mplayer won't dump the whole track then
the disk is bad
the file is protected somehow
the track is only part of the video, you may need more than 1 track, then put them together.

You may find that this is a waste of time for not much. VCD's have about the video quality of VHS tapes. Not too good. Might be easier-better to get a current DVD and dump it.

Good luck. Post back what you find was wrong if you are able to dump it.

I'm intrigued though how dumping the data from the VCD crashes my entire system forcing me to force-shutdown.

Ok I see your last post now. It should not. Have you installed everything from repo or do you have an aur/source version of mplayer-ffmpeg installed?

I'm not having any problems with mplayer or ffmpeg locking the machine up. You may want to address that first.

Offline

#15 2018-01-11 16:02:49

aumars
Member
Registered: 2018-01-08
Posts: 23

Re: [SOLVED] How to add support for a codec in MEncoder

It's a faulty VCD.

I dumped the video file from another VCD and it worked flawlessly. Thank you @teckk for

$ mplayer vcd://2 -dumpstream -dumpfile file.mpeg

by the way.

I'l address the issue that MEncoder locks my machine in an issue ticket but unfortunately I don't have any debugging information, even using valgrind since it just freezes abruplty, but that's for another thread.

Mark this solved.

Offline

#16 2018-01-11 16:26:32

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] How to add support for a codec in MEncoder

aumars wrote:

Mark this solved.

Go on then...
https://wiki.archlinux.org/index.php/Co … ow_to_post


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

Board footer

Powered by FluxBB