transcode for iPad2: video on channel 1???

About encoding, codec settings, muxers and filter usage
jeffhoye
New Cone
New Cone
Posts: 2
Joined: 22 Apr 2011 07:52

transcode for iPad2: video on channel 1???

Postby jeffhoye » 22 Apr 2011 08:19

My goal is to use VLC to transcode movies for my iPad2. I've found settings that give me a nice picture on the device, but no audio. The transcoded movie has audio when played in vlc and iTunes, but not when I copy it to the iPad. The strange thing is that when I look at the Codec Details in VLC, Stream 0 is Audio, and Stream 1 is Video!!! I suspect my problem is that the decoder in the iPad assumes that video streams should be before audio streams. I've used other tools to transcode for the iPad with success, and only my vlc transcodes come up with the funky Stream order. I can't seem to find the modern way to get a log file from the command line, but if you let me know, I'll post it (please recommend a verbosity). Here's my example command line:

vlc -vvv --logfile=vlc.log "input.m4v"
--sout=#transcode{vcodec=h264,venc=x264{profile=baseline,level=3.0,nocabac,nobframes,ref=1},
deinterlace,vb=1560,scale=1,aspect=4:3,padd=true,vfilter=canvas{width=1024,height=768},acodec=mp4a,ab=128,channels=2}
:file{dst="output.mp4"}

Is there a way to specify that video should be on channel 0 and audio on the later channels?

I encounter the same channel order problem when using the wizard.

System: Windows Vista 64, Vlc version 1.1.9, iPad Gen 2, iTunes 10.2.2.12

Danke!
-Jeff

kevv
New Cone
New Cone
Posts: 1
Joined: 12 Jun 2011 19:23

Re: transcode for iPad2: video on channel 1???

Postby kevv » 12 Jun 2011 19:32

This worked for me for a DVD -

vlc -vvv -I dummy dvdsimple:///dev/dvd --sout "#transcode{vcodec=h264,venc=x264{profile=baseline,level=3.0,nocabac,nobframes,ref=1},deinterlace,vb=1560,scale=1,aspect=4:3,padd=true,vfilter=canvas{width=1024,height=768},acodec=mp4a,ab=128,channels=2}:standard{mux=mp4,dst=file.mov,access=file}" vlc://quit

- it's just the combination of your command with one I found somewhere else - so don't ask me how it works ;-)

Kev.

account
New Cone
New Cone
Posts: 5
Joined: 16 Jun 2011 07:03

Re: transcode for iPad2: video on channel 1???

Postby account » 17 Jun 2011 14:47

i have the same issue. it has no sound in the iphone. but it could play it ok in the vlc and quicktime

Vlerk
New Cone
New Cone
Posts: 1
Joined: 09 Nov 2011 03:41

Re: transcode for iPad2: video on channel 1???

Postby Vlerk » 09 Nov 2011 04:15

I've been writing hundreds of sout commands the past few days in order to get a working mp4 on my iPad2. The problem where I'm stuck at is the same as jeffhoye. I've used an other tool to convert a movie to iPad proof encoding, and I've used it's codec results as basis for my script. (fps, width, height, codec, ab, vb)
VLC creates exact the same file, only the Audio and Video channels are swapped. (I can upload screenshots if you want). The new mp4 movie can't play the audio on my iPad2 and not on a iPhone4. Quicktime and VLC have no trouble playing the new file, the audio is inside the mp4.

The script is converting .asf files info .mp4 with vcodec=mp4v and acodec=mp4a.
The server is running on Windows 2003 with VLC 1.1.11

I also created seperate .aac files with acodec=mp4a and they work on the iPad!
Next step was to use input-slave to put this seperate audio file back in the movie. No succes. New file has audio but the iPad2 can't play the audio, it only shows the video.

More bizarre is when I rename the mp4 to mp3. The iPad plays the audio!
Can't be the <video src="archive.mp4" type="video/mp4" controls> I assume.

If anyone can help me, please!
Thanks in advance,

Erik

bsanspree
New Cone
New Cone
Posts: 1
Joined: 19 Dec 2011 23:46

Re: transcode for iPad2: video on channel 1???

Postby bsanspree » 19 Dec 2011 23:49

You need to set your audio codec to either aac or mp3

Code: Select all

acodec=mp3,ab=128
this sets the audio codec to mp3 with an audio bitrate of 128

scislot
New Cone
New Cone
Posts: 2
Joined: 27 Mar 2012 09:40

Re: transcode for iPad2: video on channel 1???

Postby scislot » 27 Mar 2012 11:33

Hi,

I'm currently trying to solve this issue as well. The last solution with encoding audio using mp3 doesn't seem to work, so it seams that the issue is still with streams order.

Do you know how to swap the video and audio stream order in mp4 container?

ToM

realjobe
Cone that earned his stripes
Cone that earned his stripes
Posts: 175
Joined: 10 Feb 2008 15:40

Re: transcode for iPad2: video on channel 1???

Postby realjobe » 27 Mar 2012 13:06

in vain

floodi
New Cone
New Cone
Posts: 1
Joined: 25 May 2012 09:17

Re: transcode for iPad2: video on channel 1???

Postby floodi » 25 May 2012 09:41

I'm experiencing the same problem. In the original file the first stream is video. After transcoding the audio stream is first and that make iOS movie player unhappy. I'm using vlc 2.0.1 distributed with Ubuntu 12.04.

Input file stream structure:(avprobe input.avi)
  • Stream #0.0: Video: mpeg4 (Simple Profile), yuv420p, 640x352 [PAR 1:1 DAR 20:11], 25 tbr, 25 tbn, 25 tbc
    Stream #0.1: Audio: mp3, 48000 Hz, stereo, s16, 128 kb/s
My transcoding command:

Code: Select all

vlc -I dummy metal.avi --sout '#transcode{vcodec=x264,venc=x264{keyint=60,profile=baseline,level=3.0,nocabac},vb=150,scale=0.5,acodec=mp3,ab=96,channels=2,samplerate=44100,soverlay}:standard{access=file,mux=ts,dst=output.ts}'
Output file stream structure:(avprobe output.ts)
  • Stream #0.0[0x44]: Audio: mp3, 44100 Hz, stereo, s16, 96 kb/s
    Stream #0.1[0x45]: Video: h264 (Constrained Baseline), yuv420p, 320x176 [PAR 1:1 DAR 20:11], 25 fps, 25 tbr, 90k tbn, 50 tbc
I can swap the streams by using ffmpeg with the following command:

Code: Select all

ffmpeg -i output.ts -vcodec copy -acodec copy -map 0.1 -map 0.0 output-swapped.ts
Is threre any way to trancode videos with video stream first by using only vlc? If I remember correctly this "audio first" behaviour is new and older vlc versions will output video stream first. I will check this.

jeffhoye
New Cone
New Cone
Posts: 2
Joined: 22 Apr 2011 07:52

Re: transcode for iPad2: video on channel 1???

Postby jeffhoye » 25 Feb 2013 20:12

Use VLC to transcode to .mp4, then if the video isn't the first stream...

use MP4Box (included in GPAC, which is free and good like VLC):
http://gpac.wp.mines-telecom.fr/downloads/

Then use this command to cross the streams (Scuse me Egon? You said crossing the streams was bad!)

MP4Box -add broken.mp4#video -add broken.mp4#audio fixed.mp4

broken.mp4 is the input, fixed.mp4 is the output.

Cheers!
-Jeff


Return to “VLC stream-output (sout)”

Who is online

Users browsing this forum: No registered users and 2 guests