Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Video Encoding > MPEG-4 AVC / H.264

Reply
 
Thread Tools Search this Thread Display Modes
Old 2nd April 2013, 18:01   #1  |  Link
Mtz
Registered User
 
Mtz's Avatar
 
Join Date: Sep 2003
Location: On The Beach
Posts: 714
How to demux avi with 2 video streams?

I have a H264 recorded video which contains 2 video streams because the recorder have 2 cameras.
In MPC-HC I cannot play correctly the file, but in VLC I can watch both video streams in separate windows.

MKVMerge Gui cannot mux, VirtualDub can mux only one stream, AviDemux is crashing, Yamb is havin some error even recognized the video tracks.

I want to extract both video because I want to make a PIP video.

If this thread is not OK here I hope the moderator to move it in the right place.

Thanks!
Mtz is offline   Reply With Quote
Old 2nd April 2013, 18:12   #2  |  Link
poisondeathray
Registered User
 
Join Date: Sep 2007
Posts: 5,374
You can use ffmpeg , using -map command for the stream

e.g
Code:
ffmpeg -i input.avi -map 0:0 -vcodec copy output0.mp4

ffmpeg -i input.avi -map 0:1 -vcodec copy output1.mp4
I used mp4 container for example, but you can use different container


Was this from a dashcam or something ?
poisondeathray is offline   Reply With Quote
Old 2nd April 2013, 18:44   #3  |  Link
Mtz
Registered User
 
Mtz's Avatar
 
Join Date: Sep 2003
Location: On The Beach
Posts: 714
Yes, is from a dashcam.
Do you know any program with GUI regarding your solution?
Mtz is offline   Reply With Quote
Old 3rd April 2013, 07:35   #4  |  Link
filler56789
SuperVirus
 
filler56789's Avatar
 
Join Date: Jun 2012
Location: Antarctic Japan
Posts: 1,351
Quote:
Originally Posted by Mtz View Post
Do you know any program with GUI regarding your solution?
Graphstudio
filler56789 is offline   Reply With Quote
Old 4th April 2013, 11:17   #5  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 7,277
cool MediaInfo totally fails on the file,...
__________________
Hybrid here in the forum, homepage
Selur is offline   Reply With Quote
Old 2nd June 2014, 08:57   #6  |  Link
hotzan
Registered User
 
hotzan's Avatar
 
Join Date: Apr 2014
Posts: 1
What dashcam are you using?

I've also been looking into dash cams because i always run into idiots on the road. People who drive in Vegas aren't fond of using blinkers and also some tourists tend to swerve and cut people off if they're trying not to miss an exit or are just plain lost and not attentive.

Anyone using these: http://www.szswill.com ?

Last edited by hotzan; 19th June 2014 at 07:04.
hotzan is offline   Reply With Quote
Old 2nd June 2014, 12:00   #7  |  Link
jmartinr
Registered User
 
jmartinr's Avatar
 
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
Quote:
Originally Posted by Mtz View Post
Do you know any program with GUI regarding your solution?
It's a bit outdated, but you could try Avi-Mux GUI.
__________________
Roelofs Coaching
jmartinr is online now   Reply With Quote
Old 2nd June 2014, 16:09   #8  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 693
Mtz, I don't know if this issue is still troubling you, but you don't have to extract anything. While your video on sendspace.com isn't available anymore, the video on the dashcam forum you linked to still is. I take it you have the same dashcam, so I messed around a bit...

Avisynth-script:
Code:
front=FFVideoSource("mdr_20130402_163942_I2_ORIGINAL.avi").AssumeFPS(12898,1001).Spline36Resize(1280,720)
back=FFVideoSource("mdr_20130402_163942_I2_ORIGINAL.avi",track=1).AssumeFPS(12898,1001).Crop(2,60,0,-60).Spline36Resize(352,198).FlipHorizontal()

StackHorizontal(front.Crop(0,0,-352,198),back)
StackVertical(last,front.Crop(0,198,0,0))

InterFrame(NewNum=25,NewDen=1,Cores=4)
- FFVideoSource (as well as LWLibavVideoSource) can open the secondary videostream with track=1
- AssumeFPS aligns the video- and audio duration. MediaInfo reports a framerate of 12.894fps, while FFMpeg reports 12.92fps, so as the framerate is already inconsistent, we might as well align it with the audiostream. The audiostream has 1329680samples, a frequency of 22050Hz and the videostream has 777frames; 777 / (1329680/22050) * 1001 = 12897.827.
If you're okay with the audio and video being a bit out of sync, then this step isn't really necessary though.
- FlipHorizontal ...camera footage appears to be mirrored by default, so as if you're looking through the rear-view mirror. With FlipHorizontal it's like you're actually looking behind you. Personal taste.
- StackHorizontal/Vertical ...alternative to Layer without the need to mess with colorspaces
- InterFrame ...artificially crank up the framerate to 25fps (optional)

Encode-process:
Code:
ffmpeg.exe -hide_banner -i "mdr_20130402_163942_I2_ORIGINAL.avs" -i "mdr_20130402_163942_I2_ORIGINAL.avi" -map 0 -map 1:2 ^
-c:v libx264 -preset slower -level 4.1 -bf 8 -me_range 24 -c:a libopus -ab 64k "mdr_20130402_163942_I2_ORIGINAL_FFMS2.mkv"
- open both the Avisynth-script and the AVI-file
- specify which stream to process; -map 0 (Avisynth videostream), -map 1:2 (AVI-file audiostream)
- x264 parameters
- opus parameters

End result.
__________________
My hobby website
Reino is offline   Reply With Quote
Old 2nd June 2014, 18:08   #9  |  Link
SeeMoreDigital
Life's clearer in 4K UHD
 
SeeMoreDigital's Avatar
 
Join Date: Jun 2003
Location: Notts, UK
Posts: 12,227
Hmmm...

This topic was originally posted by Mtz 14 months ago

EDIT: It would also appear that Mtz has not visited this forum since the 8th December 2013 20:14...
__________________
| I've been testing hardware media playback devices and software A/V encoders and decoders since 2001 | My Network Layout & A/V Gear |

Last edited by SeeMoreDigital; 2nd June 2014 at 18:44.
SeeMoreDigital is offline   Reply With Quote
Old 2nd June 2014, 18:20   #10  |  Link
Reino
Registered User
 
Reino's Avatar
 
Join Date: Nov 2005
Posts: 693
I know, but I didn't believe his question was answered yet.
__________________
My hobby website
Reino is offline   Reply With Quote
Old 2nd June 2014, 21:57   #11  |  Link
jmartinr
Registered User
 
jmartinr's Avatar
 
Join Date: Dec 2007
Location: Enschede, NL
Posts: 301
You got me. I only saw "April".
__________________
Roelofs Coaching
jmartinr is online now   Reply With Quote
Reply

Tags
2 videos, dual videos, multiple videos, two videos

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 17:17.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.