News:

--

Main Menu

No video after re-encode

Started by UKenGB, August 20, 2019, 12:23:16 PM

Previous topic - Next topic

UKenGB

I'm using 2.7.4 in the latest Mojave release. I have an MP4 of a recording that I have trimmed and removed ads etc. Saved using copy for video and audio and the resultant video file plays perfectly everywhere. But, it was originally 21:9 rather than the recorded 16:9 so there are black bars top and bottom (and annoying logo on the upper bar). Easy to remove these I thought and so selected the H264 AVC encoder for the video and set the filter to crop it to suitable dimensions, left audio to copy and saved it.

Once the encoding had finished, I was unable to play it in QuickView (just a continuous daisy wheel) and in QuickTime and iTunes, it played with perfect audio but just a black screen. Needless to say, VLC played it perfectly, but I need it playable in iTunes.

I'm thinking it probably isn't the cropping that's the problem as any size/aspect ratio should still play. But when re-encoding video, there are a LOT of settings that can be made and I suspect I just need to select the correct ones in order for it to then be iTunes playable. But what settings to choose?

There's an iPhone preset, also fast, faster, ultra fast etc and also PSP (whatever that is), or it can be completely customised. None of the presets seem appropriate, so what settings/preset do I need to enable an encoded video to play in iTunes and the Apple TV?

eumagga0x2a

Please save the editing steps which result in an unplayable video as a project script, attach this .py file to your reply and provide a brief sample of the original file, cut in copy mode.

UKenGB

Contrary to what I thought, it is the cropping that causes the problem.

I saved a short test piece using copy. As expected, plays perfectly. I then re-encoded it without changing any settings (just shows as 'Custom') and no cropping. Again the result plays perfectly in QuickView.

I then cropped from 1920x1080 to 1920x800 as a filter and saved/encoded again, but now won't open in QuickView, audio only in QuickTime Player yet plays fine in VLC. So exactly the same result as with whole video file (but quicker to test).

Hope I've included what you need. Just let me know if you need anything else. Hopefully you can fix this as I'd like to be able to crop the borders off similarly afflicted videos.

UKenGB

My short clip is still way too large to attach here. How else can I send it to you to look at?

eumagga0x2a

Please use WeTransfer (contrary to the first impression, no email address is required), Mega, Dropbox or Google Drive.

I've re-encoded a short 1920x1080 video using x264 and crop filter settings as specified in your project script. QuickTime on my MBP running macOS 10.14.6 both standalone as well as media preview inside Finder has no difficuties to play the resulting 1920x800 video.

eumagga0x2a

Thank you for the sample. I re-encoded using your project script (obviously, with adjusted path to video) and QuickTime plays it just fine. But for QuickView to work, I had to use the MP4 muxer (which is recommended anyway), not the obsolete MP4v2 one like specified in your script.

UKenGB

Aha. I always use the V2 muxer as I (incorrectly) assumed that to be the later and therefore better option.

I tried again using the MP4 Muxer and now the resulting re-encoded and cropped file plays fine even in Finder. So it was a muxer problem. Is there a way to set MP4 Muxer as the default for Output Format?

eumagga0x2a

#7
Select MP4 muxer as output and press Alt+Command+D.

edit:

QuoteI always use the V2 muxer as I (incorrectly) assumed that to be the later and therefore better option.

yeah, it is exactly the other way round.

UKenGB

Quote from: eumagga0x2a on August 21, 2019, 03:50:47 PM
Select MP4 muxer as output and press Alt+Command+D.

I looked for something like that and missed it. Had to turn off a shortcut for hiding the Dock that used that combination (never used that shortcut anyway), but then worked fine. I guess I could have used the menu option, but hadn't found it then.

Quote
QuoteI always use the V2 muxer as I (incorrectly) assumed that to be the later and therefore better option.

yeah, it is exactly the other way round.

Who'd have thought.  :)

Thank you for your help. Much appreciated. I will now try to crop the entire movie and try to figure why my MBP cannot play videos with AC3 audio as I'm sure that is the issue. I remember this issue from before, but don't actually need it on the MBP so never bothered.

Thanks again.

One more thing though. Would it be better to enable Video Toolbox?

eumagga0x2a

Quote from: UKenGB on August 21, 2019, 04:10:44 PM
One more thing though. Would it be better to enable Video Toolbox?

Unless you invested heavily in your electricity supplier: yes, of course. It is beneficial from 1280x720 25fps H.264 up.

UKenGB

So it's hardware acceleration?

For:-
Decoding?
Encoding?

eumagga0x2a

#11
The checkbox is for HW accelerated decoding. There is also an independent VideoToolbox H264 encoder (edit: albeit without "H264" in its name) in the video output menu.

By the way, is the label "Decode video using VideoToolbox (macOS)" in a tab in the Preferences labeled "HW Accel" somewhat unclear?

If your question was related to VideoToolbox as such, yes, it is an interface for HW accelerated video decoding, filtering and encoding.

UKenGB

My MacBook Pro had Perian installed. The latest 1.2.3, but that seemed to be causing the problem in Mojave on the MBP. My Mac Pro did NOT have Perian installed and was able to play videos with AC3 audio.

I removed Perian from the MBP, restarted and now the same video with AC3 audio plays on both the MP and the MBP.

Looks like Mojave can play videos with AC3 audio just fine without any help and the previous fix for this (Perian) now prevents that. Oh well. Live and learn.

UKenGB

Quote from: eumagga0x2a on August 21, 2019, 05:07:51 PM
The checkbox is for HW accelerated decoding. There is also an independent VideoToolbox H264 encoder (edit: albeit without "H264" in its name) in the video output menu.

By the way, is the label "Decode video using VideoToolbox (macOS)" in a tab in the Preferences labeled "HW Accel" somewhat unclear?

If your question was related to VideoToolbox as such, yes, it is an interface for HW accelerated video decoding, filtering and encoding.

Yes, the description is clear, as long as it's accurate. There sometimes needs to be some interpretation of what is stated. E.g. there's an H264 encoder without H264 in the name I now realise. I will check that out, but it's in the middle of encoding right now. Had to start all over again due to a kernel panic. Not had that for years and now a big crash 10 minutes after enabling VideoToolbox. Hmmm.

I'll see how this goes.

UKenGB

Encoding cropped to 1920x800 now worked for whole movie, using H264 AVC video format and MP4 Muxer output. Then tried using Video Toolbox (which does show H264 once selected). But it cannot save. Error message says "cannot set up codec. Bitrate too low?". I tried upping the bitrate to 6000 and max to 8000, but same error.

Any clues as to how best to configure this video codec?