Does mencoder provide any way to cut out sections of video? In particular, I just got a Hauppauge WinTV PVR 150 and after a few hours struggling to get the audio working, I was able to do some captures from my TiVo and came up with an encoding script that does a very nice job. Now I just need to be able to trim out the commercials. I played around with VirtualDub (in Windows) which makes it very easy to edit the video. Unfortunately it won't work directly with the mpg file. I need to encode to an AVI first (or else let VirtualDub do the encoding itself which I don't want it to do). It supports stream copying, but it doesn't seem to support creating key frames. Thus, I end up with cuts where I don't want them or really nasty video at the cuts I see MPlayer has the Edit Decision List, but it looks like MEncoder doesn't have an equivalent, or if it does, I missed it. At the very least, if there's a way for me to specify where to create key frames, that would at least let me do clean edits with VirtualDub. Is there another app I should be using? I hate to use more tools than I need. I want to stick with mencoder for the actual encoding because it does such a nice job and I'm getting more comfortable with it. Thanks.
Hi, First of all, please do not send HTML mails to this list. It makes people unhappy :-( On 6/24/05, Pete Davis <pete@petedavis.net> wrote:
Does mencoder provide any way to cut out sections of video?
In particular, I just got a Hauppauge WinTV PVR 150 and after a few hours struggling to get the audio working, I was able to do some captures from my TiVo and came up with an encoding script that does a very nice job.
Now I just need to be able to trim out the commercials.
I played around with VirtualDub (in Windows) which makes it very easy to edit the video. Unfortunately it won't work directly with the mpg file. I need to encode to an AVI first (or else let VirtualDub do the encoding itself which I don't want it to do). It supports stream copying, but it doesn't seem to support creating key frames. Thus, I end up with cuts where I don't want them or really nasty video at the cuts
I see MPlayer has the Edit Decision List, but it looks like MEncoder doesn't have an equivalent, or if it does, I missed it.
I haven't used EDL, but as far as I can tell, it works the exact same way for MEncoder and MPlayer. Just try it! :-) Guillaume -- A woman isn't complete without a man. But where do you find a man - a real man - these days? -- Lauren Bacall My answer: Only at #mplayerdev on the freenode IRC network.
Sorry about the HTML. I didn't intend to send an HTML message. Stupid Outlook. Actually, I tried before I posted which is why I posted. It gives me an "error parsing cmdline" if I pass -edl edit.edl in the command line. My actual mencoder commands are: mencoder myfile.mpg -oac mp3lame -lameopts cbr:br=128 -o /dev/null -vf pullup,pp=md -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=1:vqmin=2:vqmax=31 -edl edit.edl - mencoder myfile.mpg -oac mp3lame -lameopts cbr:br=128 -o newfile.avi -vf pullup,pp=md -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=2:vqmin=2:vqmax=31 -edl edit.edl - I tried placing the -edl right after the filename as well as where it is now to see if location in the command line was important. I'm open to suggestions. Pete
-----Original Message----- From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Guillaume POIRIER Sent: Friday, June 24, 2005 11:39 AM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
Hi,
First of all, please do not send HTML mails to this list. It makes people unhappy :-(
On 6/24/05, Pete Davis <pete@petedavis.net> wrote:
Does mencoder provide any way to cut out sections of video?
In particular, I just got a Hauppauge WinTV PVR 150 and after a few
hours
struggling to get the audio working, I was able to do some captures from my TiVo and came up with an encoding script that does a very nice job.
Now I just need to be able to trim out the commercials.
I played around with VirtualDub (in Windows) which makes it very easy to edit the video. Unfortunately it won't work directly with the mpg file. I need to encode to an AVI first (or else let VirtualDub do the encoding itself which I don't want it to do). It supports stream copying, but it doesn't seem to support creating key frames. Thus, I end up with cuts where I don't want them or really nasty video at the cuts
I see MPlayer has the Edit Decision List, but it looks like MEncoder doesn't have an equivalent, or if it does, I missed it.
I haven't used EDL, but as far as I can tell, it works the exact same way for MEncoder and MPlayer. Just try it! :-)
Guillaume -- A woman isn't complete without a man. But where do you find a man - a real man - these days? -- Lauren Bacall My answer: Only at #mplayerdev on the freenode IRC network.
_______________________________________________ MEncoder-users mailing list MEncoder-users@mplayerhq.hu http://mplayerhq.hu/mailman/listinfo/mencoder-users
On Fri, Jun 24, 2005 at 12:26:27PM -0500, Pete Davis wrote:
Sorry about the HTML. I didn't intend to send an HTML message. Stupid Outlook.
Actually, I tried before I posted which is why I posted.
It gives me an "error parsing cmdline" if I pass -edl edit.edl in the command line.
Update your MEncoder. as of MEncoder 1.0pre7, mencoder supports -edl . There's also another option you might be interested in, -hr-edl-seek , which allows MEncoder to cut and non-keyframe boundries. Obviously, _only_ if you re-encode the entire video. It does still work with -ovc copy, but not gracefully. So: mencoder capture.avi -ovc lavc -edl cuts.edl -hr-edl-seek -o output.avi Also, just as a sidenote, order of options doesn't matter if you have only one file unless you're overriding options.
On Fri, Jun 24, 2005 at 12:26:27PM -0500, Pete Davis wrote:
Sorry about the HTML. I didn't intend to send an HTML message. Stupid Outlook.
Actually, I tried before I posted which is why I posted.
It gives me an "error parsing cmdline" if I pass -edl edit.edl in the command line.
Update your MEncoder. as of MEncoder 1.0pre7, mencoder supports -edl . There's also another option you might be interested in, -hr-edl-seek , which allows MEncoder to cut and non-keyframe boundries. Obviously, _only_ if you re-encode the entire video. It does still work with -ovc copy, but not gracefully. So:
mencoder capture.avi -ovc lavc -edl cuts.edl -hr-edl-seek -o output.avi
Also, just as a sidenote, order of options doesn't matter if you have only one file unless you're overriding options.
Okay, upgraded to 1.0pre7 but now I'm getting a video_out device problem. I don't recall running into any issues with pre6 out of the box. Just did a ./configure, make, and make install and I was going. That doesn't appear to be the case here. Anyway, here's the output from the first pass attempt: TIA Pete MEncoder 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team CPU: Intel Pentium 4/Xeon/Celeron Northwood (Family: 8, Stepping: 4) Detected cache-line size is 64 bytes CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2 File not found: 'frameno.avi' Failed to open frameno.avi success: format: 0 data: 0x0 - 0xb8789fc0 MPEG-PS file format detected. VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 9600.0 kbps (1200.0 kbyte/s) [V] filefmt:2 fourcc:0x10000002 size:720x480 fps:29.97 ftime:=0.0334 ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000) Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3) ========================================================================== Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1 (-1=autodetect) osd: 1 Opening video filter: [pp=md] Opening video filter: [pullup] ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
On Fri, Jun 24, 2005 at 02:00:15PM -0500, Pete Davis wrote:
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b
There's nothing wrong here, this is standard output from MPlayer/Mencoder when opening an MPEG file when you don't have a hardware MPEG card. Is this the entire output? show -v. show the command line. Nico Sabbi wrote:
using avidemux2 is much easier :)
Didn't he mention he's using windows? :) AFAIK avidemux2 doesn't work (easily) on windows.. - ods15
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:08 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
On Fri, Jun 24, 2005 at 02:00:15PM -0500, Pete Davis wrote:
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2- v0.4.0b
There's nothing wrong here, this is standard output from MPlayer/Mencoder when opening an MPEG file when you don't have a hardware MPEG card. Is this the entire output? show -v. show the command line.
Sorry. Here's the whole output from the first encoding pass. Obviously the Segmentation fault is a bad sign. I tried it without the -edl parameters which is exactly the way it was working before under pre6 and I still get the same segmentation fault. MEncoder 1.0pre7-3.4.2 (C) 2000-2005 MPlayer Team CPU: Intel Pentium 4/Xeon/Celeron Northwood (Family: 8, Stepping: 4) Detected cache-line size is 64 bytes CPUflags: Type: 8 MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1 Compiled for x86 CPU with extensions: MMX MMX2 SSE SSE2 File not found: 'frameno.avi' Failed to open frameno.avi success: format: 0 data: 0x0 - 0xb8789fc0 MPEG-PS file format detected. VIDEO: MPEG2 720x480 (aspect 2) 29.970 fps 9600.0 kbps (1200.0 kbyte/s) [V] filefmt:2 fourcc:0x10000002 size:720x480 fps:29.97 ftime:=0.0334 ========================================================================== Opening audio decoder: [mp3lib] MPEG layer-2, layer-3 AUDIO: 48000 Hz, 2 ch, s16le, 384.0 kbit/25.00% (ratio: 48000->192000) Selected audio codec: [mp3] afm:mp3lib (mp3lib MPEG layer-2, layer-3) ========================================================================== Opening video filter: [expand osd=1] Expand: -1 x -1, -1 ; -1 (-1=autodetect) osd: 1 Opening video filter: [pp=md] Opening video filter: [pullup] ========================================================================== Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2-v0.4.0b Selected video codec: [mpeg12] vfm:libmpeg2 (MPEG-1 or 2 (libmpeg2)) ========================================================================== MP3 audio selected Building audio filter chain for 48000Hz/2ch/s16le -> 48000Hz/2ch/s16le... Writing AVI header... ODML: Aspect information not (yet?) available or unspecified, not writing vprp h eader. Read 5 EDL actions. VDec: vo config request - 720 x 480 (preferred csp: Planar YV12) [PP] Using external postprocessing filter, max q = 6. VDec: using Planar YV12 as output csp (no 0) Movie-Aspect is 1.33:1 - prescaling to correct movie aspect. videocodec: libavcodec (720x480 fourcc=34504d46 [FMP4]) High quality encoding selected (non real time)! /home/pdavis/bin/capencode: line 8: 16725 Segmentation fault mencoder $1 -o ac mp3lame -lameopts cbr:br=128 -o /dev/null -vf pullup,pp=md -ovc lavc -lavcopt s vcodec=mpeg4:vbitrate=900:mbd=2:vpass=1:vqmin=2:vqmax=31 -edl edit.edl -hr-edl -seek -
On Fri, Jun 24, 2005 at 02:19:54PM -0500, Pete Davis wrote:
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:08 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
On Fri, Jun 24, 2005 at 02:00:15PM -0500, Pete Davis wrote:
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2- v0.4.0b
There's nothing wrong here, this is standard output from MPlayer/Mencoder when opening an MPEG file when you don't have a hardware MPEG card. Is this the entire output? show -v. show the command line.
Sorry. Here's the whole output from the first encoding pass. Obviously the Segmentation fault is a bad sign. I tried it without the -edl parameters which is exactly the way it was working before under pre6 and I still get the same segmentation fault.
OK, seems you found a bug (in my code..), could you send a small sample, your EDL, and atleast for once, the entire command line? It keeps getting cut. - ods15
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:28 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:08 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
On Fri, Jun 24, 2005 at 02:00:15PM -0500, Pete Davis wrote:
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2- v0.4.0b
There's nothing wrong here, this is standard output from MPlayer/Mencoder when opening an MPEG file when you don't have a hardware MPEG card. Is this the entire output? show -v. show the command line.
Sorry. Here's the whole output from the first encoding pass. Obviously
On Fri, Jun 24, 2005 at 02:19:54PM -0500, Pete Davis wrote: the
Segmentation fault is a bad sign. I tried it without the -edl parameters which is exactly the way it was working before under pre6 and I still get the same segmentation fault.
OK, seems you found a bug (in my code..), could you send a small sample, your EDL, and atleast for once, the entire command line? It keeps getting cut.
- ods15
I was wrong. I guess I didn't save the file when I removed the edl stuff because it worked fine when I removed it and remembered to save the file. Anyway, here is the command line with the edl: mencoder $1 -oac mp3lame -lameopts cbr:br=128 -o /dev/null -vf pullup,pp=md -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=1:vqmin=2:vqmax=31 -edl edit.edl -hr-edl-seek - It's a bash script, so obviously $1 is the name of the file. The edl is just 5 lines: 0.0 2.5 0 346 558.5 0 898 964.6 0 1342.6 1366.8 0 1851.7 1889.4 0 Pete
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Pete Davis Sent: Friday, June 24, 2005 3:02 PM To: 'MEncoder usage discussions' Subject: RE: [MEncoder-users] Trimming video
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:28 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:08 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
On Fri, Jun 24, 2005 at 02:00:15PM -0500, Pete Davis wrote:
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2- v0.4.0b
There's nothing wrong here, this is standard output from MPlayer/Mencoder when opening an MPEG file when you don't have a hardware MPEG card. Is this the entire output? show -v. show the command line.
Sorry. Here's the whole output from the first encoding pass. Obviously
Segmentation fault is a bad sign. I tried it without the -edl
On Fri, Jun 24, 2005 at 02:19:54PM -0500, Pete Davis wrote: the parameters
which is exactly the way it was working before under pre6 and I still get the same segmentation fault.
OK, seems you found a bug (in my code..), could you send a small sample, your EDL, and atleast for once, the entire command line? It keeps getting cut.
- ods15
I was wrong. I guess I didn't save the file when I removed the edl stuff because it worked fine when I removed it and remembered to save the file.
Anyway, here is the command line with the edl:
mencoder $1 -oac mp3lame -lameopts cbr:br=128 -o /dev/null -vf pullup,pp=md -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=1:vqmin=2:vqmax=31 -edl edit.edl -hr-edl-seek -
It's a bash script, so obviously $1 is the name of the file.
The edl is just 5 lines:
0.0 2.5 0 346 558.5 0 898 964.6 0 1342.6 1366.8 0 1851.7 1889.4 0
Pete
As a test, I changed the 0.0 to 1.0 and it actually started to decode, but when it got to what I assume was the 1 second mark I got the following: 1 duplicate frame(s)! Pos: 0.2s 8f ( 0%) 0fps Trem: 0min 0mb A-V:0.023 [0:0] 1 duplicate frame(s)! Pos: 0.4s 17f ( 0%) 0fps Trem: 0min 0mb A-V:0.020 [0:0] 1 duplicate frame(s)! Reading from stdin... End: 2.50 Current: V: 2.47 A: 2.49 :0] success: format: 0 data: 0x0 - 0x0 And it just hung, I assume waiting for input from stdin. Pete
On Fri, Jun 24, 2005 at 03:02:18PM -0500, Pete Davis wrote:
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:28 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:08 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
On Fri, Jun 24, 2005 at 02:00:15PM -0500, Pete Davis wrote:
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder libmpeg2- v0.4.0b
There's nothing wrong here, this is standard output from MPlayer/Mencoder when opening an MPEG file when you don't have a hardware MPEG card. Is this the entire output? show -v. show the command line.
Sorry. Here's the whole output from the first encoding pass. Obviously
On Fri, Jun 24, 2005 at 02:19:54PM -0500, Pete Davis wrote: the
Segmentation fault is a bad sign. I tried it without the -edl parameters which is exactly the way it was working before under pre6 and I still get the same segmentation fault.
OK, seems you found a bug (in my code..), could you send a small sample, your EDL, and atleast for once, the entire command line? It keeps getting cut.
- ods15
I was wrong. I guess I didn't save the file when I removed the edl stuff because it worked fine when I removed it and remembered to save the file.
Anyway, here is the command line with the edl:
mencoder $1 -oac mp3lame -lameopts cbr:br=128 -o /dev/null -vf pullup,pp=md -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=1:vqmin=2:vqmax=31 -edl edit.edl -hr-edl-seek -
Why do you have that '-' at the end all the time? I kept thinking the command line was cut because I saw that. '-' means read from stdin, hence explaining your problem. I'm pretty sure you have no intent of this... I think the cause of your crash is a missing 'softskip' after vf_pullup! Use '-vf pullup,softskip' ALWAYS, it leads to crashes otherwise. Tell me if this helps. - ods15
On Fri, Jun 24, 2005 at 11:59:39PM +0300, Oded Shimon wrote:
Anyway, here is the command line with the edl:
mencoder $1 -oac mp3lame -lameopts cbr:br=128 -o /dev/null -vf pullup,pp=md -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=1:vqmin=2:vqmax=31 -edl edit.edl -hr-edl-seek -
Why do you have that '-' at the end all the time? I kept thinking the command line was cut because I saw that. '-' means read from stdin, hence explaining your problem. I'm pretty sure you have no intent of this...
I think the cause of your crash is a missing 'softskip' after vf_pullup! Use '-vf pullup,softskip' ALWAYS, it leads to crashes otherwise.
Not only thay, pp=md (or any deinterlacer) after pullup is total nonsense. It destroys the whole benefit of inverse telecine by clobbering the field pullup worked so hard to match... If the content is mixed telecine and interlaced video, use -vf filmdint. Otherwise choose between pullup and a deinterlacer according to your content. Rich
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 4:00 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:28 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
On Fri, Jun 24, 2005 at 02:19:54PM -0500, Pete Davis wrote:
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:08 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
On Fri, Jun 24, 2005 at 02:00:15PM -0500, Pete Davis wrote:
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder
v0.4.0b
There's nothing wrong here, this is standard output from MPlayer/Mencoder when opening an MPEG file when you don't have a hardware MPEG card. Is this the entire output? show -v. show the command line.
Sorry. Here's the whole output from the first encoding pass. Obviously the Segmentation fault is a bad sign. I tried it without the -edl
which is exactly the way it was working before under pre6 and I still get the same segmentation fault.
OK, seems you found a bug (in my code..), could you send a small sample, your EDL, and atleast for once, the entire command line? It keeps getting cut.
- ods15
I was wrong. I guess I didn't save the file when I removed the edl stuff because it worked fine when I removed it and remembered to save the file.
Anyway, here is the command line with the edl:
mencoder $1 -oac mp3lame -lameopts cbr:br=128 -o /dev/null -vf
On Fri, Jun 24, 2005 at 03:02:18PM -0500, Pete Davis wrote: libmpeg2- parameters pullup,pp=md
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=1:vqmin=2:vqmax=31 -edl edit.edl -hr-edl-seek -
Why do you have that '-' at the end all the time? I kept thinking the command line was cut because I saw that. '-' means read from stdin, hence explaining your problem. I'm pretty sure you have no intent of this...
I think the cause of your crash is a missing 'softskip' after vf_pullup! Use '-vf pullup,softskip' ALWAYS, it leads to crashes otherwise.
Tell me if this helps.
- ods15
As for Rich's question about why pullup and pp=md, that was based on this page: http://www.ee.oulu.fi/~tuukkat/mplayer/tests/deinttest2/readme.html And I have to say, the result sure seem better than pullup by itself. I don't really understand how the filters operate, but like I tried pullup by itself and pullup with pp=md and it was much nicer. I'm encoding mpegs that are coming straight from my Hauppauge PVR 150. (cat /dev/video > myfile.mpg) You're right, removing the - at the end fix it. I can't remember who told me to put those in. Some forum somewhere when I was first playing with mencoder. Maybe Linuxforums.org. I don't recall. Someone said I needed them, as I recall. Unfortunately, it's encoding less than a second of video, it looks like. Here's the output: ODML: Aspect information not (yet?) available or unspecified, not writing vprp h eader. 1 duplicate frame(s)! Pos: 0.2s 8f ( 0%) 0fps Trem: 0min 0mb A-V:0.023 [0:0] 1 duplicate frame(s)! Pos: 0.4s 17f ( 0%) 0fps Trem: 0min 0mb A-V:0.020 [0:0] 1 duplicate frame(s)! EDL SKIP: Start: 1.00 End: 2.50 Current: V: 2.47 A: 2.49 :0] Flushing video frames CBR audio: 16000 bytes/sec, 384 bytes/block Writing AVI index... Fixing AVI header... ODML: Aspect information not (yet?) available or unspecified, not writing vprp h eader. Video stream: 1576.276 kbit/s (197034 bps) size: 118339 bytes 0.601 secs 22 frames Audio stream: 128.000 kbit/s (16000 bps) size: 15744 bytes 0.984 secs Pete
On Fri, Jun 24, 2005 at 04:26:30PM -0500, Pete Davis wrote:
As for Rich's question about why pullup and pp=md, that was based on this page:
http://www.ee.oulu.fi/~tuukkat/mplayer/tests/deinttest2/readme.html
This person is smoking crack. Most likely they captured the video with a bttv card that ruins the chroma, or did some messed up cropping prior to encoding. Do you have a contact email for this person so I can let them know what they're doing wrong and ask them to take down the misleading recommendations?
And I have to say, the result sure seem better than pullup by itself. I
That's because their content is broken. Pullup is not helping at all -- pp=md alone would have done just as well for their purpose.
don't really understand how the filters operate, but like I tried pullup by itself and pullup with pp=md and it was much nicer.
Then this means pullup is not working on your content. Probably it's not telecined material!!!
I'm encoding mpegs that are coming straight from my Hauppauge PVR 150. (cat /dev/video > myfile.mpg)
Yes, but is it 60i video or telecined 24p movie? Rich
As for Rich's question about why pullup and pp=md, that was based on
On Fri, Jun 24, 2005 at 04:26:30PM -0500, Pete Davis wrote: this
page:
http://www.ee.oulu.fi/~tuukkat/mplayer/tests/deinttest2/readme.html
This person is smoking crack. Most likely they captured the video with a bttv card that ruins the chroma, or did some messed up cropping prior to encoding. Do you have a contact email for this person so I can let them know what they're doing wrong and ask them to take down the misleading recommendations?
No idea. I just came across it in a google search.
And I have to say, the result sure seem better than pullup by itself. I
That's because their content is broken. Pullup is not helping at all -- pp=md alone would have done just as well for their purpose.
I haven't tried pp=md alone. I'll see how that works out.
don't really understand how the filters operate, but like I tried pullup by itself and pullup with pp=md and it was much nicer.
Then this means pullup is not working on your content. Probably it's not telecined material!!!
No, it's not telecined.
I'm encoding mpegs that are coming straight from my Hauppauge PVR 150. (cat /dev/video > myfile.mpg)
Yes, but is it 60i video or telecined 24p movie?
I'm not sure what 60i or 24p are. It's definitely interlaced because without any filters, if I pause during movement, the interlacing is very obvious. It's 29.97 frames/sec. Pete
On Fri, Jun 24, 2005 at 10:19:37PM -0500, Pete Davis wrote:
I'm not sure what 60i or 24p are. It's definitely interlaced because without any filters, if I pause during movement, the interlacing is very obvious. It's 29.97 frames/sec.
Then you need to read about video before you try to encode... Otherwise you'll just make a mess. Rich
Rich Felker wrote:
On Fri, Jun 24, 2005 at 10:19:37PM -0500, Pete Davis wrote:
I'm not sure what 60i or 24p are. It's definitely interlaced because without any filters, if I pause during movement, the interlacing is very obvious. It's 29.97 frames/sec.
Then you need to read about video before you try to encode... Otherwise you'll just make a mess.
Or you can read about video AND experiment with encoding. You'll end up with horrible messes but you'll learn a lot from them. In fact I'd say that anyone who's never messed up something with mencoder hasn't experimented with it enough.
Rich Felker wrote:
On Fri, Jun 24, 2005 at 10:19:37PM -0500, Pete Davis wrote:
I'm not sure what 60i or 24p are. It's definitely interlaced because without any filters, if I pause during movement, the interlacing is very obvious. It's 29.97 frames/sec.
Then you need to read about video before you try to encode... Otherwise you'll just make a mess.
Or you can read about video AND experiment with encoding. You'll end up with horrible messes but you'll learn a lot from them. In fact I'd say that anyone who's never messed up something with mencoder hasn't experimented with it enough.
Thank you Scott, that's precisely my feeling. I have made some messes. I've also come up with a number of good encodings. Every day I learn a bit more. Pete
On Sat, Jun 25, 2005 at 01:23:07AM -0700, Scott W. Larson wrote:
Rich Felker wrote:
On Fri, Jun 24, 2005 at 10:19:37PM -0500, Pete Davis wrote:
I'm not sure what 60i or 24p are. It's definitely interlaced because without any filters, if I pause during movement, the interlacing is very obvious. It's 29.97 frames/sec.
Then you need to read about video before you try to encode... Otherwise you'll just make a mess.
Or you can read about video AND experiment with encoding. You'll end up with horrible messes but you'll learn a lot from them. In fact I'd say
For sure? Lots of people are too ignorant to begin with to tell if a video has been improperly deinterlaced. They can't see the difference in 30fps and 60fps, and can't tell if they've thrown away half the resolution either.. If they can't see the problem, how are they supposed to learn from it?
that anyone who's never messed up something with mencoder hasn't experimented with it enough.
:) Rich
Rich Felker wrote:
For sure? Lots of people are too ignorant to begin with to tell if a video has been improperly deinterlaced. They can't see the difference in 30fps and 60fps, and can't tell if they've thrown away half the resolution either.. If they can't see the problem, how are they supposed to learn from it?
If they can't see the problem... then I would say it isn't a problem for them. And I would not call these people "ignorant". I haven't seen anyone here who didn't want to learn about how something works. With the dozens of video formats and codecs in the world, it's not easy to know where to begin, especially since most books on digital video are either too generalized or assume you'll be using professional software. Yeah, I have several video files that I didn't encode very well before I knew what I was doing. I didn't know I didn't do a good job because they look better than a lot of stuff I see on the Internet today.
On Sat, 25 Jun 2005 16:02:10 -0700 "Scott W. Larson" <scowl@pacifier.com> wrote:
I haven't seen anyone here who didn't want to learn about how something works.
Really? I've seen quite a few people on this list, from time to time, who want everyone here to just tell them what command-line to use, and don't want to bother to read docs, or understand any of the concepts. Of course the large majority are trying to learn, but there's still quite a few who can't be bothered.
On Sat, 25 Jun 2005 16:02:10 -0700 "Scott W. Larson" <scowl@pacifier.com> wrote:
I haven't seen anyone here who didn't want to learn about how something works.
Really? I've seen quite a few people on this list, from time to time, who want everyone here to just tell them what command-line to use, and don't want to bother to read docs, or understand any of the concepts. Of course the large majority are trying to learn, but there's still quite a few who can't be bothered.
Not everyone wants to take the time to be experts in every piece of software they use. Sometimes they just want to use the software. I use word processors all the time, but I don't have the need nor the time, for that matter, to become a word processing expert. If I can set the margins, fonts, and handle other basics, that fits most of my needs. I don't want to be bothered with all the other aspects of it because it's a waste of my time to learn stuff I'm never going to have to use. The same applies to any piece of software. Unless there's some reason I NEED to be an expert in it, why should I spend time becoming an expert in it? Software is supposed to make our lives easier, not harder. Understand, I'm speaking from the point of view of an average user and not of myself in particular. 80-90% of the software I use (and there's a lot of it), I don't need to become an expert in and in most cases, spending the time to become an expert with it would simply be wasted time. The time lost in becoming an expert generally wouldn't be recovered in increased productivity.
From what I've seen, many people have a very limited list of requirements of mencoder. They want to use it in a fairly narrow range of situations.
For myself, I can list 3 general things that I use mencoder for. I would expect for a number of users, there needs are even fewer: 1: Encoding DVDs (granted, this covers a wide range because of the variation in how DVDs might be encoded to begin with). 2: Re-encoding existing AVIs to be compatible with my media player. I have a single script that works in about 90% of situations by simply re-encoding the audio as MP3, re-encoding the video into DivX, or doing both. 3: Encoding captured video from my PVR 150 into DivX/MP3 AVIs. Now the first one, unfortunately, requires quite a bit more knowledge than the latter 2 because I need to take into consideration the original encoding of the DVDs. #2 on occasion requires customized work, but I've found in most cases, I can make assumptions about the original video. Most of the time the issue is that the audio is in a format that's incompatible with my media player, the video uses an unsupported codec, or both. My script doesn't produce always high quality conversions, but in general, the difference isn't noticeable on my TV. A lot of users aren't concerned with producing the best possible encodings. I know there are users who are probably very picky about the quality and that's fine. But for me, the if the difference isn't noticeable on my mediocre TV then there's no value to it. I have no need to become an expert in mencoder. I simply want to learn enough to be able to encode things well enough to fit my needs, which aren't terribly stringent. That doesn't mean I expect people to produce my entire command line for me, but again, this goes back to the topic of examples that I originally mentioned. Seeing examples and seeing variations in them, helps me to understand how it works. Also keep in mind that a lot of users will have a desire to do some fairly limited encodings but may not have the natural aptitude to become an expert in the topic, even if they have the desire. The topic isn't exactly a simple one. I guess what I'm saying is that people shouldn't judge too harshly the people who have very limited needs of the software and don't bother learning every aspect of video encoding. I have to admit, when I first started using mencoder, I expected it to be a lot simper than it turned out to be and I suspect a lot of users come here with the assumption that what they're asking is simpler than it really is. You simply can't expect people to come in realizing the complexity of what they want to do right off the bat. While technically that is "ignorance," calling them ignorant, as Rich did, is a little harsh, I think. I'm sure a number of them are competent in areas that Rich is ignorant of and I'm sure he wouldn't want to be called ignorant if he asked them a question in one of those areas. Pete
On Sun, Jun 26, 2005 at 12:23:36PM -0500, Pete Davis wrote:
On Sat, 25 Jun 2005 16:02:10 -0700 "Scott W. Larson" <scowl@pacifier.com> wrote:
I haven't seen anyone here who didn't want to learn about how something works.
Really? I've seen quite a few people on this list, from time to time, who want everyone here to just tell them what command-line to use, and don't want to bother to read docs, or understand any of the concepts. Of course the large majority are trying to learn, but there's still quite a few who can't be bothered.
Not everyone wants to take the time to be experts in every piece of software they use. Sometimes they just want to use the software.
I use word processors all the time, but I don't have the need nor the time, for that matter, to become a word processing expert. If I can set the margins, fonts, and handle other basics, that fits most of my needs. I don't want to be bothered with all the other aspects of it because it's a waste of my time to learn stuff I'm never going to have to use.
The same applies to any piece of software. Unless there's some reason I NEED to be an expert in it, why should I spend time becoming an expert in it? Software is supposed to make our lives easier, not harder.
Repairing video from the crap that studios release/broadcast into something of decent quality IS a task at which you need to be an expert. At the very least it requires thoroughly understanding what they did to butcher it, and sometimes it even requires WRITING specialized software for the particular content you're dealing with. This is not child's play.
While technically that is "ignorance," calling them ignorant, as Rich did, is a little harsh, I think. I'm sure a number of them are competent in areas that Rich is ignorant of and I'm sure he wouldn't want to be called ignorant if he asked them a question in one of those areas.
If I ask a question, no. If I presume I can do something I have no idea about, then yes it's fair to call me ignorant. Rich
On Sun, Jun 26, 2005 at 12:23:36PM -0500, Pete Davis wrote:
On Sat, 25 Jun 2005 16:02:10 -0700 "Scott W. Larson" <scowl@pacifier.com> wrote:
I haven't seen anyone here who didn't want to learn about how something works.
Really? I've seen quite a few people on this list, from time to time, who want everyone here to just tell them what command-line to use, and don't want to bother to read docs, or understand any of the concepts. Of course the large majority are trying to learn, but there's still quite a few who can't be bothered.
Not everyone wants to take the time to be experts in every piece of software they use. Sometimes they just want to use the software.
I use word processors all the time, but I don't have the need nor the time, for that matter, to become a word processing expert. If I can set the margins, fonts, and handle other basics, that fits most of my needs. I don't want to be bothered with all the other aspects of it because it's a waste of my time to learn stuff I'm never going to have to use.
The same applies to any piece of software. Unless there's some reason I NEED to be an expert in it, why should I spend time becoming an expert in it? Software is supposed to make our lives easier, not harder.
Repairing video from the crap that studios release/broadcast into something of decent quality IS a task at which you need to be an expert. At the very least it requires thoroughly understanding what they did to butcher it, and sometimes it even requires WRITING specialized software for the particular content you're dealing with. This is not child's play.
Well, you just said the key words: "decent quality". What you consider decent quality and what I consider decent quality, I can almost guarantee you is different. It's entirely subjective. I've done some encodings that probably wouldn't meet your standards, but they meet mine just fine. Again, as long as it looks okay on MY TV, I'm happy. If it looks like crap on your computer/TV, that doesn't really matter to me unless I'm making it for your consumption. So far, all my encodings have been for my own consumption and my mediocre encodings fit my needs just fine without me having to be an expert in mencoder.
While technically that is "ignorance," calling them ignorant, as Rich did, is a little harsh, I think. I'm sure a number of them are competent in areas that Rich is ignorant of and I'm sure he wouldn't want to be called ignorant if he asked them a question in one of those areas.
If I ask a question, no. If I presume I can do something I have no idea about, then yes it's fair to call me ignorant.
Everyone makes presumptions. It's part of being a human being. We have preconceived ideas of how things operate and presume based on those ideas. Asking questions based on those preconceived ideas is perfectly normal. Insulting people for doing so is just plain rude. But I guess I'm suggesting the use of the word "ignorant" is a loaded word. I suspect your intention is to mean that they're ignorant in the ways of video encoding or something along those lines. However ignorant also means lacking in intelligence and knowledge in a more general sense and that's how it's usually taken. That's certainly how I normally interpret it if people don't qualify it. If you asked a bunch of people what ignorant means, I bet a good percentage would say "stupid." And frankly, to suggest that someone is ignorant in the general sense, based on their lack of knowledge of video encoding would be ridiculous. The fact is, calling someone ignorant is generally considered rude and I think in this case, unwarranted. But maybe I'm just overly sensitive. Pete
RC wrote:
Really? I've seen quite a few people on this list, from time to time, who want everyone here to just tell them what command-line to use, and don't want to bother to read docs, or understand any of the concepts.
Yes occasionally I've seen "tell me what to type" posts, but when they don't get an easy answer, they either start learning or they're never heard from again.
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:28 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
On Fri, Jun 24, 2005 at 02:19:54PM -0500, Pete Davis wrote:
From: mencoder-users-bounces@mplayerhq.hu [mailto:mencoder-users- bounces@mplayerhq.hu] On Behalf Of Oded Shimon Sent: Friday, June 24, 2005 2:08 PM To: MEncoder usage discussions Subject: Re: [MEncoder-users] Trimming video
On Fri, Jun 24, 2005 at 02:00:15PM -0500, Pete Davis wrote:
Opening video decoder: [mpegpes] MPEG 1/2 Video passthrough VDec: vo config request - 720 x 480 (preferred csp: Mpeg PES) [PP] Using external postprocessing filter, max q = 6. Could not find matching colorspace - retrying with -vf scale... Opening video filter: [scale] The selected video_out device is incompatible with this codec. VDecoder init failed :( Opening video decoder: [libmpeg2] MPEG 1/2 Video decoder
v0.4.0b
There's nothing wrong here, this is standard output from MPlayer/Mencoder when opening an MPEG file when you don't have a hardware MPEG card. Is this the entire output? show -v. show the command line.
Sorry. Here's the whole output from the first encoding pass. Obviously the Segmentation fault is a bad sign. I tried it without the -edl
which is exactly the way it was working before under pre6 and I still get the same segmentation fault.
OK, seems you found a bug (in my code..), could you send a small sample, your EDL, and atleast for once, the entire command line? It keeps getting cut.
- ods15
I was wrong. I guess I didn't save the file when I removed the edl stuff because it worked fine when I removed it and remembered to save the file.
Anyway, here is the command line with the edl:
mencoder $1 -oac mp3lame -lameopts cbr:br=128 -o /dev/null -vf
On Fri, Jun 24, 2005 at 03:02:18PM -0500, Pete Davis wrote: libmpeg2- parameters pullup,pp=md
-ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=1:vqmin=2:vqmax=31 -edl edit.edl -hr-edl-seek -
Why do you have that '-' at the end all the time? I kept thinking the command line was cut because I saw that. '-' means read from stdin, hence explaining your problem. I'm pretty sure you have no intent of this...
I think the cause of your crash is a missing 'softskip' after vf_pullup! Use '-vf pullup,softskip' ALWAYS, it leads to crashes otherwise.
Tell me if this helps.
- ods15
Oded, Trying to cut the beginning (at 0 seconds), is definitely causing a segmentation fault. Starting the cut after that works, but it's encoding less than 1 second of video. Maybe I'm misunderstanding how it's supposed to work. My edl (that marginally works for a bit less than a second) is: 1 2.5 0 346 558.5 0 898 964.6 0 1342.6 1366.8 0 1851.7 1889.4 0 So, my understanding is it would encode the first second of video, then skip the next second and a half, then record the next 343.5 seconds, then skip until 558.5 seconds at which point it resumes encoding, and so forth. Am I misunderstanding? Pete
On Fri, Jun 24, 2005 at 10:25:56PM -0500, Pete Davis wrote:
Oded,
Trying to cut the beginning (at 0 seconds), is definitely causing a segmentation fault. Starting the cut after that works, but it's encoding less than 1 second of video.
Thanks for the bug report, you found a nasty bug in MEncoder's EDL seek. I think I only half-fixed it so far, because i still get a segfault when I use mp3lame. I'm gonna keep looking. In the meanwhile, this patch will probably help you. - ods15
On Fri, Jun 24, 2005 at 10:25:56PM -0500, Pete Davis wrote:
Oded,
Trying to cut the beginning (at 0 seconds), is definitely causing a segmentation fault. Starting the cut after that works, but it's encoding less than 1 second of video.
Thanks for the bug report, you found a nasty bug in MEncoder's EDL seek. I think I only half-fixed it so far, because i still get a segfault when I use mp3lame. I'm gonna keep looking. In the meanwhile, this patch will probably help you.
- ods15
Thanks. I just patched it and started an encoding, but it died somewhere along the way because of the mp3lame stuff, I guess. A "Too many audio packets in the buffer" message. But it got quite a bit past the first edit location before that happened. Pete
Pete Davis wrote:
Sorry about the HTML. I didn't intend to send an HTML message. Stupid Outlook.
Actually, I tried before I posted which is why I posted.
It gives me an "error parsing cmdline" if I pass -edl edit.edl in the command line.
My actual mencoder commands are:
mencoder myfile.mpg -oac mp3lame -lameopts cbr:br=128 -o /dev/null -vf pullup,pp=md -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=1:vqmin=2:vqmax=31 -edl edit.edl -
mencoder myfile.mpg -oac mp3lame -lameopts cbr:br=128 -o newfile.avi -vf pullup,pp=md -ovc lavc -lavcopts vcodec=mpeg4:vbitrate=900:mbd=2:vpass=2:vqmin=2:vqmax=31 -edl edit.edl -
I tried placing the -edl right after the filename as well as where it is now to see if location in the command line was important.
I'm open to suggestions.
Pete
using avidemux2 is much easier :) Please, don't top post
participants (7)
-
Guillaume POIRIER -
Nico Sabbi -
Oded Shimon -
Pete Davis -
RC -
Rich Felker -
Scott W. Larson